mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 05:51:02 +00:00
Update parity-codec/-derive to 3.1 (#1900)
* Update parity-codec/-derive to 3.1 * Update wasm stuff
This commit is contained in:
@@ -20,8 +20,8 @@ trie = { package = "substrate-trie", path = "../trie", optional = true }
|
||||
substrate-telemetry = { path = "../telemetry", optional = true }
|
||||
hash-db = { version = "0.11", optional = true }
|
||||
kvdb = { git = "https://github.com/paritytech/parity-common", optional = true, rev="b0317f649ab2c665b7987b8475878fc4d2e1f81d" }
|
||||
parity-codec = { version = "3.0", default-features = false }
|
||||
parity-codec-derive = { version = "3.0", default-features = false }
|
||||
parity-codec = { version = "3.1", default-features = false }
|
||||
parity-codec-derive = { version = "3.1", default-features = false }
|
||||
primitives = { package = "substrate-primitives", path = "../primitives", default-features = false }
|
||||
runtime-primitives = { package = "sr-primitives", path = "../sr-primitives", default-features = false }
|
||||
runtime-version = { package = "sr-version", path = "../sr-version", default-features = false }
|
||||
|
||||
@@ -17,8 +17,8 @@ primitives = { package = "substrate-primitives", path = "../../primitives" }
|
||||
runtime_primitives = { package = "sr-primitives", path = "../../sr-primitives" }
|
||||
client = { package = "substrate-client", path = "../../client" }
|
||||
state-machine = { package = "substrate-state-machine", path = "../../state-machine" }
|
||||
parity-codec = "3.0"
|
||||
parity-codec-derive = "3.0"
|
||||
parity-codec = "3.1"
|
||||
parity-codec-derive = "3.1"
|
||||
executor = { package = "substrate-executor", path = "../../executor" }
|
||||
state_db = { package = "substrate-state-db", path = "../../state-db" }
|
||||
trie = { package = "substrate-trie", path = "../../trie" }
|
||||
|
||||
@@ -6,7 +6,7 @@ description = "Aura consensus algorithm for substrate"
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
parity-codec = "3.0"
|
||||
parity-codec = "3.1"
|
||||
client = { package = "substrate-client", path = "../../client" }
|
||||
primitives = { package = "substrate-primitives", path = "../../primitives" }
|
||||
runtime_support = { package = "srml-support", path = "../../../srml/support" }
|
||||
|
||||
@@ -15,8 +15,8 @@ futures = "0.1"
|
||||
runtime_version = { package = "sr-version", path = "../../sr-version" }
|
||||
runtime_primitives = { package = "sr-primitives", path = "../../sr-primitives" }
|
||||
tokio = "0.1.7"
|
||||
parity-codec = "3.0"
|
||||
parity-codec-derive = "3.0"
|
||||
parity-codec = "3.1"
|
||||
parity-codec-derive = "3.1"
|
||||
|
||||
[dev-dependencies]
|
||||
test_client = { package = "substrate-test-client", path = "../../test-client" }
|
||||
|
||||
@@ -8,7 +8,7 @@ edition = "2018"
|
||||
[dependencies]
|
||||
futures = "0.1.17"
|
||||
codec = { package = "parity-codec", version = "3.0" }
|
||||
parity-codec-derive = { version = "3.0" }
|
||||
parity-codec-derive = { version = "3.1" }
|
||||
primitives = { package = "substrate-primitives", path = "../../primitives" }
|
||||
consensus = { package = "substrate-consensus-common", path = "../common" }
|
||||
client = { package = "substrate-client", path = "../../client" }
|
||||
|
||||
@@ -6,7 +6,7 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
error-chain = "0.12"
|
||||
parity-codec = "3.0"
|
||||
parity-codec = "3.1"
|
||||
runtime_io = { package = "sr-io", path = "../sr-io" }
|
||||
primitives = { package = "substrate-primitives", path = "../primitives" }
|
||||
trie = { package = "substrate-trie", path = "../trie" }
|
||||
|
||||
Generated
+28
-9
@@ -44,7 +44,7 @@ name = "impl-codec"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -54,7 +54,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "parity-codec"
|
||||
version = "3.0.0"
|
||||
version = "3.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"arrayvec 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -62,9 +62,10 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "parity-codec-derive"
|
||||
version = "3.0.0"
|
||||
version = "3.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"proc-macro-crate 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"proc-macro2 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -80,6 +81,14 @@ dependencies = [
|
||||
"uint 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro-crate"
|
||||
version = "0.1.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "proc-macro2"
|
||||
version = "0.4.19"
|
||||
@@ -141,7 +150,7 @@ name = "sr-io"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-std 0.1.0",
|
||||
"substrate-primitives 0.1.0",
|
||||
@@ -151,7 +160,7 @@ dependencies = [
|
||||
name = "sr-sandbox"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-std 0.1.0",
|
||||
"substrate-primitives 0.1.0",
|
||||
@@ -176,8 +185,8 @@ dependencies = [
|
||||
"byteorder 1.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hash256-std-hasher 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"primitive-types 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -194,6 +203,14 @@ dependencies = [
|
||||
"unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "toml"
|
||||
version = "0.4.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "uint"
|
||||
version = "0.6.1"
|
||||
@@ -218,9 +235,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
"checksum hash256-std-hasher 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f5c13dbac3cc50684760f54af18545c9e80fb75e93a3e586d71ebdc13138f6a4"
|
||||
"checksum impl-codec 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d2050d823639fbeae26b2b5ba09aca8907793117324858070ade0673c49f793b"
|
||||
"checksum nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "9a2228dca57108069a5262f2ed8bd2e82496d2e074a06d1ccc7ce1687b6ae0a2"
|
||||
"checksum parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "88f69984317b736dceac3baa86600fc089856f69b44b07231f39b5648b02bcd4"
|
||||
"checksum parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a58ba33211595f92cc2163ac583961d3dc767e656934146636b05256cc9acd7f"
|
||||
"checksum parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "67a4d27831e31e27f1454d6e3d3bb34bcac6bf7ad7032eed0ad0070dc8cf55c1"
|
||||
"checksum parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "864e9f66b58c0b38f0d6b511b6576afa2b678ae801b64220553bced57ac12df9"
|
||||
"checksum primitive-types 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "edb92f1ebfc177432c03287b15d48c202e6e2c95993a7af3ba039abb43b1492e"
|
||||
"checksum proc-macro-crate 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4c6cf4e5b00300d151dfffae39f529dfa5188f42eeb14201229aa420d6aad10c"
|
||||
"checksum proc-macro2 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)" = "ffe022fb8c8bd254524b0b3305906c1921fa37a84a644e29079a9e62200c3901"
|
||||
"checksum quote 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "dd636425967c33af890042c483632d33fa7a18f19ad1d7ea72e8998c6ef8dea5"
|
||||
"checksum rustc-hex 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "403bb3a286107a04825a5f82e1270acc1e14028d3d554d7a1e08914549575ab8"
|
||||
@@ -230,5 +248,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
"checksum serde 1.0.79 (registry+https://github.com/rust-lang/crates.io-index)" = "84257ccd054dc351472528c8587b4de2dbf0dc0fe2e634030c1a90bfdacebaa9"
|
||||
"checksum static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5"
|
||||
"checksum syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)" = "f92e629aa1d9c827b2bb8297046c1ccffc57c99b947a680d3ccff1f136a3bee9"
|
||||
"checksum toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f"
|
||||
"checksum uint 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e7780bb27fd8a22295e0d9d53ae3be253f715a0dccb1808527f478f1c2603708"
|
||||
"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
|
||||
|
||||
@@ -11,8 +11,8 @@ log = "0.4"
|
||||
parking_lot = "0.7.1"
|
||||
tokio = "0.1.7"
|
||||
rand = "0.6"
|
||||
parity-codec = "3.0"
|
||||
parity-codec-derive = "3.0"
|
||||
parity-codec = "3.1"
|
||||
parity-codec-derive = "3.1"
|
||||
runtime_primitives = { package = "sr-primitives", path = "../sr-primitives" }
|
||||
consensus_common = { package = "substrate-consensus-common", path = "../consensus/common" }
|
||||
substrate-primitives = { path = "../primitives" }
|
||||
|
||||
@@ -7,8 +7,8 @@ edition = "2018"
|
||||
[dependencies]
|
||||
client = { package = "substrate-client", path = "../../client", default-features = false }
|
||||
substrate-primitives = { path = "../../primitives", default-features = false }
|
||||
parity-codec = { version = "3.0", default-features = false }
|
||||
parity-codec-derive = { version = "3.0", default-features = false }
|
||||
parity-codec = { version = "3.1", default-features = false }
|
||||
parity-codec-derive = { version = "3.1", default-features = false }
|
||||
sr-primitives = { path = "../../sr-primitives", default-features = false }
|
||||
rstd = { package = "sr-std", path = "../../sr-std", default-features = false }
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ edition = "2018"
|
||||
[dependencies]
|
||||
parking_lot = { version = "0.7", optional = true }
|
||||
rstd = { package = "sr-std", path = "../sr-std", default-features = false }
|
||||
parity-codec = { version = "3.0", default-features = false }
|
||||
parity-codec-derive = { version = "3.0", default-features = false }
|
||||
parity-codec = { version = "3.1", default-features = false }
|
||||
parity-codec-derive = { version = "3.1", default-features = false }
|
||||
runtime_primitives = { package = "sr-primitives", path = "../sr-primitives", default-features = false }
|
||||
|
||||
[features]
|
||||
|
||||
@@ -25,8 +25,8 @@ primitives = { package = "substrate-primitives", path = "../../core/primitives"
|
||||
consensus = { package = "substrate-consensus-common", path = "../../core/consensus/common" }
|
||||
client = { package = "substrate-client", path = "../../core/client" }
|
||||
runtime_primitives = { package = "sr-primitives", path = "../../core/sr-primitives" }
|
||||
parity-codec = "3.0"
|
||||
parity-codec-derive = "3.0"
|
||||
parity-codec = "3.1"
|
||||
parity-codec-derive = "3.1"
|
||||
network_libp2p = { package = "substrate-network-libp2p", path = "../../core/network-libp2p" }
|
||||
tokio = "0.1.11"
|
||||
keyring = { package = "substrate-keyring", path = "../../core/keyring", optional = true }
|
||||
|
||||
@@ -6,8 +6,8 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
rstd = { package = "sr-std", path = "../sr-std", default-features = false }
|
||||
parity-codec = { version = "3.0", default-features = false }
|
||||
parity-codec-derive = { version = "3.0", default-features = false }
|
||||
parity-codec = { version = "3.1", default-features = false }
|
||||
parity-codec-derive = { version = "3.1", default-features = false }
|
||||
rustc-hex = { version = "2.0", default-features = false }
|
||||
serde = { version = "1.0", default-features = false }
|
||||
serde_derive = { version = "1.0", optional = true }
|
||||
|
||||
@@ -11,7 +11,7 @@ jsonrpc-pubsub = "10.0.1"
|
||||
jsonrpc-derive = "10.0.2"
|
||||
log = "0.4"
|
||||
parking_lot = "0.7.1"
|
||||
parity-codec = "3.0"
|
||||
parity-codec = "3.1"
|
||||
serde = "1.0"
|
||||
serde_derive = "1.0"
|
||||
serde_json = "1.0"
|
||||
|
||||
@@ -25,7 +25,7 @@ consensus_common = { package = "substrate-consensus-common", path = "../../core/
|
||||
network = { package = "substrate-network", path = "../../core/network" }
|
||||
client = { package = "substrate-client", path = "../../core/client" }
|
||||
client_db = { package = "substrate-client-db", path = "../../core/client/db" }
|
||||
parity-codec = "3.0"
|
||||
parity-codec = "3.1"
|
||||
substrate-executor = { path = "../../core/executor" }
|
||||
transaction_pool = { package = "substrate-transaction-pool", path = "../../core/transaction-pool" }
|
||||
rpc = { package = "substrate-rpc-servers", path = "../../core/rpc-servers" }
|
||||
|
||||
@@ -11,7 +11,7 @@ rustc_version = "0.2"
|
||||
[dependencies]
|
||||
rstd = { package = "sr-std", path = "../sr-std", default-features = false }
|
||||
primitives = { package = "substrate-primitives", path = "../primitives", default-features = false }
|
||||
parity-codec = { version = "3.0", default-features = false }
|
||||
parity-codec = { version = "3.1", default-features = false }
|
||||
hash-db = { version = "0.11", default-features = false }
|
||||
libsecp256k1 = { version = "0.2.1", optional = true }
|
||||
tiny-keccak = { version = "1.4.2", optional = true }
|
||||
|
||||
@@ -9,8 +9,8 @@ num-traits = { version = "0.2", default-features = false }
|
||||
integer-sqrt = { version = "0.1.2" }
|
||||
serde = { version = "1.0", optional = true }
|
||||
serde_derive = { version = "1.0", optional = true }
|
||||
parity-codec = { version = "3.0", default-features = false }
|
||||
parity-codec-derive = { version = "3.0", default-features = false }
|
||||
parity-codec = { version = "3.1", default-features = false }
|
||||
parity-codec-derive = { version = "3.1", default-features = false }
|
||||
substrate-primitives = { path = "../primitives", default-features = false }
|
||||
rstd = { package = "sr-std", path = "../sr-std", default-features = false }
|
||||
runtime_io = { package = "sr-io", path = "../sr-io", default-features = false }
|
||||
|
||||
@@ -8,8 +8,8 @@ edition = "2018"
|
||||
impl-serde = { version = "0.1", optional = true }
|
||||
serde = { version = "1.0", default-features = false }
|
||||
serde_derive = { version = "1.0", optional = true }
|
||||
parity-codec = { version = "3.0", default-features = false }
|
||||
parity-codec-derive = { version = "3.0", default-features = false }
|
||||
parity-codec = { version = "3.1", default-features = false }
|
||||
parity-codec-derive = { version = "3.1", default-features = false }
|
||||
rstd = { package = "sr-std", path = "../sr-std", default-features = false }
|
||||
runtime_primitives = { package = "sr-primitives", path = "../sr-primitives", default-features = false }
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ edition = "2018"
|
||||
parking_lot = "0.7.1"
|
||||
log = "0.4"
|
||||
primitives = { package = "substrate-primitives", path = "../../core/primitives" }
|
||||
parity-codec = "3.0"
|
||||
parity-codec-derive = "3.0"
|
||||
parity-codec = "3.1"
|
||||
parity-codec-derive = "3.1"
|
||||
|
||||
[dev-dependencies]
|
||||
env_logger = "0.6"
|
||||
|
||||
@@ -16,4 +16,4 @@ trie-root = "0.11"
|
||||
trie = { package = "substrate-trie", path = "../trie" }
|
||||
primitives = { package = "substrate-primitives", path = "../primitives" }
|
||||
panic-handler = { package = "substrate-panic-handler", path = "../panic-handler" }
|
||||
parity-codec = "3.0"
|
||||
parity-codec = "3.1"
|
||||
|
||||
@@ -8,7 +8,7 @@ edition = "2018"
|
||||
client = { package = "substrate-client", path = "../client" }
|
||||
client-db = { package = "substrate-client-db", path = "../client/db", features = ["test-helpers"] }
|
||||
futures = { version = "0.1.17" }
|
||||
parity-codec = "3.0"
|
||||
parity-codec = "3.1"
|
||||
executor = { package = "substrate-executor", path = "../executor" }
|
||||
consensus = { package = "substrate-consensus-common", path = "../consensus/common" }
|
||||
keyring = { package = "substrate-keyring", path = "../../core/keyring" }
|
||||
|
||||
@@ -9,8 +9,8 @@ log = { version = "0.4", optional = true }
|
||||
hex-literal = { version = "0.1.0", optional = true }
|
||||
serde = { version = "1.0", optional = true }
|
||||
serde_derive = { version = "1.0", optional = true }
|
||||
parity-codec = { version = "3.0", default-features = false }
|
||||
parity-codec-derive = { version = "3.0", default-features = false }
|
||||
parity-codec = { version = "3.1", default-features = false }
|
||||
parity-codec-derive = { version = "3.1", default-features = false }
|
||||
keyring = { package = "substrate-keyring", path = "../keyring", optional = true }
|
||||
substrate-client = { path = "../client", default-features = false }
|
||||
primitives = { package = "substrate-primitives", path = "../primitives", default-features = false }
|
||||
|
||||
+43
-39
@@ -425,7 +425,7 @@ name = "impl-codec"
|
||||
version = "0.2.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -700,7 +700,7 @@ source = "git+https://github.com/paritytech/parity-common?rev=b0317f649ab2c665b7
|
||||
|
||||
[[package]]
|
||||
name = "parity-codec"
|
||||
version = "3.0.0"
|
||||
version = "3.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"arrayvec 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -709,12 +709,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "parity-codec-derive"
|
||||
version = "3.0.0"
|
||||
version = "3.1.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"proc-macro-crate 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"syn 0.15.22 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -784,7 +785,7 @@ dependencies = [
|
||||
"proc-macro-hack 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"syn 0.15.22 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -831,7 +832,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"syn 0.15.22 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1036,7 +1037,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"syn 0.15.22 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1151,7 +1152,7 @@ dependencies = [
|
||||
"proc-macro-crate 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"syn 0.15.22 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1161,7 +1162,7 @@ dependencies = [
|
||||
"environmental 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libsecp256k1 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-std 0.1.0",
|
||||
"substrate-primitives 0.1.0",
|
||||
@@ -1177,8 +1178,8 @@ dependencies = [
|
||||
"integer-sqrt 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-io 0.1.0",
|
||||
@@ -1198,8 +1199,8 @@ name = "sr-version"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"impl-serde 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-primitives 0.1.0",
|
||||
@@ -1210,8 +1211,8 @@ dependencies = [
|
||||
name = "srml-metadata"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-std 0.1.0",
|
||||
@@ -1224,8 +1225,8 @@ version = "0.1.0"
|
||||
dependencies = [
|
||||
"hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"once_cell 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"paste 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1245,7 +1246,7 @@ dependencies = [
|
||||
"quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-api-macros 0.1.0",
|
||||
"srml-support-procedural-tools 0.1.0",
|
||||
"syn 0.15.22 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1256,7 +1257,7 @@ dependencies = [
|
||||
"proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"srml-support-procedural-tools-derive 0.1.0",
|
||||
"syn 0.15.22 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1265,7 +1266,7 @@ version = "0.1.0"
|
||||
dependencies = [
|
||||
"proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"quote 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"syn 0.15.22 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -1290,8 +1291,8 @@ dependencies = [
|
||||
"hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"kvdb 0.1.0 (git+https://github.com/paritytech/parity-common?rev=b0317f649ab2c665b7987b8475878fc4d2e1f81d)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-api-macros 0.1.0",
|
||||
"sr-primitives 0.1.0",
|
||||
@@ -1303,7 +1304,7 @@ dependencies = [
|
||||
"substrate-keyring 0.1.0",
|
||||
"substrate-primitives 0.1.0",
|
||||
"substrate-state-machine 0.1.0",
|
||||
"substrate-telemetry 0.3.0",
|
||||
"substrate-telemetry 0.3.1",
|
||||
"substrate-trie 0.4.0",
|
||||
]
|
||||
|
||||
@@ -1322,8 +1323,8 @@ dependencies = [
|
||||
"error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-primitives 0.1.0",
|
||||
"sr-version 0.1.0",
|
||||
"substrate-inherents 0.1.0",
|
||||
@@ -1340,7 +1341,7 @@ dependencies = [
|
||||
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libsecp256k1 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1359,8 +1360,8 @@ dependencies = [
|
||||
name = "substrate-inherents"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-primitives 0.1.0",
|
||||
"sr-std 0.1.0",
|
||||
@@ -1394,8 +1395,8 @@ dependencies = [
|
||||
"hash256-std-hasher 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"impl-serde 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"primitive-types 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"ring 0.14.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1426,7 +1427,7 @@ dependencies = [
|
||||
"heapsize 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"substrate-panic-handler 0.1.0",
|
||||
"substrate-primitives 0.1.0",
|
||||
@@ -1437,11 +1438,14 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "substrate-telemetry"
|
||||
version = "0.3.0"
|
||||
version = "0.3.1"
|
||||
dependencies = [
|
||||
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"slog 2.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"slog-async 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"slog-json 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1456,8 +1460,8 @@ dependencies = [
|
||||
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"hex-literal 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"serde_derive 1.0.81 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"sr-io 0.1.0",
|
||||
@@ -1485,7 +1489,7 @@ version = "0.4.0"
|
||||
dependencies = [
|
||||
"hash-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"memory-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"trie-db 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"trie-root 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
@@ -1497,7 +1501,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "syn"
|
||||
version = "0.15.22"
|
||||
version = "0.15.26"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
dependencies = [
|
||||
"proc-macro2 0.4.24 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
@@ -1950,8 +1954,8 @@ dependencies = [
|
||||
"checksum openssl-sys 0.9.40 (registry+https://github.com/rust-lang/crates.io-index)" = "1bb974e77de925ef426b6bc82fce15fd45bdcbeb5728bffcfc7cdeeb7ce1c2d6"
|
||||
"checksum owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "49a4b8ea2179e6a2e27411d3bca09ca6dd630821cf6894c6c7c8467a8ee7ef13"
|
||||
"checksum parity-bytes 0.1.0 (git+https://github.com/paritytech/parity-common?rev=b0317f649ab2c665b7987b8475878fc4d2e1f81d)" = "<none>"
|
||||
"checksum parity-codec 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "88f69984317b736dceac3baa86600fc089856f69b44b07231f39b5648b02bcd4"
|
||||
"checksum parity-codec-derive 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a58ba33211595f92cc2163ac583961d3dc767e656934146636b05256cc9acd7f"
|
||||
"checksum parity-codec 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "67a4d27831e31e27f1454d6e3d3bb34bcac6bf7ad7032eed0ad0070dc8cf55c1"
|
||||
"checksum parity-codec-derive 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "864e9f66b58c0b38f0d6b511b6576afa2b678ae801b64220553bced57ac12df9"
|
||||
"checksum parity-wasm 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)" = "511379a8194230c2395d2f5fa627a5a7e108a9f976656ce723ae68fca4097bfc"
|
||||
"checksum parking_lot 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "f0802bff09003b291ba756dc7e79313e51cc31667e94afbe847def490424cde5"
|
||||
"checksum parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ab41b4aed082705d1056416ae4468b6ea99d52599ecf3169b00088d43113e337"
|
||||
@@ -2005,7 +2009,7 @@ dependencies = [
|
||||
"checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8"
|
||||
"checksum static_assertions 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c19be23126415861cb3a23e501d34a708f7f9b2183c5252d690941c2e69199d5"
|
||||
"checksum subtle 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "702662512f3ddeb74a64ce2fbbf3707ee1b6bb663d28bb054e0779bbc720d926"
|
||||
"checksum syn 0.15.22 (registry+https://github.com/rust-lang/crates.io-index)" = "ae8b29eb5210bc5cf63ed6149cbf9adfc82ac0be023d8735c176ee74a2db4da7"
|
||||
"checksum syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)" = "f92e629aa1d9c827b2bb8297046c1ccffc57c99b947a680d3ccff1f136a3bee9"
|
||||
"checksum take_mut 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60"
|
||||
"checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b"
|
||||
"checksum time 0.1.40 (registry+https://github.com/rust-lang/crates.io-index)" = "d825be0eb33fda1a7e68012d51e9c7f451dc1a69391e7fdc197060bb8c56667b"
|
||||
|
||||
BIN
Binary file not shown.
@@ -8,7 +8,7 @@ edition = "2018"
|
||||
error-chain = "0.12"
|
||||
futures = "0.1"
|
||||
log = "0.4"
|
||||
parity-codec = "3.0"
|
||||
parity-codec = "3.1"
|
||||
parking_lot = "0.7.1"
|
||||
sr-primitives = { path = "../sr-primitives" }
|
||||
client = { package = "substrate-client", path = "../client" }
|
||||
|
||||
@@ -15,5 +15,5 @@ sr-primitives = { path = "../../sr-primitives" }
|
||||
|
||||
[dev-dependencies]
|
||||
assert_matches = "1.1"
|
||||
parity-codec = "3.0"
|
||||
parity-codec = "3.1"
|
||||
test_runtime = { package = "substrate-test-runtime", path = "../../test-runtime" }
|
||||
|
||||
@@ -5,5 +5,5 @@ authors = ["Parity Technologies <admin@parity.io>"]
|
||||
edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
parity-codec = "3.0"
|
||||
parity-codec-derive = "3.0"
|
||||
parity-codec = "3.1"
|
||||
parity-codec-derive = "3.1"
|
||||
|
||||
@@ -349,58 +349,66 @@ impl<H, N, V> ForkTree<H, N, V> where
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Decode, Encode)]
|
||||
#[cfg_attr(test, derive(PartialEq))]
|
||||
struct Node<H, N, V> {
|
||||
hash: H,
|
||||
number: N,
|
||||
data: V,
|
||||
children: Vec<Node<H, N, V>>,
|
||||
}
|
||||
// Workaround for: https://github.com/rust-lang/rust/issues/34537
|
||||
mod node_implementation {
|
||||
use super::*;
|
||||
|
||||
impl<H: PartialEq, N: Ord, V> Node<H, N, V> {
|
||||
fn import<F, E: std::error::Error>(
|
||||
&mut self,
|
||||
mut hash: H,
|
||||
mut number: N,
|
||||
mut data: V,
|
||||
is_descendent_of: &F,
|
||||
) -> Result<Option<(H, N, V)>, Error<E>>
|
||||
where E: fmt::Debug,
|
||||
F: Fn(&H, &H) -> Result<bool, E>,
|
||||
{
|
||||
if self.hash == hash {
|
||||
return Err(Error::Duplicate);
|
||||
};
|
||||
#[derive(Clone, Debug, Decode, Encode)]
|
||||
#[cfg_attr(test, derive(PartialEq))]
|
||||
pub struct Node<H, N, V> {
|
||||
pub hash: H,
|
||||
pub number: N,
|
||||
pub data: V,
|
||||
pub children: Vec<Node<H, N, V>>,
|
||||
}
|
||||
|
||||
if number <= self.number { return Ok(Some((hash, number, data))); }
|
||||
impl<H: PartialEq, N: Ord, V> Node<H, N, V> {
|
||||
pub fn import<F, E: std::error::Error>(
|
||||
&mut self,
|
||||
mut hash: H,
|
||||
mut number: N,
|
||||
mut data: V,
|
||||
is_descendent_of: &F,
|
||||
) -> Result<Option<(H, N, V)>, Error<E>>
|
||||
where E: fmt::Debug,
|
||||
F: Fn(&H, &H) -> Result<bool, E>,
|
||||
{
|
||||
if self.hash == hash {
|
||||
return Err(Error::Duplicate);
|
||||
};
|
||||
|
||||
for node in self.children.iter_mut() {
|
||||
match node.import(hash, number, data, is_descendent_of)? {
|
||||
Some((h, n, d)) => {
|
||||
hash = h;
|
||||
number = n;
|
||||
data = d;
|
||||
},
|
||||
None => return Ok(None),
|
||||
if number <= self.number { return Ok(Some((hash, number, data))); }
|
||||
|
||||
for node in self.children.iter_mut() {
|
||||
match node.import(hash, number, data, is_descendent_of)? {
|
||||
Some((h, n, d)) => {
|
||||
hash = h;
|
||||
number = n;
|
||||
data = d;
|
||||
},
|
||||
None => return Ok(None),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if is_descendent_of(&self.hash, &hash)? {
|
||||
self.children.push(Node {
|
||||
data,
|
||||
hash: hash,
|
||||
number: number,
|
||||
children: Vec::new(),
|
||||
});
|
||||
if is_descendent_of(&self.hash, &hash)? {
|
||||
self.children.push(Node {
|
||||
data,
|
||||
hash: hash,
|
||||
number: number,
|
||||
children: Vec::new(),
|
||||
});
|
||||
|
||||
Ok(None)
|
||||
} else {
|
||||
Ok(Some((hash, number, data)))
|
||||
Ok(None)
|
||||
} else {
|
||||
Ok(Some((hash, number, data)))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Workaround for: https://github.com/rust-lang/rust/issues/34537
|
||||
use node_implementation::Node;
|
||||
|
||||
struct ForkTreeIterator<'a, H, N, V> {
|
||||
stack: Vec<&'a Node<H, N, V>>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user