mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-15 16:11:05 +00:00
Update parity-scale-codec to 2.0 (#7994)
* update cargo.toml * use 2.0 in mmmr
This commit is contained in:
committed by
GitHub
parent
bea4a6524d
commit
f48296e9ad
@@ -13,7 +13,7 @@ readme = "README.md"
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
|
||||
sp-api-proc-macro = { version = "2.0.0", path = "proc-macro" }
|
||||
sp-core = { version = "2.0.0", default-features = false, path = "../core" }
|
||||
sp-std = { version = "2.0.0", default-features = false, path = "../std" }
|
||||
|
||||
@@ -194,7 +194,7 @@ fn generate_native_call_generators(decl: &ItemTrait) -> Result<TokenStream> {
|
||||
<R as #crate_::DecodeLimit>::decode_with_depth_limit(
|
||||
#crate_::MAX_EXTRINSIC_DEPTH,
|
||||
&mut &#crate_::Encode::encode(input)[..],
|
||||
).map_err(|e| format!("{} {}", error_desc, e.what()))
|
||||
).map_err(|e| format!("{} {}", error_desc, e))
|
||||
}
|
||||
));
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ fn generate_impl_call(
|
||||
&#input,
|
||||
) {
|
||||
Ok(res) => res,
|
||||
Err(e) => panic!("Bad input data provided to {}: {}", #fn_name_str, e.what()),
|
||||
Err(e) => panic!("Bad input data provided to {}: {}", #fn_name_str, e),
|
||||
};
|
||||
|
||||
#[allow(deprecated)]
|
||||
|
||||
@@ -19,7 +19,7 @@ sp-runtime = { version = "2.0.0", path = "../../runtime" }
|
||||
sp-blockchain = { version = "2.0.0", path = "../../blockchain" }
|
||||
sp-consensus = { version = "0.8.0", path = "../../consensus/common" }
|
||||
sc-block-builder = { version = "0.8.0", path = "../../../client/block-builder" }
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6" }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0" }
|
||||
sp-state-machine = { version = "0.8.0", path = "../../state-machine" }
|
||||
trybuild = "1.0.38"
|
||||
rustversion = "1.0.0"
|
||||
|
||||
@@ -16,7 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
[dependencies]
|
||||
sp-core = { version = "2.0.0", default-features = false, path = "../core" }
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false, features = ["derive"] }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
|
||||
serde = { version = "1.0.101", optional = true, features = ["derive"] }
|
||||
sp-std = { version = "2.0.0", default-features = false, path = "../std" }
|
||||
sp-io = { version = "2.0.0", default-features = false, path = "../io" }
|
||||
|
||||
@@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false, features = ["derive"] }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
|
||||
integer-sqrt = "0.1.2"
|
||||
num-traits = { version = "0.2.8", default-features = false }
|
||||
sp-std = { version = "2.0.0", default-features = false, path = "../std" }
|
||||
@@ -26,7 +26,7 @@ sp-debug-derive = { version = "2.0.0", default-features = false, path = "../debu
|
||||
rand = "0.7.2"
|
||||
criterion = "0.3"
|
||||
serde_json = "1.0"
|
||||
primitive-types = "0.8.0"
|
||||
primitive-types = "0.9.0"
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
|
||||
@@ -16,7 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"]
|
||||
[dependencies]
|
||||
sp-arithmetic = { version = "2.0.0", path = ".." }
|
||||
honggfuzz = "0.5.49"
|
||||
primitive-types = "0.8.0"
|
||||
primitive-types = "0.9.0"
|
||||
num-bigint = "0.2"
|
||||
num-traits = "0.2"
|
||||
|
||||
|
||||
@@ -338,9 +338,9 @@ macro_rules! implement_per_thing {
|
||||
fn encode_as(&self) -> &Self::As {
|
||||
&self.0
|
||||
}
|
||||
fn decode_from(x: Self::As) -> Self {
|
||||
fn decode_from(x: Self::As) -> Result<Self, codec::Error> {
|
||||
// Saturates if `x` is more than `$max` internally.
|
||||
Self::from_parts(x)
|
||||
Ok(Self::from_parts(x))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
[dependencies]
|
||||
sp-application-crypto = { version = "2.0.0", default-features = false, path = "../application-crypto" }
|
||||
codec = { package = "parity-scale-codec", default-features = false, version = "1.3.6" }
|
||||
codec = { package = "parity-scale-codec", default-features = false, version = "2.0.0" }
|
||||
sp-std = { version = "2.0.0", default-features = false, path = "../std" }
|
||||
sp-api = { version = "2.0.0", default-features = false, path = "../api" }
|
||||
sp-runtime = { version = "2.0.0", default-features = false, path = "../runtime" }
|
||||
|
||||
@@ -16,7 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"]
|
||||
sp-inherents = { version = "2.0.0", default-features = false, path = "../inherents" }
|
||||
sp-runtime = { version = "2.0.0", default-features = false, path = "../runtime" }
|
||||
sp-std = { version = "2.0.0", default-features = false, path = "../std" }
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false, features = ["derive"] }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
|
||||
|
||||
[features]
|
||||
default = [ "std" ]
|
||||
|
||||
@@ -16,7 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"]
|
||||
sp-runtime = { version = "2.0.0", default-features = false, path = "../runtime" }
|
||||
sp-api = { version = "2.0.0", default-features = false, path = "../api" }
|
||||
sp-std = { version = "2.0.0", default-features = false, path = "../std" }
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
|
||||
sp-inherents = { version = "2.0.0", default-features = false, path = "../inherents" }
|
||||
|
||||
[features]
|
||||
|
||||
@@ -19,7 +19,7 @@ lru = "0.6.1"
|
||||
parking_lot = "0.11.1"
|
||||
thiserror = "1.0.21"
|
||||
futures = "0.3.9"
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false, features = ["derive"] }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
|
||||
sp-consensus = { version = "0.8.0", path = "../consensus/common" }
|
||||
sp-runtime = { version = "2.0.0", path = "../runtime" }
|
||||
sp-state-machine = { version = "0.8.0", path = "../state-machine" }
|
||||
|
||||
@@ -14,7 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
[dependencies]
|
||||
sp-application-crypto = { version = "2.0.0", default-features = false, path = "../../application-crypto" }
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
|
||||
sp-std = { version = "2.0.0", default-features = false, path = "../../std" }
|
||||
sp-api = { version = "2.0.0", default-features = false, path = "../../api" }
|
||||
sp-runtime = { version = "2.0.0", default-features = false, path = "../../runtime" }
|
||||
|
||||
@@ -71,10 +71,10 @@ pub type AuthorityIndex = u32;
|
||||
#[derive(Decode, Encode)]
|
||||
pub enum ConsensusLog<AuthorityId: Codec> {
|
||||
/// The authorities have changed.
|
||||
#[codec(index = "1")]
|
||||
#[codec(index = 1)]
|
||||
AuthoritiesChange(Vec<AuthorityId>),
|
||||
/// Disable the authority with given index.
|
||||
#[codec(index = "2")]
|
||||
#[codec(index = 2)]
|
||||
OnDisabled(AuthorityIndex),
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
[dependencies]
|
||||
sp-application-crypto = { version = "2.0.0", default-features = false, path = "../../application-crypto" }
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
|
||||
merlin = { version = "2.0", default-features = false }
|
||||
sp-std = { version = "2.0.0", default-features = false, path = "../../std" }
|
||||
sp-api = { version = "2.0.0", default-features = false, path = "../../api" }
|
||||
|
||||
@@ -73,13 +73,13 @@ pub struct SecondaryVRFPreDigest {
|
||||
#[derive(Clone, RuntimeDebug, Encode, Decode)]
|
||||
pub enum PreDigest {
|
||||
/// A primary VRF-based slot assignment.
|
||||
#[codec(index = "1")]
|
||||
#[codec(index = 1)]
|
||||
Primary(PrimaryPreDigest),
|
||||
/// A secondary deterministic slot assignment.
|
||||
#[codec(index = "2")]
|
||||
#[codec(index = 2)]
|
||||
SecondaryPlain(SecondaryPlainPreDigest),
|
||||
/// A secondary deterministic slot assignment with VRF outputs.
|
||||
#[codec(index = "3")]
|
||||
#[codec(index = 3)]
|
||||
SecondaryVRF(SecondaryVRFPreDigest),
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@ pub struct NextEpochDescriptor {
|
||||
#[derive(Decode, Encode, PartialEq, Eq, Clone, RuntimeDebug)]
|
||||
pub enum NextConfigDescriptor {
|
||||
/// Version 1.
|
||||
#[codec(index = "1")]
|
||||
#[codec(index = 1)]
|
||||
V1 {
|
||||
/// Value of `c` in `BabeEpochConfiguration`.
|
||||
c: (u64, u64),
|
||||
|
||||
@@ -125,14 +125,14 @@ pub enum ConsensusLog {
|
||||
/// The epoch has changed. This provides information about the _next_
|
||||
/// epoch - information about the _current_ epoch (i.e. the one we've just
|
||||
/// entered) should already be available earlier in the chain.
|
||||
#[codec(index = "1")]
|
||||
#[codec(index = 1)]
|
||||
NextEpochData(NextEpochDescriptor),
|
||||
/// Disable the authority with given index.
|
||||
#[codec(index = "2")]
|
||||
#[codec(index = 2)]
|
||||
OnDisabled(AuthorityIndex),
|
||||
/// The epoch has changed, and the epoch after the current one will
|
||||
/// enact different epoch configurations.
|
||||
#[codec(index = "3")]
|
||||
#[codec(index = 3)]
|
||||
NextConfigData(NextConfigDescriptor),
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ sp-runtime = { version = "2.0.0", path = "../../runtime" }
|
||||
sp-utils = { version = "2.0.0", path = "../../utils" }
|
||||
sp-trie = { version = "2.0.0", path = "../../trie" }
|
||||
sp-api = { version = "2.0.0", path = "../../api" }
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", features = ["derive"] }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", features = ["derive"] }
|
||||
parking_lot = "0.11.1"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
prometheus-endpoint = { package = "substrate-prometheus-endpoint", path = "../../../utils/prometheus", version = "0.8.0"}
|
||||
|
||||
@@ -17,7 +17,7 @@ sp-api = { version = "2.0.0", default-features = false, path = "../../api" }
|
||||
sp-std = { version = "2.0.0", default-features = false, path = "../../std" }
|
||||
sp-runtime = { version = "2.0.0", default-features = false, path = "../../runtime" }
|
||||
sp-core = { version = "2.0.0", default-features = false, path = "../../core" }
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false, features = ["derive"] }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
|
||||
@@ -13,7 +13,7 @@ readme = "README.md"
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false, features = ["derive"] }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
|
||||
sp-runtime = { version = "2.0.0", default-features = false, path = "../../runtime" }
|
||||
sp-arithmetic = { version = "2.0.0", default-features = false, path = "../../arithmetic" }
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ readme = "README.md"
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
[dependencies]
|
||||
codec = { version = "1.0.0", package = "parity-scale-codec", default-features = false }
|
||||
codec = { version = "2.0.0", package = "parity-scale-codec", default-features = false }
|
||||
schnorrkel = { version = "0.9.1", features = ["preaudit_deprecated", "u64_backend"], default-features = false }
|
||||
sp-std = { version = "2.0.0", path = "../../std", default-features = false }
|
||||
sp-core = { version = "2.0.0", path = "../../core", default-features = false }
|
||||
|
||||
@@ -14,11 +14,11 @@ targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
[dependencies]
|
||||
sp-std = { version = "2.0.0", default-features = false, path = "../std" }
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false, features = ["derive"] }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
|
||||
log = { version = "0.4.11", default-features = false }
|
||||
serde = { version = "1.0.101", optional = true, features = ["derive"] }
|
||||
byteorder = { version = "1.3.2", default-features = false }
|
||||
primitive-types = { version = "0.8.0", default-features = false, features = ["codec"] }
|
||||
primitive-types = { version = "0.9.0", default-features = false, features = ["codec"] }
|
||||
impl-serde = { version = "0.3.0", optional = true }
|
||||
wasmi = { version = "0.6.2", optional = true }
|
||||
hash-db = { version = "0.15.2", default-features = false }
|
||||
@@ -36,7 +36,7 @@ parking_lot = { version = "0.11.1", optional = true }
|
||||
sp-debug-derive = { version = "2.0.0", path = "../debug-derive" }
|
||||
sp-externalities = { version = "0.8.0", optional = true, path = "../externalities" }
|
||||
sp-storage = { version = "2.0.0", default-features = false, path = "../storage" }
|
||||
parity-util-mem = { version = "0.8.0", default-features = false, features = ["primitive-types"] }
|
||||
parity-util-mem = { version = "0.9.0", default-features = false, features = ["primitive-types"] }
|
||||
futures = { version = "0.3.1", optional = true }
|
||||
dyn-clonable = { version = "0.9.0", optional = true }
|
||||
thiserror = { version = "1.0.21", optional = true }
|
||||
|
||||
@@ -31,12 +31,12 @@ pub struct HostError;
|
||||
pub enum ExternEntity {
|
||||
/// Function that is specified by an index in a default table of
|
||||
/// a module that creates the sandbox.
|
||||
#[codec(index = "1")]
|
||||
#[codec(index = 1)]
|
||||
Function(u32),
|
||||
|
||||
/// Linear memory that is specified by some identifier returned by sandbox
|
||||
/// module upon creation new sandboxed memory.
|
||||
#[codec(index = "2")]
|
||||
#[codec(index = 2)]
|
||||
Memory(u32),
|
||||
}
|
||||
|
||||
|
||||
@@ -12,4 +12,4 @@ readme = "README.md"
|
||||
|
||||
[dependencies]
|
||||
parking_lot = "0.11.1"
|
||||
kvdb = "0.8.0"
|
||||
kvdb = "0.9.0"
|
||||
|
||||
@@ -13,7 +13,7 @@ readme = "README.md"
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "1.3.4", default-features = false, features = ["derive"] }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
|
||||
sp-std = { version = "2.0.1", default-features = false, path = "../std" }
|
||||
sp-arithmetic = { version = "2.0.1", default-features = false, path = "../arithmetic" }
|
||||
sp-npos-elections = { version = "2.0.1", default-features = false, path = "../npos-elections" }
|
||||
|
||||
@@ -17,7 +17,7 @@ targets = ["x86_64-unknown-linux-gnu"]
|
||||
sp-storage = { version = "2.0.0", path = "../storage", default-features = false }
|
||||
sp-std = { version = "2.0.0", path = "../std", default-features = false }
|
||||
environmental = { version = "1.1.2", default-features = false }
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
|
||||
@@ -15,8 +15,8 @@ targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false, features = ["derive"] }
|
||||
grandpa = { package = "finality-grandpa", version = "0.12.3", default-features = false, features = ["derive-codec"] }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
|
||||
grandpa = { package = "finality-grandpa", version = "0.13.0", default-features = false, features = ["derive-codec"] }
|
||||
log = { version = "0.4.8", optional = true }
|
||||
serde = { version = "1.0.101", optional = true, features = ["derive"] }
|
||||
sp-api = { version = "2.0.0", default-features = false, path = "../api" }
|
||||
|
||||
@@ -102,7 +102,7 @@ pub enum ConsensusLog<N: Codec> {
|
||||
/// This should be a pure function: i.e. as long as the runtime can interpret
|
||||
/// the digest type it should return the same result regardless of the current
|
||||
/// state.
|
||||
#[codec(index = "1")]
|
||||
#[codec(index = 1)]
|
||||
ScheduledChange(ScheduledChange<N>),
|
||||
/// Force an authority set change.
|
||||
///
|
||||
@@ -118,18 +118,18 @@ pub enum ConsensusLog<N: Codec> {
|
||||
/// This should be a pure function: i.e. as long as the runtime can interpret
|
||||
/// the digest type it should return the same result regardless of the current
|
||||
/// state.
|
||||
#[codec(index = "2")]
|
||||
#[codec(index = 2)]
|
||||
ForcedChange(N, ScheduledChange<N>),
|
||||
/// Note that the authority with given index is disabled until the next change.
|
||||
#[codec(index = "3")]
|
||||
#[codec(index = 3)]
|
||||
OnDisabled(AuthorityIndex),
|
||||
/// A signal to pause the current authority set after the given delay.
|
||||
/// After finalizing the block at _delay_ the authorities should stop voting.
|
||||
#[codec(index = "4")]
|
||||
#[codec(index = 4)]
|
||||
Pause(N),
|
||||
/// A signal to resume the current authority set after the given delay.
|
||||
/// After authoring the block at _delay_ the authorities should resume voting.
|
||||
#[codec(index = "5")]
|
||||
#[codec(index = 5)]
|
||||
Resume(N),
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ targets = ["x86_64-unknown-linux-gnu"]
|
||||
parking_lot = { version = "0.11.1", optional = true }
|
||||
sp-std = { version = "2.0.0", default-features = false, path = "../std" }
|
||||
sp-core = { version = "2.0.0", default-features = false, path = "../core" }
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false, features = ["derive"] }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
|
||||
thiserror = { version = "1.0.21", optional = true }
|
||||
|
||||
[features]
|
||||
|
||||
@@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
|
||||
hash-db = { version = "0.15.2", default-features = false }
|
||||
sp-core = { version = "2.0.0", default-features = false, path = "../core" }
|
||||
sp-keystore = { version = "0.8.0", default-features = false, optional = true, path = "../keystore" }
|
||||
|
||||
@@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"]
|
||||
[dependencies]
|
||||
async-trait = "0.1.30"
|
||||
derive_more = "0.99.2"
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false, features = ["derive"] }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
|
||||
futures = { version = "0.3.1" }
|
||||
schnorrkel = { version = "0.9.1", features = ["preaudit_deprecated", "u64_backend"], default-features = false }
|
||||
merlin = { version = "2.0", default-features = false }
|
||||
|
||||
@@ -13,7 +13,7 @@ readme = "README.md"
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false, features = ["derive"] }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
|
||||
serde = { version = "1.0.101", optional = true, features = ["derive"] }
|
||||
sp-std = { version = "2.0.0", default-features = false, path = "../std" }
|
||||
sp-npos-elections-compact = { version = "2.0.0", path = "./compact" }
|
||||
|
||||
@@ -19,7 +19,7 @@ sp-std = { version = "2.0.0", path = "../../std" }
|
||||
sp-runtime = { version = "2.0.0", path = "../../runtime" }
|
||||
honggfuzz = "0.5"
|
||||
rand = { version = "0.7.3", features = ["std", "small_rng"] }
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false, features = ["derive"] }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
|
||||
|
||||
[[bin]]
|
||||
name = "reduce"
|
||||
|
||||
@@ -19,9 +19,9 @@ sp-std = { version = "2.0.0", default-features = false, path = "../std" }
|
||||
sp-tracing = { version = "2.0.0", default-features = false, path = "../tracing" }
|
||||
sp-runtime-interface-proc-macro = { version = "2.0.0", path = "proc-macro" }
|
||||
sp-externalities = { version = "0.8.0", optional = true, path = "../externalities" }
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
|
||||
static_assertions = "1.0.0"
|
||||
primitive-types = { version = "0.8.0", default-features = false }
|
||||
primitive-types = { version = "0.9.0", default-features = false }
|
||||
sp-storage = { version = "2.0.0", default-features = false, path = "../storage" }
|
||||
impl-trait-for-tuples = "0.2.0"
|
||||
|
||||
|
||||
@@ -238,7 +238,7 @@ impl<T: codec::Codec> PassByImpl<T> for Codec<T> {
|
||||
let (ptr, len) = unpack_ptr_and_len(arg);
|
||||
let vec = context.read_memory(Pointer::new(ptr), len)?;
|
||||
T::decode(&mut &vec[..])
|
||||
.map_err(|e| format!("Could not decode value from wasm: {}", e.what()))
|
||||
.map_err(|e| format!("Could not decode value from wasm: {}", e))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
[dependencies]
|
||||
serde = { version = "1.0.101", optional = true, features = ["derive"] }
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false, features = ["derive"] }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
|
||||
sp-core = { version = "2.0.0", default-features = false, path = "../core" }
|
||||
sp-application-crypto = { version = "2.0.0", default-features = false, path = "../application-crypto" }
|
||||
sp-arithmetic = { version = "2.0.0", default-features = false, path = "../arithmetic" }
|
||||
@@ -26,7 +26,7 @@ log = { version = "0.4.8", optional = true }
|
||||
paste = "0.1.6"
|
||||
rand = { version = "0.7.2", optional = true }
|
||||
impl-trait-for-tuples = "0.2.0"
|
||||
parity-util-mem = { version = "0.8.0", default-features = false, features = ["primitive-types"] }
|
||||
parity-util-mem = { version = "0.9.0", default-features = false, features = ["primitive-types"] }
|
||||
hash256-std-hasher = { version = "0.15.2", default-features = false }
|
||||
either = { version = "1.5", default-features = false }
|
||||
|
||||
|
||||
@@ -107,13 +107,13 @@ impl Era {
|
||||
}
|
||||
|
||||
impl Encode for Era {
|
||||
fn encode_to<T: Output>(&self, output: &mut T) {
|
||||
fn encode_to<T: Output + ?Sized>(&self, output: &mut T) {
|
||||
match self {
|
||||
Era::Immortal => output.push_byte(0),
|
||||
Era::Mortal(period, phase) => {
|
||||
let quantize_factor = (*period as u64 >> 12).max(1);
|
||||
let encoded = (period.trailing_zeros() - 1).max(1).min(15) as u16 | ((phase / quantize_factor) << 4) as u16;
|
||||
output.push(&encoded);
|
||||
encoded.encode_to(output);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,12 +106,12 @@ impl<Number, Hash> Encode for Header<Number, Hash> where
|
||||
Hash: HashT,
|
||||
Hash::Output: Encode,
|
||||
{
|
||||
fn encode_to<T: Output>(&self, dest: &mut T) {
|
||||
dest.push(&self.parent_hash);
|
||||
dest.push(&<<<Number as HasCompact>::Type as EncodeAsRef<_>>::RefType>::from(&self.number));
|
||||
dest.push(&self.state_root);
|
||||
dest.push(&self.extrinsics_root);
|
||||
dest.push(&self.digest);
|
||||
fn encode_to<T: Output + ?Sized>(&self, dest: &mut T) {
|
||||
self.parent_hash.encode_to(dest);
|
||||
<<<Number as HasCompact>::Type as EncodeAsRef<_>>::RefType>::from(&self.number).encode_to(dest);
|
||||
self.state_root.encode_to(dest);
|
||||
self.extrinsics_root.encode_to(dest);
|
||||
self.digest.encode_to(dest);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -247,7 +247,7 @@ impl<'a, Xt> Deserialize<'a> for Block<Xt> where Block<Xt>: Decode {
|
||||
fn deserialize<D: Deserializer<'a>>(de: D) -> Result<Self, D::Error> {
|
||||
let r = <Vec<u8>>::deserialize(de)?;
|
||||
Decode::decode(&mut &r[..])
|
||||
.map_err(|e| DeError::custom(format!("Invalid value passed into decode: {}", e.what())))
|
||||
.map_err(|e| DeError::custom(format!("Invalid value passed into decode: {}", e)))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ sp-core = { version = "2.0.0", default-features = false, path = "../core" }
|
||||
sp-std = { version = "2.0.0", default-features = false, path = "../std" }
|
||||
sp-io = { version = "2.0.0", default-features = false, path = "../io" }
|
||||
sp-wasm-interface = { version = "2.0.0", default-features = false, path = "../wasm-interface" }
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
|
||||
|
||||
[dev-dependencies]
|
||||
wat = "1.0"
|
||||
|
||||
@@ -13,7 +13,7 @@ readme = "README.md"
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false, features = ["derive"] }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
|
||||
sp-api = { version = "2.0.0", default-features = false, path = "../api" }
|
||||
sp-core = { version = "2.0.0", default-features = false, path = "../core" }
|
||||
sp-std = { version = "2.0.0", default-features = false, path = "../std" }
|
||||
|
||||
@@ -13,7 +13,7 @@ readme = "README.md"
|
||||
targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false, features = ["derive"] }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
|
||||
sp-runtime = { version = "2.0.0", default-features = false, path = "../runtime" }
|
||||
sp-std = { version = "2.0.0", default-features = false, path = "../std" }
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ trie-root = { version = "0.16.0", default-features = false }
|
||||
sp-trie = { version = "2.0.0", path = "../trie", default-features = false }
|
||||
sp-core = { version = "2.0.0", path = "../core", default-features = false }
|
||||
sp-panic-handler = { version = "2.0.0", path = "../panic-handler", optional = true }
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
|
||||
num-traits = { version = "0.2.8", default-features = false }
|
||||
rand = { version = "0.7.2", optional = true }
|
||||
sp-externalities = { version = "0.8.0", path = "../externalities", default-features = false }
|
||||
|
||||
@@ -123,7 +123,7 @@ impl<Number: BlockNumber> ExtrinsicIndex<Number> {
|
||||
}
|
||||
|
||||
impl<Number: BlockNumber> Encode for ExtrinsicIndex<Number> {
|
||||
fn encode_to<W: Output>(&self, dest: &mut W) {
|
||||
fn encode_to<W: Output + ?Sized>(&self, dest: &mut W) {
|
||||
dest.push_byte(1);
|
||||
self.block.encode_to(dest);
|
||||
self.key.encode_to(dest);
|
||||
@@ -142,7 +142,7 @@ impl<Number: BlockNumber> DigestIndex<Number> {
|
||||
|
||||
|
||||
impl<Number: BlockNumber> Encode for DigestIndex<Number> {
|
||||
fn encode_to<W: Output>(&self, dest: &mut W) {
|
||||
fn encode_to<W: Output + ?Sized>(&self, dest: &mut W) {
|
||||
dest.push_byte(2);
|
||||
self.block.encode_to(dest);
|
||||
self.key.encode_to(dest);
|
||||
@@ -158,7 +158,7 @@ impl<Number: BlockNumber> ChildIndex<Number> {
|
||||
}
|
||||
|
||||
impl<Number: BlockNumber> Encode for ChildIndex<Number> {
|
||||
fn encode_to<W: Output>(&self, dest: &mut W) {
|
||||
fn encode_to<W: Output + ?Sized>(&self, dest: &mut W) {
|
||||
dest.push_byte(3);
|
||||
self.block.encode_to(dest);
|
||||
self.storage_key.encode_to(dest);
|
||||
|
||||
@@ -19,7 +19,7 @@ serde = { version = "1.0.101", optional = true, features = ["derive"] }
|
||||
impl-serde = { version = "0.3.1", optional = true }
|
||||
ref-cast = "1.0.0"
|
||||
sp-debug-derive = { version = "2.0.0", path = "../debug-derive" }
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false, features = ["derive"] }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
|
||||
|
||||
[features]
|
||||
default = [ "std" ]
|
||||
|
||||
@@ -22,7 +22,7 @@ sp-runtime-interface = { version = "2.0.0", default-features = false, path = "..
|
||||
sp-std = { version = "2.0.0", default-features = false, path = "../std" }
|
||||
|
||||
[dev-dependencies]
|
||||
codec = { package = "parity-scale-codec", default-features = false, version = "1.3.6" }
|
||||
codec = { package = "parity-scale-codec", default-features = false, version = "2.0.0" }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
|
||||
@@ -13,11 +13,11 @@ targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
[dependencies]
|
||||
sp-application-crypto = { version = "2.0.0", default-features = false, path = "../application-crypto" }
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false, features = ["derive"] }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
|
||||
sp-core = { version = "2.0.0", default-features = false, path = "../core" }
|
||||
serde = { version = "1.0.101", optional = true, features = ["derive"] }
|
||||
sp-runtime = { version = "2.0.0", default-features = false, path = "../runtime" }
|
||||
parity-util-mem = { version = "0.8.0", default-features = false, features = ["primitive-types"] }
|
||||
parity-util-mem = { version = "0.9.0", default-features = false, features = ["primitive-types"] }
|
||||
|
||||
[features]
|
||||
default = [
|
||||
|
||||
@@ -16,7 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"]
|
||||
sp-api = { version = "2.0.0", default-features = false, path = "../api" }
|
||||
sp-std = { version = "2.0.0", default-features = false, path = "../std" }
|
||||
sp-runtime = { version = "2.0.0", default-features = false, path = "../runtime" }
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false, features = ["derive"] }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
|
||||
sp-inherents = { version = "2.0.0", default-features = false, path = "../inherents" }
|
||||
impl-trait-for-tuples = "0.2.0"
|
||||
wasm-timer = { version = "0.2", optional = true }
|
||||
|
||||
@@ -19,7 +19,7 @@ targets = ["x86_64-unknown-linux-gnu", "wasm32-unknown-unknown"]
|
||||
|
||||
[dependencies]
|
||||
sp-std = { version = "2.0.0", path = "../std", default-features = false}
|
||||
codec = { version = "1.3.1", package = "parity-scale-codec", default-features = false, features = ["derive"]}
|
||||
codec = { version = "2.0.0", package = "parity-scale-codec", default-features = false, features = ["derive"]}
|
||||
tracing = { version = "0.1.22", default-features = false }
|
||||
tracing-core = { version = "0.1.17", default-features = false }
|
||||
log = { version = "0.4.8", optional = true }
|
||||
|
||||
@@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"]
|
||||
|
||||
[dependencies]
|
||||
thiserror = { version = "1.0.21", optional = true }
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", optional = true }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", optional = true }
|
||||
derive_more = { version = "0.99.11", optional = true }
|
||||
futures = { version = "0.3.1", optional = true }
|
||||
log = { version = "0.4.8", optional = true }
|
||||
|
||||
@@ -18,16 +18,16 @@ name = "bench"
|
||||
harness = false
|
||||
|
||||
[dependencies]
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false }
|
||||
sp-std = { version = "2.0.0", default-features = false, path = "../std" }
|
||||
hash-db = { version = "0.15.2", default-features = false }
|
||||
trie-db = { version = "0.22.2", default-features = false }
|
||||
trie-root = { version = "0.16.0", default-features = false }
|
||||
memory-db = { version = "0.25.0", default-features = false }
|
||||
memory-db = { version = "0.26.0", default-features = false }
|
||||
sp-core = { version = "2.0.0", default-features = false, path = "../core" }
|
||||
|
||||
[dev-dependencies]
|
||||
trie-bench = "0.26.0"
|
||||
trie-bench = "0.27.0"
|
||||
trie-standardmap = "0.15.2"
|
||||
criterion = "0.3.3"
|
||||
hex-literal = "0.3.1"
|
||||
|
||||
@@ -49,7 +49,7 @@ impl StdError for Error {
|
||||
impl fmt::Display for Error {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match self {
|
||||
Error::Decode(e) => write!(f, "Decode error: {}", e.what()),
|
||||
Error::Decode(e) => write!(f, "Decode error: {}", e),
|
||||
Error::BadFormat => write!(f, "Bad format"),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ pub(crate) enum NodeKind {
|
||||
}
|
||||
|
||||
impl Encode for NodeHeader {
|
||||
fn encode_to<T: Output>(&self, output: &mut T) {
|
||||
fn encode_to<T: Output + ?Sized>(&self, output: &mut T) {
|
||||
match self {
|
||||
NodeHeader::Null => output.push_byte(trie_constants::EMPTY_TRIE),
|
||||
NodeHeader::Branch(true, nibble_count) =>
|
||||
@@ -99,7 +99,7 @@ pub(crate) fn size_and_prefix_iterator(size: usize, prefix: u8) -> impl Iterator
|
||||
}
|
||||
|
||||
/// Encodes size and prefix to a stream output.
|
||||
fn encode_size_and_prefix(size: usize, prefix: u8, out: &mut impl Output) {
|
||||
fn encode_size_and_prefix<W: Output + ?Sized>(size: usize, prefix: u8, out: &mut W) {
|
||||
for b in size_and_prefix_iterator(size, prefix) {
|
||||
out.push_byte(b)
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ targets = ["x86_64-unknown-linux-gnu"]
|
||||
[dependencies]
|
||||
impl-serde = { version = "0.3.1", optional = true }
|
||||
serde = { version = "1.0.101", optional = true, features = ["derive"] }
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false, features = ["derive"] }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
|
||||
sp-std = { version = "2.0.0", default-features = false, path = "../std" }
|
||||
sp-runtime = { version = "2.0.0", default-features = false, path = "../runtime" }
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ targets = ["x86_64-unknown-linux-gnu"]
|
||||
wasmi = { version = "0.6.2", optional = true }
|
||||
impl-trait-for-tuples = "0.2.0"
|
||||
sp-std = { version = "2.0.0", path = "../std", default-features = false }
|
||||
codec = { package = "parity-scale-codec", version = "1.3.6", default-features = false, features = ["derive"] }
|
||||
codec = { package = "parity-scale-codec", version = "2.0.0", default-features = false, features = ["derive"] }
|
||||
|
||||
[features]
|
||||
default = [ "std" ]
|
||||
|
||||
Reference in New Issue
Block a user