Unverified Commit 132e6479 authored by Bastian Köcher's avatar Bastian Köcher Committed by GitHub
Browse files

Rename to `parity-scale-codec` and revert version to 1.0 (#86)



* Rename to `parity-scale-codec` and revert version to 1.0

* Fix compilation after renaming

* Fix benchmarks

* Update src/lib.rs

Co-Authored-By: thiolliere's avatarthiolliere <gui.thiolliere@gmail.com>

* Remove last parity-codec leftovers
parent c7c18e7b
......@@ -90,8 +90,8 @@ dependencies = [
"rand_xoshiro 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rayon 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rayon-core 1.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.90 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.90 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)",
"tinytemplate 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -146,7 +146,7 @@ dependencies = [
"csv-core 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
"ryu 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.90 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
......@@ -230,39 +230,39 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "parity-codec"
version = "3.3.0"
name = "parity-scale-codec"
version = "1.0.0"
dependencies = [
"arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
"bitvec 0.11.1 (registry+https://github.com/rust-lang/crates.io-index)",
"byte-slice-cast 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"criterion 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-codec-derive 3.3.0",
"serde 1.0.90 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.90 (registry+https://github.com/rust-lang/crates.io-index)",
"parity-scale-codec-derive 1.0.0",
"serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "parity-codec-derive"
version = "3.3.0"
name = "parity-scale-codec-derive"
version = "1.0.0"
dependencies = [
"proc-macro-crate 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro-crate 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.34 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "proc-macro-crate"
version = "0.1.3"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
"toml 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "proc-macro2"
version = "0.4.27"
version = "0.4.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -273,7 +273,7 @@ name = "quote"
version = "0.6.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
......@@ -373,17 +373,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "serde"
version = "1.0.90"
version = "1.0.92"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "serde_derive"
version = "1.0.90"
version = "1.0.92"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.15.34 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
......@@ -393,15 +393,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"itoa 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
"ryu 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.90 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "syn"
version = "0.15.31"
version = "0.15.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)",
"proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
"quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
......@@ -430,16 +430,16 @@ name = "tinytemplate"
version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"serde 1.0.90 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "toml"
version = "0.4.10"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"serde 1.0.90 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
......@@ -520,8 +520,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum num-traits 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "6ba9a427cfca2be13aa6f6403b0b7e7368fe982bfa16fccc450ce74c46cd9b32"
"checksum num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1a23f0ed30a54abaa0c7e83b1d2d87ada7c3c23078d1d87815af3e3b6385fbba"
"checksum numtoa 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef"
"checksum proc-macro-crate 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4c6cf4e5b00300d151dfffae39f529dfa5188f42eeb14201229aa420d6aad10c"
"checksum proc-macro2 0.4.27 (registry+https://github.com/rust-lang/crates.io-index)" = "4d317f9caece796be1980837fd5cb3dfec5613ebdb04ad0956deea83ce168915"
"checksum proc-macro-crate 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "e10d4b51f154c8a7fb96fd6dad097cb74b863943ec010ac94b9fd1be8861fe1e"
"checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759"
"checksum quote 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "faf4799c5d274f3868a4aae320a0a182cbd2baee377b378f080e16a23e9d80db"
"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b"
"checksum rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d0e7a549d590831370895ab7ba4ea0c1b6b011d106b5ff2da6eee112615e6dc0"
......@@ -535,14 +535,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum ryu 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "b96a9549dc8d48f2c283938303c4b5a77aa29bfbc5b54b084fb1630408899a8f"
"checksum same-file 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8f20c4be53a8a1ff4c1f1b2bd14570d2f634628709752f0702ecdd2b3f9a5267"
"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27"
"checksum serde 1.0.90 (registry+https://github.com/rust-lang/crates.io-index)" = "aa5f7c20820475babd2c077c3ab5f8c77a31c15e16ea38687b4c02d3e48680f4"
"checksum serde_derive 1.0.90 (registry+https://github.com/rust-lang/crates.io-index)" = "58fc82bec244f168b23d1963b45c8bf5726e9a15a9d146a067f9081aeed2de79"
"checksum serde 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)" = "32746bf0f26eab52f06af0d0aa1984f641341d06d8d673c693871da2d188c9be"
"checksum serde_derive 1.0.92 (registry+https://github.com/rust-lang/crates.io-index)" = "46a3223d0c9ba936b61c0d2e3e559e3217dbfb8d65d06d26e8b3c25de38bae3e"
"checksum serde_json 1.0.39 (registry+https://github.com/rust-lang/crates.io-index)" = "5a23aa71d4a4d43fdbfaac00eff68ba8a06a51759a89ac3304323e800c4dd40d"
"checksum syn 0.15.31 (registry+https://github.com/rust-lang/crates.io-index)" = "d2b4cfac95805274c6afdb12d8f770fa2d27c045953e7b630a81801953699a9a"
"checksum syn 0.15.34 (registry+https://github.com/rust-lang/crates.io-index)" = "a1393e4a97a19c01e900df2aec855a29f71cf02c402e2f443b8d2747c25c5dbe"
"checksum termion 1.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dde0593aeb8d47accea5392b39350015b5eccb12c0d98044d856983d89548dea"
"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
"checksum tinytemplate 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4574b75faccaacddb9b284faecdf0b544b80b6b294f3d062d325c5726a209c20"
"checksum toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f"
"checksum toml 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b8c96d7873fa7ef8bdeb3a9cda3ac48389b4154f32b9803b4bc26220b677b039"
"checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526"
"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
"checksum walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "9d9d7ed3431229a144296213105a390676cc49c9b6a72bd19f3176c98e129fa1"
......
[package]
name = "parity-codec"
description = "Lightweight, efficient, binary serialization and deserialization codec"
version = "3.3.0"
name = "parity-scale-codec"
description = "SCALE - Simple Concatenating Aggregated Little Endians"
version = "1.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
license = "Apache-2.0"
repository = "https://github.com/paritytech/parity-codec"
repository = "https://github.com/paritytech/parity-scale-codec"
categories = ["encoding"]
edition = "2018"
[dependencies]
arrayvec = { version = "0.4", default-features = false, features = ["array-sizes-33-128", "array-sizes-129-255"] }
serde = { version = "1.0", optional = true }
parity-codec-derive = { path = "derive", version = "3.3", default-features = false, optional = true }
parity-scale-codec-derive = { path = "derive", version = "1.0", default-features = false, optional = true }
bitvec = { version = "0.11", default-features = false, features = ["alloc"], optional = true }
byte-slice-cast = { version = "0.3", optional = true }
[dev-dependencies]
serde_derive = { version = "1.0" }
parity-codec-derive = { path = "derive", version = "3.3", default-features = false }
parity-scale-codec-derive = { path = "derive", version = "1.0", default-features = false }
criterion = "0.2"
[[bench]]
......@@ -29,21 +29,15 @@ bench = false
[features]
default = ["std"]
derive = ["parity-codec-derive"]
derive = ["parity-scale-codec-derive"]
std = ["serde", "bitvec/std"]
bit-vec = ["bitvec", "byte-slice-cast"]
# WARNING: DO _NOT_ USE THIS FEATURE IF YOU ARE WORKING ON CONSENSUS CODE!*
#
# Provides implementations for more data structures than just Vec and Box.
# Concretely it will provide parity-codec implementations for many types
# Concretely it will provide parity-scale-codec implementations for many types
# that can be found in std and/or alloc (nightly).
#
# This feature was mainly introduced after it became clear that pDSL requires
# it for the sake of usability of its users.
#
# * For rational about this please visit:
# https://github.com/paritytech/parity-codec/pull/27#issuecomment-453031914
full = []
[workspace]
......
......@@ -12,18 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#[macro_use]
extern crate criterion;
#[macro_use]
extern crate parity_codec_derive;
use parity_scale_codec::*;
use parity_scale_codec_derive::{Encode, Decode};
use parity_codec::{Encode, Decode};
use parity_codec::*;
use criterion::{Criterion, black_box, Bencher, criterion_group, criterion_main};
use criterion::{Criterion, black_box, Bencher};
use std::time::Duration;
fn array_vec_write_u128(b: &mut Bencher) {
b.iter(|| {
for b in 0..black_box(1_000_000) {
......
[package]
name = "parity-codec-derive"
description = "Serialization and deserialization derive macro for Parity Codec"
version = "3.3.0"
name = "parity-scale-codec-derive"
description = "Serialization and deserialization derive macro for Parity SCALE Codec"
version = "1.0.0"
authors = ["Parity Technologies <admin@parity.io>"]
license = "Apache-2.0"
edition = "2018"
......
......@@ -92,7 +92,9 @@ fn create_decode_expr(field: &Field, name: &String, input: &TokenStream) -> Toke
let field_type = &field.ty;
quote_spanned! { field.span() =>
{
let res = <<#field_type as _parity_codec::HasCompact>::Type as _parity_codec::Decode>::decode(#input);
let res = <
<#field_type as _parity_scale_codec::HasCompact>::Type as _parity_scale_codec::Decode
>::decode(#input);
match res {
Err(_) => return Err(#err_msg.into()),
Ok(a) => a.into(),
......@@ -102,7 +104,7 @@ fn create_decode_expr(field: &Field, name: &String, input: &TokenStream) -> Toke
} else if let Some(encoded_as) = encoded_as {
quote_spanned! { field.span() =>
{
let res = <#encoded_as as _parity_codec::Decode>::decode(#input);
let res = <#encoded_as as _parity_scale_codec::Decode>::decode(#input);
match res {
Err(_) => return Err(#err_msg.into()),
Ok(a) => a.into(),
......@@ -114,7 +116,7 @@ fn create_decode_expr(field: &Field, name: &String, input: &TokenStream) -> Toke
} else {
quote_spanned! { field.span() =>
{
let res = _parity_codec::Decode::decode(#input);
let res = _parity_scale_codec::Decode::decode(#input);
match res {
Err(_) => return Err(#err_msg.into()),
Ok(a) => a,
......
......@@ -53,8 +53,8 @@ fn encode_single_field(
let field_type = &field.ty;
quote_spanned! {
field.span() => {
<<#field_type as _parity_codec::HasCompact>::Type as
_parity_codec::EncodeAsRef<'_, #field_type>>::RefType::from(#field_name)
<<#field_type as _parity_scale_codec::HasCompact>::Type as
_parity_scale_codec::EncodeAsRef<'_, #field_type>>::RefType::from(#field_name)
.using_encoded(#closure)
}
}
......@@ -63,13 +63,13 @@ fn encode_single_field(
quote_spanned! {
field.span() => {
<#encoded_as as
_parity_codec::EncodeAsRef<'_, #field_type>>::RefType::from(#field_name)
_parity_scale_codec::EncodeAsRef<'_, #field_type>>::RefType::from(#field_name)
.using_encoded(#closure)
}
}
} else {
quote_spanned! { field.span() =>
_parity_codec::Encode::using_encoded(&#field_name, #closure)
_parity_scale_codec::Encode::using_encoded(&#field_name, #closure)
}
}
}
......@@ -101,8 +101,8 @@ fn encode_fields<F>(
quote_spanned! {
f.span() => {
#dest.push(
&<<#field_type as _parity_codec::HasCompact>::Type as
_parity_codec::EncodeAsRef<'_, #field_type>>::RefType::from(#field)
&<<#field_type as _parity_scale_codec::HasCompact>::Type as
_parity_scale_codec::EncodeAsRef<'_, #field_type>>::RefType::from(#field)
);
}
}
......@@ -112,7 +112,7 @@ fn encode_fields<F>(
f.span() => {
#dest.push(
&<#encoded_as as
_parity_codec::EncodeAsRef<'_, #field_type>>::RefType::from(#field)
_parity_scale_codec::EncodeAsRef<'_, #field_type>>::RefType::from(#field)
);
}
}
......@@ -289,7 +289,7 @@ fn impl_encode(data: &Data, type_name: &Ident) -> TokenStream {
};
quote! {
fn encode_to<EncOut: _parity_codec::Output>(&#self_, #dest: &mut EncOut) {
fn encode_to<EncOut: _parity_scale_codec::Output>(&#self_, #dest: &mut EncOut) {
#encoding
}
}
......
......@@ -36,16 +36,16 @@ mod encode;
mod utils;
mod trait_bounds;
/// Include the `parity-codec` crate under a known name (`_parity_codec`).
fn include_parity_codec_crate() -> proc_macro2::TokenStream {
/// Include the `parity-scale-codec` crate under a known name (`_parity_scale_codec`).
fn include_parity_scale_codec_crate() -> proc_macro2::TokenStream {
// This "hack" is required for the tests.
if env::var("CARGO_PKG_NAME").unwrap() == "parity-codec" {
quote!( extern crate parity_codec as _parity_codec; )
if env::var("CARGO_PKG_NAME").unwrap() == "parity-scale-codec" {
quote!( extern crate parity_scale_codec as _parity_scale_codec; )
} else {
match crate_name("parity-codec") {
match crate_name("parity-scale-codec") {
Ok(parity_codec_crate) => {
let ident = Ident::new(&parity_codec_crate, Span::call_site());
quote!( extern crate #ident as _parity_codec; )
quote!( extern crate #ident as _parity_scale_codec; )
},
Err(e) => Error::new(Span::call_site(), &e).to_compile_error(),
}
......@@ -67,7 +67,7 @@ pub fn encode_derive(input: TokenStream) -> TokenStream {
&input.ident,
&mut input.generics,
&input.data,
parse_quote!(_parity_codec::Encode),
parse_quote!(_parity_scale_codec::Encode),
None,
) {
return e.to_compile_error().into();
......@@ -79,7 +79,7 @@ pub fn encode_derive(input: TokenStream) -> TokenStream {
let encode_impl = encode::quote(&input.data, name);
let impl_block = quote! {
impl #impl_generics _parity_codec::Encode for #name #ty_generics #where_clause {
impl #impl_generics _parity_scale_codec::Encode for #name #ty_generics #where_clause {
#encode_impl
}
};
......@@ -87,7 +87,7 @@ pub fn encode_derive(input: TokenStream) -> TokenStream {
let mut new_name = "_IMPL_ENCODE_FOR_".to_string();
new_name.push_str(name.to_string().trim_start_matches("r#"));
let dummy_const = Ident::new(&new_name, Span::call_site());
let parity_codec_crate = include_parity_codec_crate();
let parity_codec_crate = include_parity_scale_codec_crate();
let generated = quote! {
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
......@@ -118,7 +118,7 @@ pub fn decode_derive(input: TokenStream) -> TokenStream {
&input.ident,
&mut input.generics,
&input.data,
parse_quote!(_parity_codec::Decode),
parse_quote!(_parity_scale_codec::Decode),
Some(parse_quote!(Default))
) {
return e.to_compile_error().into();
......@@ -131,8 +131,10 @@ pub fn decode_derive(input: TokenStream) -> TokenStream {
let decoding = decode::quote(&input.data, name, &input_);
let impl_block = quote! {
impl #impl_generics _parity_codec::Decode for #name #ty_generics #where_clause {
fn decode<DecIn: _parity_codec::Input>(#input_: &mut DecIn) -> Result<Self, _parity_codec::Error> {
impl #impl_generics _parity_scale_codec::Decode for #name #ty_generics #where_clause {
fn decode<DecIn: _parity_scale_codec::Input>(
#input_: &mut DecIn
) -> Result<Self, _parity_scale_codec::Error> {
#decoding
}
}
......@@ -141,7 +143,7 @@ pub fn decode_derive(input: TokenStream) -> TokenStream {
let mut new_name = "_IMPL_DECODE_FOR_".to_string();
new_name.push_str(name.to_string().trim_start_matches("r#"));
let dummy_const = Ident::new(&new_name, Span::call_site());
let parity_codec_crate = include_parity_codec_crate();
let parity_codec_crate = include_parity_scale_codec_crate();
let generated = quote! {
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)]
......
......@@ -154,7 +154,7 @@ pub fn add(
where_clause.predicates.push(parse_quote!(#ty : #codec_bound))
});
let has_compact_bound: syn::Path = parse_quote!(_parity_codec::HasCompact);
let has_compact_bound: syn::Path = parse_quote!(_parity_scale_codec::HasCompact);
compact_types
.into_iter()
.for_each(|ty| {
......
......@@ -207,7 +207,7 @@ impl<T: arrayvec::Array<Item=u8>> Output for ArrayVecWrapper<T> {
}
}
/// This enum must not be exported and must only be instantiable by parity-codec.
/// This enum must not be exported and must only be instantiable by parity-scale-codec.
/// Because implementation of Encode and Decode for u8 is done in this crate
/// and there is not other usage.
pub enum IsU8 {
......
......@@ -25,18 +25,18 @@
#[macro_use]
extern crate alloc;
#[cfg(feature = "parity-codec-derive")]
#[cfg(feature = "parity-scale-codec-derive")]
#[allow(unused_imports)]
#[macro_use]
extern crate parity_codec_derive;
extern crate parity_scale_codec_derive;
#[cfg(all(feature = "std", test))]
#[macro_use]
extern crate serde_derive;
#[cfg(feature = "parity-codec-derive")]
#[cfg(feature = "parity-scale-codec-derive")]
#[doc(hidden)]
pub use parity_codec_derive::*;
pub use parity_scale_codec_derive::*;
#[cfg(feature = "std")]
#[doc(hidden)]
......
......@@ -16,9 +16,9 @@
extern crate serde_derive;
#[macro_use]
extern crate parity_codec_derive;
extern crate parity_scale_codec_derive;
use parity_codec::{Encode, Decode, HasCompact, Compact, EncodeAsRef, CompactAs};
use parity_scale_codec::{Encode, Decode, HasCompact, Compact, EncodeAsRef, CompactAs};
#[derive(Debug, PartialEq, Encode, Decode)]
struct Unit;
......
#[macro_use]
extern crate parity_codec_derive;
extern crate parity_scale_codec_derive;
use parity_codec::{Encode, HasCompact};
#[cfg(test)]
use parity_codec::Decode;
use parity_scale_codec::{Encode, HasCompact, Decode};
#[derive(Debug, PartialEq, Encode, Decode)]
struct S {
......
#[macro_use]
extern crate parity_codec_derive;
extern crate parity_scale_codec_derive;
use parity_codec::{Encode, Decode};
use parity_scale_codec::{Encode, Decode};
#[test]
fn enum_struct_test() {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment