Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Fetch parity-common dependencies from crates (#617)
Browse files Browse the repository at this point in the history
* Fetch parity-common dependencies from crates

* Update triehash

* Fix code to fit latest triehash
Fetch kvdb-rocksdb from crates

* type params

* lockfile

* lockfiles

* wasm binaries and lockfile
  • Loading branch information
dvdplm authored and gavofyork committed Sep 5, 2018
1 parent 95df01d commit 2cc2a3b
Show file tree
Hide file tree
Showing 24 changed files with 279 additions and 427 deletions.
275 changes: 119 additions & 156 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion demo/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ error-chain = "0.12"
hex-literal = "0.1"
log = "0.3"
tokio = "0.1.7"
triehash = "0.1"
triehash = "0.2"
substrate-client = { path = "../../substrate/client" }
substrate-codec = { path = "../../substrate/codec" }
substrate-extrinsic-pool = { path = "../../substrate/extrinsic-pool" }
Expand Down
2 changes: 1 addition & 1 deletion demo/executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ description = "Substrate Demo node implementation in Rust."

[dependencies]
hex-literal = "0.1"
triehash = { version = "0.1" }
triehash = "0.2"
ed25519 = { path = "../../substrate/ed25519" }
substrate-codec = { path = "../../substrate/codec" }
substrate-runtime-io = { path = "../../substrate/runtime-io" }
Expand Down
2 changes: 1 addition & 1 deletion demo/executor/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ mod tests {
UncheckedExtrinsic::new(extrinsic, signature)
}).collect::<Vec<_>>();

let extrinsics_root = ordered_trie_root(extrinsics.iter().map(Encode::encode)).0.into();
let extrinsics_root = ordered_trie_root::<KeccakHasher, _, _>(extrinsics.iter().map(Encode::encode)).0.into();

let header = Header {
parent_hash,
Expand Down
155 changes: 45 additions & 110 deletions demo/runtime/wasm/Cargo.lock

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
8 changes: 4 additions & 4 deletions substrate/client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ error-chain = "0.12"
fnv = "1.0"
log = "0.3"
parking_lot = "0.4"
triehash = "0.2"
hex-literal = "0.1"
futures = "0.1.17"
ed25519 = { path = "../ed25519" }
Expand All @@ -23,10 +24,9 @@ substrate-runtime-primitives = { path = "../runtime/primitives" }
substrate-state-machine = { path = "../state-machine" }
substrate-keyring = { path = "../../substrate/keyring" }
substrate-telemetry = { path = "../telemetry" }
hashdb = { git = "https://github.com/paritytech/parity-common" }
patricia-trie = { git = "https://github.com/paritytech/parity-common" }
rlp = { git = "https://github.com/paritytech/parity-common" }
triehash = { git = "https://github.com/paritytech/parity-common" }
hashdb = "0.2.1"
patricia-trie = "0.2.1"
rlp = "0.2.4"

[dev-dependencies]
substrate-test-client = { path = "../test-client" }
10 changes: 5 additions & 5 deletions substrate/client/db/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ authors = ["Parity Technologies <admin@parity.io>"]
[dependencies]
parking_lot = "0.4"
log = "0.3"
kvdb = { git = "https://github.com/paritytech/parity-common" }
kvdb-rocksdb = { git = "https://github.com/paritytech/parity-common" }
hashdb = { git = "https://github.com/paritytech/parity-common" }
memorydb = { git = "https://github.com/paritytech/parity-common" }
kvdb = "0.1"
kvdb-rocksdb = "0.1.3"
hashdb = "0.2.1"
memorydb = "0.2.1"
substrate-primitives = { path = "../../../substrate/primitives" }
substrate-runtime-primitives = { path = "../../../substrate/runtime/primitives" }
substrate-client = { path = "../../../substrate/client" }
Expand All @@ -21,4 +21,4 @@ substrate-executor = { path = "../../../substrate/executor" }
substrate-state-db = { path = "../../../substrate/state-db" }

[dev-dependencies]
kvdb-memorydb = { git = "https://github.com/paritytech/parity-common" }
kvdb-memorydb = "0.1"
4 changes: 2 additions & 2 deletions substrate/executor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ serde = "1.0"
serde_derive = "1.0"
wasmi = "0.4"
byteorder = "1.1"
triehash = "0.1.0"
triehash = "0.2"
twox-hash = "1.1.0"
lazy_static = "1.0"
parking_lot = "*"
log = "0.3"
hashdb = { git = "https://github.com/paritytech/parity-common" }
hashdb = "0.2.1"
tiny-keccak = "1.4"

[dev-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions substrate/executor/src/wasm_executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ impl_function_executor!(this: FunctionExecutor<'e, E>,
.map_err(|_| UserError("Invalid attempt to get memory in ext_enumerated_trie_root"))
)
.collect::<::std::result::Result<Vec<_>, UserError>>()?;
let r = ordered_trie_root(values.into_iter());
let r = ordered_trie_root::<KeccakHasher, _, _>(values.into_iter());
this.memory.set(result, &r[..]).map_err(|_| UserError("Invalid attempt to set memory in ext_enumerated_trie_root"))?;
Ok(())
},
Expand Down Expand Up @@ -740,7 +740,7 @@ mod tests {
let test_code = include_bytes!("../wasm/target/wasm32-unknown-unknown/release/runtime_test.compact.wasm");
assert_eq!(
WasmExecutor::new().call(&mut ext, 8, &test_code[..], "test_enumerated_trie_root", &[]).unwrap(),
ordered_trie_root(vec![b"zero".to_vec(), b"one".to_vec(), b"two".to_vec()]).0.encode()
ordered_trie_root::<KeccakHasher, _, _>(vec![b"zero".to_vec(), b"one".to_vec(), b"two".to_vec()]).0.encode()
);
}

Expand Down
29 changes: 15 additions & 14 deletions substrate/executor/wasm/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion substrate/keystore/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]

[dependencies]
parity-crypto = { git = "https://github.com/paritytech/parity-common.git", default_features = false }
parity-crypto = { version = "0.1", default_features = false }
ed25519 = { path = "../ed25519" }
error-chain = "0.12"
hex = "0.3"
Expand Down
2 changes: 1 addition & 1 deletion substrate/network-libp2p/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@ unsigned-varint = { version = "0.2", features = ["codec"] }

[dev-dependencies]
assert_matches = "1.2"
parity-bytes = { git = "https://github.com/paritytech/parity-common.git" }
parity-bytes = "0.1"
ethcore-io = { git = "https://github.com/paritytech/parity.git" }
ethcore-logger = { git = "https://github.com/paritytech/parity.git" }
12 changes: 6 additions & 6 deletions substrate/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ substrate-runtime-std = { path = "../runtime-std", default_features = false }
substrate-codec = { path = "../codec", default_features = false }
substrate-codec-derive = { path = "../codec/derive", default_features = false }
elastic-array = {version = "0.10", optional = true }
fixed-hash = { git = "https://github.com/paritytech/parity-common", default_features = false }
fixed-hash = { version = "0.2.2", 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 }
uint = { git = "https://github.com/paritytech/parity-common", default_features = false }
rlp = { git = "https://github.com/paritytech/parity-common", optional = true }
uint = { version = "0.4.1", default_features = false }
rlp = { version = "0.2.4", optional = true }
twox-hash = { version = "1.1.0", optional = true }
byteorder = { version = "1.1", default_features = false }
wasmi = { version = "0.4", optional = true }
hashdb = { git = "https://github.com/paritytech/parity-common", default_features = false }
patricia-trie = { git = "https://github.com/paritytech/parity-common", optional = true }
plain_hasher = { git = "https://github.com/paritytech/parity-common", default_features = false }
hashdb = { version = "0.2.1", default_features = false }
patricia-trie = { version = "0.2.1", optional = true }
plain_hasher = { version = "0.2", default_features = false }

blake2-rfc = { version = "0.2.18", optional = true }
# Switch back to Blake after PoC-3 is out and remove this
Expand Down
2 changes: 1 addition & 1 deletion substrate/runtime-io/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ environmental = { path = "../environmental", optional = true }
substrate-state-machine = { path = "../state-machine", optional = true }
substrate-primitives = { path = "../primitives", default_features = false }
substrate-codec = { path = "../codec", default_features = false }
triehash = { version = "0.1.2", optional = true }
triehash = { version = "0.2", optional = true }
ed25519 = { path = "../ed25519", optional = true }

[features]
Expand Down
6 changes: 3 additions & 3 deletions substrate/runtime-io/with_std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ pub fn storage_root() -> H256 {

/// A trie root formed from the enumerated items.
pub fn enumerated_trie_root(serialised_values: &[&[u8]]) -> [u8; 32] {
triehash::ordered_trie_root(serialised_values.iter().map(|s| s.to_vec())).0
triehash::ordered_trie_root::<KeccakHasher, _, _>(serialised_values.iter().map(|s| s.to_vec())).0
}

/// A trie root formed from the iterated items.
Expand All @@ -111,15 +111,15 @@ pub fn trie_root<
A: AsRef<[u8]> + Ord,
B: AsRef<[u8]>,
>(input: I) -> [u8; 32] {
triehash::trie_root(input).0
triehash::trie_root::<KeccakHasher, _, _, _>(input).0
}

/// A trie root formed from the enumerated items.
pub fn ordered_trie_root<
I: IntoIterator<Item = A>,
A: AsRef<[u8]>
>(input: I) -> [u8; 32] {
triehash::ordered_trie_root(input).0
triehash::ordered_trie_root::<KeccakHasher, _, _>(input).0
}

/// Verify a ed25519 signature.
Expand Down
10 changes: 5 additions & 5 deletions substrate/state-machine/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ hex-literal = "0.1.0"
log = "0.3"
parking_lot = "0.4"
heapsize = "0.4"
hashdb = "0.2.1"
memorydb = "0.2.1"
patricia-trie = "0.2.1"
triehash = "0.2"
rlp = "0.2.4"

substrate-primitives = { path = "../primitives", version = "0.1.0" }
substrate-codec = { path = "../codec", default_features = false }

hashdb = { git = "https://github.com/paritytech/parity-common" }
memorydb = { git = "https://github.com/paritytech/parity-common" }
patricia-trie = { git = "https://github.com/paritytech/parity-common" }
triehash = { git = "https://github.com/paritytech/parity-common" }
rlp = { git = "https://github.com/paritytech/parity-common" }
2 changes: 1 addition & 1 deletion substrate/test-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ substrate-primitives = { path = "../primitives" }
substrate-runtime-support = { path = "../runtime-support" }
substrate-test-runtime = { path = "../test-runtime" }
substrate-runtime-primitives = { path = "../runtime/primitives" }
hashdb = { git = "https://github.com/paritytech/parity-common" }
hashdb = "0.2.1"

Loading

0 comments on commit 2cc2a3b

Please sign in to comment.