chore: update some deps to prune duplicated deps (#14515)

* chore: update some deps to prune duplicated deps

- array-bytes: 4.1.0 => 6.1.0
- cid: 0.8.6 => 0.9.0

* fix
This commit is contained in:
Qinxuan Chen
2023-07-06 22:46:44 +08:00
committed by GitHub
parent 9c3ca04781
commit e8e2048b88
47 changed files with 126 additions and 163 deletions
+51 -84
View File
@@ -511,12 +511,6 @@ dependencies = [
"rand 0.8.5", "rand 0.8.5",
] ]
[[package]]
name = "array-bytes"
version = "4.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f52f63c5c1316a16a4b35eaac8b76a98248961a533f061684cb2a7cb0eafb6c6"
[[package]] [[package]]
name = "array-bytes" name = "array-bytes"
version = "6.1.0" version = "6.1.0"
@@ -822,7 +816,7 @@ dependencies = [
name = "binary-merkle-tree" name = "binary-merkle-tree"
version = "4.0.0-dev" version = "4.0.0-dev"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"env_logger 0.9.3", "env_logger 0.9.3",
"hash-db", "hash-db",
"log", "log",
@@ -1234,13 +1228,13 @@ dependencies = [
[[package]] [[package]]
name = "cid" name = "cid"
version = "0.8.6" version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f6ed9c8b2d17acb8110c46f1da5bf4a696d745e1474a16db0cd2b49cd0249bf2" checksum = "b9b68e3193982cd54187d71afdb2a271ad4cf8af157858e9cb911b91321de143"
dependencies = [ dependencies = [
"core2", "core2",
"multibase", "multibase",
"multihash 0.16.3", "multihash",
"serde", "serde",
"unsigned-varint", "unsigned-varint",
] ]
@@ -2613,7 +2607,7 @@ checksum = "6c2141d6d6c8512188a7891b4b01590a45f6dac67afb4f255c4124dbb86d4eaa"
name = "frame-benchmarking" name = "frame-benchmarking"
version = "4.0.0-dev" version = "4.0.0-dev"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"frame-support", "frame-support",
"frame-support-procedural", "frame-support-procedural",
"frame-system", "frame-system",
@@ -2641,7 +2635,7 @@ name = "frame-benchmarking-cli"
version = "4.0.0-dev" version = "4.0.0-dev"
dependencies = [ dependencies = [
"Inflector", "Inflector",
"array-bytes 4.2.0", "array-bytes",
"chrono", "chrono",
"clap 4.3.2", "clap 4.3.2",
"comfy-table", "comfy-table",
@@ -2752,7 +2746,7 @@ dependencies = [
name = "frame-executive" name = "frame-executive"
version = "4.0.0-dev" version = "4.0.0-dev"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"frame-support", "frame-support",
"frame-system", "frame-system",
"frame-try-runtime", "frame-try-runtime",
@@ -2808,7 +2802,7 @@ dependencies = [
name = "frame-support" name = "frame-support"
version = "4.0.0-dev" version = "4.0.0-dev"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"assert_matches", "assert_matches",
"bitflags", "bitflags",
"environmental", "environmental",
@@ -4298,7 +4292,7 @@ dependencies = [
"libp2p-identity", "libp2p-identity",
"log", "log",
"multiaddr", "multiaddr",
"multihash 0.17.0", "multihash",
"multistream-select", "multistream-select",
"once_cell", "once_cell",
"parking_lot 0.12.1", "parking_lot 0.12.1",
@@ -4358,7 +4352,7 @@ dependencies = [
"ed25519-dalek", "ed25519-dalek",
"log", "log",
"multiaddr", "multiaddr",
"multihash 0.17.0", "multihash",
"quick-protobuf", "quick-protobuf",
"rand 0.8.5", "rand 0.8.5",
"sha2 0.10.6", "sha2 0.10.6",
@@ -4605,7 +4599,7 @@ dependencies = [
"libp2p-identity", "libp2p-identity",
"libp2p-noise", "libp2p-noise",
"log", "log",
"multihash 0.17.0", "multihash",
"quick-protobuf", "quick-protobuf",
"quick-protobuf-codec", "quick-protobuf-codec",
"rand 0.8.5", "rand 0.8.5",
@@ -5137,7 +5131,7 @@ dependencies = [
"data-encoding", "data-encoding",
"log", "log",
"multibase", "multibase",
"multihash 0.17.0", "multihash",
"percent-encoding", "percent-encoding",
"serde", "serde",
"static_assertions", "static_assertions",
@@ -5158,9 +5152,9 @@ dependencies = [
[[package]] [[package]]
name = "multihash" name = "multihash"
version = "0.16.3" version = "0.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1c346cf9999c631f002d8f977c4eaeaa0e6386f16007202308d0b3757522c2cc" checksum = "835d6ff01d610179fbce3de1694d007e500bf33a7f29689838941d6bf783ae40"
dependencies = [ dependencies = [
"blake2b_simd", "blake2b_simd",
"blake2s_simd", "blake2s_simd",
@@ -5173,19 +5167,6 @@ dependencies = [
"unsigned-varint", "unsigned-varint",
] ]
[[package]]
name = "multihash"
version = "0.17.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "835d6ff01d610179fbce3de1694d007e500bf33a7f29689838941d6bf783ae40"
dependencies = [
"core2",
"digest 0.10.7",
"multihash-derive",
"sha2 0.10.6",
"unsigned-varint",
]
[[package]] [[package]]
name = "multihash-derive" name = "multihash-derive"
version = "0.8.1" version = "0.8.1"
@@ -5352,7 +5333,7 @@ dependencies = [
name = "node-bench" name = "node-bench"
version = "0.9.0-dev" version = "0.9.0-dev"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"clap 4.3.2", "clap 4.3.2",
"derive_more", "derive_more",
"fs_extra", "fs_extra",
@@ -5388,7 +5369,7 @@ dependencies = [
name = "node-cli" name = "node-cli"
version = "3.0.0-dev" version = "3.0.0-dev"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"assert_cmd", "assert_cmd",
"clap 4.3.2", "clap 4.3.2",
"clap_complete", "clap_complete",
@@ -5954,7 +5935,7 @@ dependencies = [
name = "pallet-alliance" name = "pallet-alliance"
version = "4.0.0-dev" version = "4.0.0-dev"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"frame-benchmarking", "frame-benchmarking",
"frame-support", "frame-support",
"frame-system", "frame-system",
@@ -6251,7 +6232,7 @@ dependencies = [
name = "pallet-beefy-mmr" name = "pallet-beefy-mmr"
version = "4.0.0-dev" version = "4.0.0-dev"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"binary-merkle-tree", "binary-merkle-tree",
"frame-support", "frame-support",
"frame-system", "frame-system",
@@ -6328,7 +6309,7 @@ dependencies = [
name = "pallet-contracts" name = "pallet-contracts"
version = "4.0.0-dev" version = "4.0.0-dev"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"assert_matches", "assert_matches",
"bitflags", "bitflags",
"env_logger 0.9.3", "env_logger 0.9.3",
@@ -6831,7 +6812,7 @@ dependencies = [
name = "pallet-mmr" name = "pallet-mmr"
version = "4.0.0-dev" version = "4.0.0-dev"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"env_logger 0.9.3", "env_logger 0.9.3",
"frame-benchmarking", "frame-benchmarking",
"frame-support", "frame-support",
@@ -7563,7 +7544,7 @@ dependencies = [
name = "pallet-transaction-storage" name = "pallet-transaction-storage"
version = "4.0.0-dev" version = "4.0.0-dev"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"frame-benchmarking", "frame-benchmarking",
"frame-support", "frame-support",
"frame-system", "frame-system",
@@ -8956,7 +8937,7 @@ dependencies = [
"ip_network", "ip_network",
"libp2p", "libp2p",
"log", "log",
"multihash 0.17.0", "multihash",
"parity-scale-codec", "parity-scale-codec",
"prost", "prost",
"prost-build", "prost-build",
@@ -9049,7 +9030,7 @@ dependencies = [
name = "sc-cli" name = "sc-cli"
version = "0.10.0-dev" version = "0.10.0-dev"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"chrono", "chrono",
"clap 4.3.2", "clap 4.3.2",
"fdlimit", "fdlimit",
@@ -9119,7 +9100,7 @@ dependencies = [
name = "sc-client-db" name = "sc-client-db"
version = "0.10.0-dev" version = "0.10.0-dev"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"criterion", "criterion",
"hash-db", "hash-db",
"kitchensink-runtime", "kitchensink-runtime",
@@ -9285,7 +9266,7 @@ dependencies = [
name = "sc-consensus-beefy" name = "sc-consensus-beefy"
version = "4.0.0-dev" version = "4.0.0-dev"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"async-channel", "async-channel",
"async-trait", "async-trait",
"fnv", "fnv",
@@ -9361,7 +9342,7 @@ name = "sc-consensus-grandpa"
version = "0.10.0-dev" version = "0.10.0-dev"
dependencies = [ dependencies = [
"ahash 0.8.3", "ahash 0.8.3",
"array-bytes 4.2.0", "array-bytes",
"assert_matches", "assert_matches",
"async-trait", "async-trait",
"dyn-clone", "dyn-clone",
@@ -9515,7 +9496,7 @@ dependencies = [
name = "sc-executor" name = "sc-executor"
version = "0.10.0-dev" version = "0.10.0-dev"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"assert_matches", "assert_matches",
"criterion", "criterion",
"env_logger 0.9.3", "env_logger 0.9.3",
@@ -9602,7 +9583,7 @@ dependencies = [
name = "sc-keystore" name = "sc-keystore"
version = "4.0.0-dev" version = "4.0.0-dev"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"parking_lot 0.12.1", "parking_lot 0.12.1",
"serde_json", "serde_json",
"sp-application-crypto", "sp-application-crypto",
@@ -9616,7 +9597,7 @@ dependencies = [
name = "sc-network" name = "sc-network"
version = "0.10.0-dev" version = "0.10.0-dev"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"assert_matches", "assert_matches",
"async-channel", "async-channel",
"async-trait", "async-trait",
@@ -9731,7 +9712,7 @@ dependencies = [
name = "sc-network-light" name = "sc-network-light"
version = "0.10.0-dev" version = "0.10.0-dev"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"async-channel", "async-channel",
"futures", "futures",
"libp2p-identity", "libp2p-identity",
@@ -9751,7 +9732,7 @@ dependencies = [
name = "sc-network-statement" name = "sc-network-statement"
version = "0.10.0-dev" version = "0.10.0-dev"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"async-channel", "async-channel",
"futures", "futures",
"libp2p", "libp2p",
@@ -9768,7 +9749,7 @@ dependencies = [
name = "sc-network-sync" name = "sc-network-sync"
version = "0.10.0-dev" version = "0.10.0-dev"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"async-channel", "async-channel",
"async-trait", "async-trait",
"fork-tree", "fork-tree",
@@ -9837,7 +9818,7 @@ dependencies = [
name = "sc-network-transactions" name = "sc-network-transactions"
version = "0.10.0-dev" version = "0.10.0-dev"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"futures", "futures",
"libp2p", "libp2p",
"log", "log",
@@ -9854,7 +9835,7 @@ dependencies = [
name = "sc-offchain" name = "sc-offchain"
version = "4.0.0-dev" version = "4.0.0-dev"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"bytes", "bytes",
"fnv", "fnv",
"futures", "futures",
@@ -9969,7 +9950,7 @@ dependencies = [
name = "sc-rpc-spec-v2" name = "sc-rpc-spec-v2"
version = "0.10.0-dev" version = "0.10.0-dev"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"assert_matches", "assert_matches",
"futures", "futures",
"futures-util", "futures-util",
@@ -10082,7 +10063,7 @@ dependencies = [
name = "sc-service-test" name = "sc-service-test"
version = "2.0.0" version = "2.0.0"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"async-channel", "async-channel",
"fdlimit", "fdlimit",
"futures", "futures",
@@ -10254,7 +10235,7 @@ dependencies = [
name = "sc-transaction-pool" name = "sc-transaction-pool"
version = "4.0.0-dev" version = "4.0.0-dev"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"assert_matches", "assert_matches",
"async-trait", "async-trait",
"criterion", "criterion",
@@ -10342,11 +10323,11 @@ dependencies = [
[[package]] [[package]]
name = "schannel" name = "schannel"
version = "0.1.21" version = "0.1.22"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88"
dependencies = [ dependencies = [
"windows-sys 0.42.0", "windows-sys 0.48.0",
] ]
[[package]] [[package]]
@@ -11071,7 +11052,7 @@ dependencies = [
name = "sp-consensus-beefy" name = "sp-consensus-beefy"
version = "4.0.0-dev" version = "4.0.0-dev"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"lazy_static", "lazy_static",
"parity-scale-codec", "parity-scale-codec",
"scale-info", "scale-info",
@@ -11130,7 +11111,7 @@ dependencies = [
name = "sp-core" name = "sp-core"
version = "21.0.0" version = "21.0.0"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"bitflags", "bitflags",
"blake2", "blake2",
"bounded-collections", "bounded-collections",
@@ -11342,7 +11323,7 @@ dependencies = [
name = "sp-mmr-primitives" name = "sp-mmr-primitives"
version = "4.0.0-dev" version = "4.0.0-dev"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"ckb-merkle-mountain-range", "ckb-merkle-mountain-range",
"log", "log",
"parity-scale-codec", "parity-scale-codec",
@@ -11538,7 +11519,7 @@ dependencies = [
name = "sp-state-machine" name = "sp-state-machine"
version = "0.28.0" version = "0.28.0"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"assert_matches", "assert_matches",
"hash-db", "hash-db",
"log", "log",
@@ -11653,7 +11634,7 @@ name = "sp-trie"
version = "22.0.0" version = "22.0.0"
dependencies = [ dependencies = [
"ahash 0.8.3", "ahash 0.8.3",
"array-bytes 4.2.0", "array-bytes",
"criterion", "criterion",
"hash-db", "hash-db",
"hashbrown 0.13.2", "hashbrown 0.13.2",
@@ -12010,7 +11991,7 @@ dependencies = [
name = "substrate-test-client" name = "substrate-test-client"
version = "2.0.1" version = "2.0.1"
dependencies = [ dependencies = [
"array-bytes 4.2.0", "array-bytes",
"async-trait", "async-trait",
"futures", "futures",
"parity-scale-codec", "parity-scale-codec",
@@ -12035,7 +12016,7 @@ dependencies = [
name = "substrate-test-runtime" name = "substrate-test-runtime"
version = "2.0.0" version = "2.0.0"
dependencies = [ dependencies = [
"array-bytes 6.1.0", "array-bytes",
"frame-executive", "frame-executive",
"frame-support", "frame-support",
"frame-system", "frame-system",
@@ -12250,15 +12231,16 @@ checksum = "fd1ba337640d60c3e96bc6f0638a939b9c9a7f2c316a1598c279828b3d1dc8c5"
[[package]] [[package]]
name = "tempfile" name = "tempfile"
version = "3.5.0" version = "3.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6"
dependencies = [ dependencies = [
"autocfg",
"cfg-if", "cfg-if",
"fastrand", "fastrand",
"redox_syscall 0.3.5", "redox_syscall 0.3.5",
"rustix 0.37.19", "rustix 0.37.19",
"windows-sys 0.45.0", "windows-sys 0.48.0",
] ]
[[package]] [[package]]
@@ -13888,21 +13870,6 @@ dependencies = [
"windows-targets 0.48.0", "windows-targets 0.48.0",
] ]
[[package]]
name = "windows-sys"
version = "0.42.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7"
dependencies = [
"windows_aarch64_gnullvm 0.42.2",
"windows_aarch64_msvc 0.42.2",
"windows_i686_gnu 0.42.2",
"windows_i686_msvc 0.42.2",
"windows_x86_64_gnu 0.42.2",
"windows_x86_64_gnullvm 0.42.2",
"windows_x86_64_msvc 0.42.2",
]
[[package]] [[package]]
name = "windows-sys" name = "windows-sys"
version = "0.45.0" version = "0.45.0"
+1 -1
View File
@@ -12,7 +12,7 @@ publish = false
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
array-bytes = "4.1" array-bytes = "6.1"
clap = { version = "4.2.5", features = ["derive"] } clap = { version = "4.2.5", features = ["derive"] }
log = "0.4.17" log = "0.4.17"
node-primitives = { version = "2.0.0", path = "../primitives" } node-primitives = { version = "2.0.0", path = "../primitives" }
+1 -1
View File
@@ -35,7 +35,7 @@ crate-type = ["cdylib", "rlib"]
[dependencies] [dependencies]
# third-party dependencies # third-party dependencies
array-bytes = "4.1" array-bytes = "6.1"
clap = { version = "4.2.5", features = ["derive"], optional = true } clap = { version = "4.2.5", features = ["derive"], optional = true }
codec = { package = "parity-scale-codec", version = "3.6.1" } codec = { package = "parity-scale-codec", version = "3.6.1" }
serde = { version = "1.0.163", features = ["derive"] } serde = { version = "1.0.163", features = ["derive"] }
+1 -1
View File
@@ -13,7 +13,7 @@ readme = "README.md"
targets = ["x86_64-unknown-linux-gnu"] targets = ["x86_64-unknown-linux-gnu"]
[dependencies] [dependencies]
array-bytes = "4.1" array-bytes = "6.1"
chrono = "0.4.10" chrono = "0.4.10"
clap = { version = "4.2.5", features = ["derive", "string"] } clap = { version = "4.2.5", features = ["derive", "string"] }
fdlimit = "0.2.1" fdlimit = "0.2.1"
@@ -55,7 +55,7 @@ impl GenerateNodeKeyCmd {
let file_data = if self.bin { let file_data = if self.bin {
secret.as_ref().to_owned() secret.as_ref().to_owned()
} else { } else {
array_bytes::bytes2hex("", secret.as_ref()).into_bytes() array_bytes::bytes2hex("", secret).into_bytes()
}; };
match &self.file { match &self.file {
+1 -1
View File
@@ -9,7 +9,7 @@ description = "BEEFY Client gadget for substrate"
homepage = "https://substrate.io" homepage = "https://substrate.io"
[dependencies] [dependencies]
array-bytes = "4.1" array-bytes = "6.1"
async-channel = "1.8.0" async-channel = "1.8.0"
async-trait = "0.1.57" async-trait = "0.1.57"
codec = { package = "parity-scale-codec", version = "3.6.1", features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.6.1", features = ["derive"] }
@@ -117,7 +117,7 @@ mod tests {
use beefy_protocol_name::{gossip_protocol_name, justifications_protocol_name}; use beefy_protocol_name::{gossip_protocol_name, justifications_protocol_name};
// Create protocol name using random genesis hash. // Create protocol name using random genesis hash.
let genesis_hash = H256::random(); let genesis_hash = H256::random();
let genesis_hex = array_bytes::bytes2hex("", genesis_hash.as_ref()); let genesis_hex = array_bytes::bytes2hex("", genesis_hash);
let expected_gossip_name = format!("/{}/beefy/2", genesis_hex); let expected_gossip_name = format!("/{}/beefy/2", genesis_hex);
let gossip_proto_name = gossip_protocol_name(&genesis_hash, None); let gossip_proto_name = gossip_protocol_name(&genesis_hash, None);
@@ -15,7 +15,7 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies] [dependencies]
ahash = "0.8.2" ahash = "0.8.2"
array-bytes = "4.1" array-bytes = "6.1"
async-trait = "0.1.57" async-trait = "0.1.57"
dyn-clone = "1.0" dyn-clone = "1.0"
finality-grandpa = { version = "0.16.2", features = ["derive-codec"] } finality-grandpa = { version = "0.16.2", features = ["derive-codec"] }
@@ -669,7 +669,7 @@ fn grandpa_protocol_name() {
// Create protocol name using random genesis hash. // Create protocol name using random genesis hash.
let genesis_hash = sp_core::H256::random(); let genesis_hash = sp_core::H256::random();
let expected = format!("/{}/grandpa/1", array_bytes::bytes2hex("", genesis_hash.as_ref())); let expected = format!("/{}/grandpa/1", array_bytes::bytes2hex("", genesis_hash));
let proto_name = grandpa_protocol_name::standard_name(&genesis_hash, &chain_spec); let proto_name = grandpa_protocol_name::standard_name(&genesis_hash, &chain_spec);
assert_eq!(proto_name.to_string(), expected); assert_eq!(proto_name.to_string(), expected);
+1 -1
View File
@@ -44,7 +44,7 @@ quickcheck = { version = "1.0.3", default-features = false }
kitchensink-runtime = { path = "../../bin/node/runtime" } kitchensink-runtime = { path = "../../bin/node/runtime" }
sp-tracing = { version = "10.0.0", path = "../../primitives/tracing" } sp-tracing = { version = "10.0.0", path = "../../primitives/tracing" }
substrate-test-runtime-client = { version = "2.0.0", path = "../../test-utils/runtime/client" } substrate-test-runtime-client = { version = "2.0.0", path = "../../test-utils/runtime/client" }
array-bytes = "4.1" array-bytes = "6.1"
[features] [features]
default = [] default = []
+1 -1
View File
@@ -32,7 +32,7 @@ sp-version = { version = "22.0.0", path = "../../primitives/version" }
sp-wasm-interface = { version = "14.0.0", path = "../../primitives/wasm-interface" } sp-wasm-interface = { version = "14.0.0", path = "../../primitives/wasm-interface" }
[dev-dependencies] [dev-dependencies]
array-bytes = "4.1" array-bytes = "6.1"
assert_matches = "1.3.0" assert_matches = "1.3.0"
wat = "1.0" wat = "1.0"
sc-runtime-test = { version = "2.0.0", path = "runtime-test" } sc-runtime-test = { version = "2.0.0", path = "runtime-test" }
+1 -1
View File
@@ -14,7 +14,7 @@ readme = "README.md"
targets = ["x86_64-unknown-linux-gnu"] targets = ["x86_64-unknown-linux-gnu"]
[dependencies] [dependencies]
array-bytes = "4.1" array-bytes = "6.1"
parking_lot = "0.12.1" parking_lot = "0.12.1"
serde_json = "1.0.85" serde_json = "1.0.85"
thiserror = "1.0" thiserror = "1.0"
+1 -1
View File
@@ -14,7 +14,7 @@ readme = "README.md"
targets = ["x86_64-unknown-linux-gnu"] targets = ["x86_64-unknown-linux-gnu"]
[dependencies] [dependencies]
array-bytes = "4.1" array-bytes = "6.1"
async-channel = "1.8.0" async-channel = "1.8.0"
async-trait = "0.1" async-trait = "0.1"
asynchronous-codec = "0.6" asynchronous-codec = "0.6"
+1 -1
View File
@@ -17,7 +17,7 @@ prost-build = "0.11"
[dependencies] [dependencies]
async-channel = "1.8.0" async-channel = "1.8.0"
cid = "0.8.6" cid = "0.9.0"
futures = "0.3.21" futures = "0.3.21"
libp2p-identity = { version = "0.1.2", features = ["peerid"] } libp2p-identity = { version = "0.1.2", features = ["peerid"] }
log = "0.4.17" log = "0.4.17"
+1 -1
View File
@@ -17,7 +17,7 @@ prost-build = "0.11"
[dependencies] [dependencies]
async-channel = "1.8.0" async-channel = "1.8.0"
array-bytes = "4.1" array-bytes = "6.1"
codec = { package = "parity-scale-codec", version = "3.6.1", features = [ codec = { package = "parity-scale-codec", version = "3.6.1", features = [
"derive", "derive",
] } ] }
@@ -13,7 +13,7 @@ documentation = "https://docs.rs/sc-network-statement"
targets = ["x86_64-unknown-linux-gnu"] targets = ["x86_64-unknown-linux-gnu"]
[dependencies] [dependencies]
array-bytes = "4.1" array-bytes = "6.1"
async-channel = "1.8.0" async-channel = "1.8.0"
codec = { package = "parity-scale-codec", version = "3.6.1", features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.6.1", features = ["derive"] }
futures = "0.3.21" futures = "0.3.21"
+1 -1
View File
@@ -16,7 +16,7 @@ targets = ["x86_64-unknown-linux-gnu"]
prost-build = "0.11" prost-build = "0.11"
[dependencies] [dependencies]
array-bytes = "4.1" array-bytes = "6.1"
async-channel = "1.8.0" async-channel = "1.8.0"
async-trait = "0.1.58" async-trait = "0.1.58"
codec = { package = "parity-scale-codec", version = "3.6.1", features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.6.1", features = ["derive"] }
@@ -13,7 +13,7 @@ documentation = "https://docs.rs/sc-network-transactions"
targets = ["x86_64-unknown-linux-gnu"] targets = ["x86_64-unknown-linux-gnu"]
[dependencies] [dependencies]
array-bytes = "4.1" array-bytes = "6.1"
codec = { package = "parity-scale-codec", version = "3.6.1", features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.6.1", features = ["derive"] }
futures = "0.3.21" futures = "0.3.21"
libp2p = "0.51.3" libp2p = "0.51.3"
+1 -1
View File
@@ -13,7 +13,7 @@ readme = "README.md"
targets = ["x86_64-unknown-linux-gnu"] targets = ["x86_64-unknown-linux-gnu"]
[dependencies] [dependencies]
array-bytes = "4.1" array-bytes = "6.1"
bytes = "1.1" bytes = "1.1"
codec = { package = "parity-scale-codec", version = "3.6.1", features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.6.1", features = ["derive"] }
fnv = "1.0.6" fnv = "1.0.6"
+1 -1
View File
@@ -31,7 +31,7 @@ hex = "0.4"
futures = "0.3.21" futures = "0.3.21"
parking_lot = "0.12.1" parking_lot = "0.12.1"
tokio-stream = { version = "0.1", features = ["sync"] } tokio-stream = { version = "0.1", features = ["sync"] }
array-bytes = "4.1" array-bytes = "6.1"
log = "0.4.17" log = "0.4.17"
futures-util = { version = "0.3.19", default-features = false } futures-util = { version = "0.3.19", default-features = false }
+1 -1
View File
@@ -13,7 +13,7 @@ targets = ["x86_64-unknown-linux-gnu"]
[dependencies] [dependencies]
async-channel = "1.8.0" async-channel = "1.8.0"
array-bytes = "4.1" array-bytes = "6.1"
fdlimit = "0.2.1" fdlimit = "0.2.1"
futures = "0.3.21" futures = "0.3.21"
log = "0.4.17" log = "0.4.17"
+1 -1
View File
@@ -34,7 +34,7 @@ sp-tracing = { version = "10.0.0", path = "../../primitives/tracing" }
sp-transaction-pool = { version = "4.0.0-dev", path = "../../primitives/transaction-pool" } sp-transaction-pool = { version = "4.0.0-dev", path = "../../primitives/transaction-pool" }
[dev-dependencies] [dev-dependencies]
array-bytes = "4.1" array-bytes = "6.1"
assert_matches = "1.3.0" assert_matches = "1.3.0"
criterion = "0.4.0" criterion = "0.4.0"
sc-block-builder = { version = "0.10.0-dev", path = "../block-builder" } sc-block-builder = { version = "0.10.0-dev", path = "../block-builder" }
+2 -2
View File
@@ -13,7 +13,7 @@ readme = "README.md"
targets = ["x86_64-unknown-linux-gnu"] targets = ["x86_64-unknown-linux-gnu"]
[dependencies] [dependencies]
array-bytes = { version = "4.1", optional = true } array-bytes = { version = "6.1", optional = true }
log = { version = "0.4.14", default-features = false } log = { version = "0.4.14", default-features = false }
codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] }
@@ -33,7 +33,7 @@ pallet-identity = { version = "4.0.0-dev", path = "../identity", default-feature
pallet-collective = { version = "4.0.0-dev", path = "../collective", default-features = false, optional = true } pallet-collective = { version = "4.0.0-dev", path = "../collective", default-features = false, optional = true }
[dev-dependencies] [dev-dependencies]
array-bytes = "4.1" array-bytes = "6.1"
sp-core-hashing = { version = "9.0.0", default-features = false, path = "../../primitives/core/hashing" } sp-core-hashing = { version = "9.0.0", default-features = false, path = "../../primitives/core/hashing" }
pallet-balances = { version = "4.0.0-dev", path = "../balances" } pallet-balances = { version = "4.0.0-dev", path = "../balances" }
pallet-collective = { version = "4.0.0-dev", path = "../collective" } pallet-collective = { version = "4.0.0-dev", path = "../collective" }
+2 -2
View File
@@ -9,7 +9,7 @@ repository = "https://github.com/paritytech/substrate"
homepage = "https://substrate.io" homepage = "https://substrate.io"
[dependencies] [dependencies]
array-bytes = { version = "4.1", optional = true } array-bytes = { version = "6.1", optional = true }
codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] } codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false, features = ["derive"] }
log = { version = "0.4.17", default-features = false } log = { version = "0.4.17", default-features = false }
scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] }
@@ -28,7 +28,7 @@ sp-std = { version = "8.0.0", default-features = false, path = "../../primitives
sp-api = { version = "4.0.0-dev", default-features = false, path = "../../primitives/api" } sp-api = { version = "4.0.0-dev", default-features = false, path = "../../primitives/api" }
[dev-dependencies] [dev-dependencies]
array-bytes = "4.1" array-bytes = "6.1"
sp-staking = { version = "4.0.0-dev", path = "../../primitives/staking" } sp-staking = { version = "4.0.0-dev", path = "../../primitives/staking" }
[features] [features]
+3 -3
View File
@@ -164,7 +164,7 @@ fn should_update_authorities() {
// check current authority set // check current authority set
assert_eq!(0, auth_set.id); assert_eq!(0, auth_set.id);
assert_eq!(2, auth_set.len); assert_eq!(2, auth_set.len);
let want = array_bytes::hex_n_into_unchecked::<H256, 32>( let want = array_bytes::hex_n_into_unchecked::<_, H256, 32>(
"176e73f1bf656478b728e28dd1a7733c98621b8acf830bff585949763dca7a96", "176e73f1bf656478b728e28dd1a7733c98621b8acf830bff585949763dca7a96",
); );
assert_eq!(want, auth_set.root); assert_eq!(want, auth_set.root);
@@ -184,7 +184,7 @@ fn should_update_authorities() {
assert_eq!(1, auth_set.id); assert_eq!(1, auth_set.id);
// check next auth set // check next auth set
assert_eq!(2, next_auth_set.id); assert_eq!(2, next_auth_set.id);
let want = array_bytes::hex_n_into_unchecked::<H256, 32>( let want = array_bytes::hex_n_into_unchecked::<_, H256, 32>(
"9c6b2c1b0d0b25a008e6c882cc7b415f309965c72ad2b944ac0931048ca31cd5", "9c6b2c1b0d0b25a008e6c882cc7b415f309965c72ad2b944ac0931048ca31cd5",
); );
assert_eq!(2, next_auth_set.len); assert_eq!(2, next_auth_set.len);
@@ -200,7 +200,7 @@ fn should_update_authorities() {
assert_eq!(2, auth_set.id); assert_eq!(2, auth_set.id);
// check next auth set // check next auth set
assert_eq!(3, next_auth_set.id); assert_eq!(3, next_auth_set.id);
let want = array_bytes::hex_n_into_unchecked::<H256, 32>( let want = array_bytes::hex_n_into_unchecked::<_, H256, 32>(
"9c6b2c1b0d0b25a008e6c882cc7b415f309965c72ad2b944ac0931048ca31cd5", "9c6b2c1b0d0b25a008e6c882cc7b415f309965c72ad2b944ac0931048ca31cd5",
); );
assert_eq!(2, next_auth_set.len); assert_eq!(2, next_auth_set.len);
+1 -1
View File
@@ -33,7 +33,7 @@ sp-storage = { version = "13.0.0", default-features = false, path = "../../primi
static_assertions = "1.1.0" static_assertions = "1.1.0"
[dev-dependencies] [dev-dependencies]
array-bytes = "4.1" array-bytes = "6.1"
rusty-fork = { version = "0.3.0", default-features = false } rusty-fork = { version = "0.3.0", default-features = false }
sp-keystore = { version = "0.27.0", path = "../../primitives/keystore" } sp-keystore = { version = "0.27.0", path = "../../primitives/keystore" }
+1 -1
View File
@@ -47,7 +47,7 @@ sp-runtime = { version = "24.0.0", default-features = false, path = "../../primi
sp-std = { version = "8.0.0", default-features = false, path = "../../primitives/std" } sp-std = { version = "8.0.0", default-features = false, path = "../../primitives/std" }
[dev-dependencies] [dev-dependencies]
array-bytes = "4.1" array-bytes = "6.1"
assert_matches = "1" assert_matches = "1"
env_logger = "0.9" env_logger = "0.9"
pretty_assertions = "1" pretty_assertions = "1"
+3 -1
View File
@@ -3608,7 +3608,9 @@ mod tests {
); );
assert_eq!( assert_eq!(
ctx.ext.ecdsa_to_eth_address(&pubkey_compressed).unwrap(), ctx.ext.ecdsa_to_eth_address(&pubkey_compressed).unwrap(),
array_bytes::hex2array_unchecked::<20>("09231da7b19A016f9e576d23B16277062F4d46A8") array_bytes::hex2array_unchecked::<_, 20>(
"09231da7b19A016f9e576d23B16277062F4d46A8"
)
); );
exec_success() exec_success()
}); });
+1 -1
View File
@@ -2180,7 +2180,7 @@ mod tests {
ExecReturnValue { ExecReturnValue {
flags: ReturnFlags::empty(), flags: ReturnFlags::empty(),
data: ( data: (
array_bytes::hex2array_unchecked::<32>( array_bytes::hex2array_unchecked::<_, 32>(
"000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F" "000102030405060708090A0B0C0D0E0F000102030405060708090A0B0C0D0E0F"
), ),
42u64, 42u64,
+1 -1
View File
@@ -27,7 +27,7 @@ sp-std = { version = "8.0.0", default-features = false, path = "../../primitives
sp-tracing = { version = "10.0.0", default-features = false, path = "../../primitives/tracing" } sp-tracing = { version = "10.0.0", default-features = false, path = "../../primitives/tracing" }
[dev-dependencies] [dev-dependencies]
array-bytes = "4.1" array-bytes = "6.1"
pallet-balances = { version = "4.0.0-dev", path = "../balances" } pallet-balances = { version = "4.0.0-dev", path = "../balances" }
pallet-transaction-payment = { version = "4.0.0-dev", path = "../transaction-payment" } pallet-transaction-payment = { version = "4.0.0-dev", path = "../transaction-payment" }
sp-core = { version = "21.0.0", path = "../../primitives/core" } sp-core = { version = "21.0.0", path = "../../primitives/core" }
@@ -24,7 +24,7 @@ sp-runtime = { version = "24.0.0", default-features = false, path = "../../primi
sp-std = { version = "8.0.0", default-features = false, path = "../../primitives/std" } sp-std = { version = "8.0.0", default-features = false, path = "../../primitives/std" }
[dev-dependencies] [dev-dependencies]
array-bytes = "4.1" array-bytes = "6.1"
env_logger = "0.9" env_logger = "0.9"
itertools = "0.10.3" itertools = "0.10.3"
+1 -1
View File
@@ -46,7 +46,7 @@ serde_json = "1.0.85"
assert_matches = "1.3.0" assert_matches = "1.3.0"
pretty_assertions = "1.2.1" pretty_assertions = "1.2.1"
frame-system = { version = "4.0.0-dev", path = "../system" } frame-system = { version = "4.0.0-dev", path = "../system" }
array-bytes = "4.1" array-bytes = "6.1"
[features] [features]
default = ["std"] default = ["std"]
@@ -13,7 +13,7 @@ readme = "README.md"
targets = ["x86_64-unknown-linux-gnu"] targets = ["x86_64-unknown-linux-gnu"]
[dependencies] [dependencies]
array-bytes = { version = "4.1", optional = true } array-bytes = { version = "6.1", optional = true }
codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false } codec = { package = "parity-scale-codec", version = "3.6.1", default-features = false }
scale-info = { version = "2.5.0", default-features = false, features = ["derive"] } scale-info = { version = "2.5.0", default-features = false, features = ["derive"] }
serde = { version = "1.0.163", optional = true } serde = { version = "1.0.163", optional = true }
@@ -26,7 +26,7 @@ strum = { version = "0.24.1", features = ["derive"], default-features = false }
lazy_static = "1.4.0" lazy_static = "1.4.0"
[dev-dependencies] [dev-dependencies]
array-bytes = "4.1" array-bytes = "6.1"
sp-keystore = { version = "0.27.0", path = "../../keystore" } sp-keystore = { version = "0.27.0", path = "../../keystore" }
[features] [features]
+1 -1
View File
@@ -43,7 +43,7 @@ bitflags = "1.3"
paste = "1.0.7" paste = "1.0.7"
# full crypto # full crypto
array-bytes = { version = "4.1", optional = true } array-bytes = { version = "6.1", optional = true }
ed25519-zebra = { version = "3.1.0", default-features = false, optional = true } ed25519-zebra = { version = "3.1.0", default-features = false, optional = true }
blake2 = { version = "0.10.4", default-features = false, optional = true } blake2 = { version = "0.10.4", default-features = false, optional = true }
libsecp256k1 = { version = "0.7", default-features = false, features = ["static-context"], optional = true } libsecp256k1 = { version = "0.7", default-features = false, features = ["static-context"], optional = true }
+1 -1
View File
@@ -332,7 +332,7 @@ impl<T> Serialize for Signature<T> {
where where
S: Serializer, S: Serializer,
{ {
serializer.serialize_str(&array_bytes::bytes2hex("", self.as_ref())) serializer.serialize_str(&array_bytes::bytes2hex("", self))
} }
} }
+2 -2
View File
@@ -220,7 +220,7 @@ impl Serialize for Signature {
where where
S: Serializer, S: Serializer,
{ {
serializer.serialize_str(&array_bytes::bytes2hex("", self.as_ref())) serializer.serialize_str(&array_bytes::bytes2hex("", self))
} }
} }
@@ -552,7 +552,7 @@ mod test {
let derived = pair.derive(path.into_iter(), None).ok().unwrap(); let derived = pair.derive(path.into_iter(), None).ok().unwrap();
assert_eq!( assert_eq!(
derived.0.seed(), derived.0.seed(),
array_bytes::hex2array_unchecked::<32>( array_bytes::hex2array_unchecked::<_, 32>(
"b8eefc4937200a8382d00050e050ced2d4ab72cc2ef1b061477afb51564fdd61" "b8eefc4937200a8382d00050e050ced2d4ab72cc2ef1b061477afb51564fdd61"
) )
); );
+2 -2
View File
@@ -234,7 +234,7 @@ impl Serialize for Signature {
where where
S: Serializer, S: Serializer,
{ {
serializer.serialize_str(&array_bytes::bytes2hex("", self.as_ref())) serializer.serialize_str(&array_bytes::bytes2hex("", self))
} }
} }
@@ -499,7 +499,7 @@ mod test {
let derived = pair.derive(path.into_iter(), None).ok().unwrap().0; let derived = pair.derive(path.into_iter(), None).ok().unwrap().0;
assert_eq!( assert_eq!(
derived.seed(), derived.seed(),
array_bytes::hex2array_unchecked::<32>( array_bytes::hex2array_unchecked::<_, 32>(
"ede3354e133f9c8e337ddd6ee5415ed4b4ffe5fc7d21e933f4930a3730e5b21c" "ede3354e133f9c8e337ddd6ee5415ed4b4ffe5fc7d21e933f4930a3730e5b21c"
) )
); );
+1 -1
View File
@@ -240,7 +240,7 @@ impl Serialize for Signature {
where where
S: Serializer, S: Serializer,
{ {
serializer.serialize_str(&array_bytes::bytes2hex("", self.as_ref())) serializer.serialize_str(&array_bytes::bytes2hex("", self))
} }
} }
@@ -25,7 +25,7 @@ sp-std = { version = "8.0.0", default-features = false, path = "../std" }
thiserror = "1.0" thiserror = "1.0"
[dev-dependencies] [dev-dependencies]
array-bytes = "4.1" array-bytes = "6.1"
[features] [features]
default = ["std"] default = ["std"]
@@ -30,7 +30,7 @@ sp-trie = { version = "22.0.0", default-features = false, path = "../trie" }
trie-db = { version = "0.27.1", default-features = false } trie-db = { version = "0.27.1", default-features = false }
[dev-dependencies] [dev-dependencies]
array-bytes = "4.1" array-bytes = "6.1"
pretty_assertions = "1.2.1" pretty_assertions = "1.2.1"
rand = "0.8.5" rand = "0.8.5"
sp-runtime = { version = "24.0.0", path = "../runtime" } sp-runtime = { version = "24.0.0", path = "../runtime" }
@@ -391,7 +391,7 @@ mod tests {
ext.set_storage(b"doe".to_vec(), b"reindeer".to_vec()); ext.set_storage(b"doe".to_vec(), b"reindeer".to_vec());
ext.set_storage(b"dog".to_vec(), b"puppy".to_vec()); ext.set_storage(b"dog".to_vec(), b"puppy".to_vec());
ext.set_storage(b"dogglesworth".to_vec(), b"cat".to_vec()); ext.set_storage(b"dogglesworth".to_vec(), b"cat".to_vec());
let root = array_bytes::hex_n_into_unchecked::<H256, 32>( let root = array_bytes::hex_n_into_unchecked::<_, H256, 32>(
"ed4d8c799d996add422395a6abd7545491d40bd838d738afafa1b8a4de625489", "ed4d8c799d996add422395a6abd7545491d40bd838d738afafa1b8a4de625489",
); );
assert_eq!(H256::from_slice(ext.storage_root(Default::default()).as_slice()), root); assert_eq!(H256::from_slice(ext.storage_root(Default::default()).as_slice()), root);
+1 -1
View File
@@ -36,7 +36,7 @@ sp-std = { version = "8.0.0", default-features = false, path = "../std" }
schnellru = { version = "0.2.1", optional = true } schnellru = { version = "0.2.1", optional = true }
[dev-dependencies] [dev-dependencies]
array-bytes = "4.1" array-bytes = "6.1"
criterion = "0.4.0" criterion = "0.4.0"
trie-bench = "0.37.0" trie-bench = "0.37.0"
trie-standardmap = "0.16.0" trie-standardmap = "0.16.0"
+1 -1
View File
@@ -13,7 +13,7 @@ publish = false
targets = ["x86_64-unknown-linux-gnu"] targets = ["x86_64-unknown-linux-gnu"]
[dependencies] [dependencies]
array-bytes = "4.1" array-bytes = "6.1"
async-trait = "0.1.57" async-trait = "0.1.57"
codec = { package = "parity-scale-codec", version = "3.6.1" } codec = { package = "parity-scale-codec", version = "3.6.1" }
futures = "0.3.21" futures = "0.3.21"
@@ -9,12 +9,12 @@ description = "A no-std/Substrate compatible library to construct binary merkle
homepage = "https://substrate.io" homepage = "https://substrate.io"
[dependencies] [dependencies]
array-bytes = { version = "4.1", optional = true } array-bytes = { version = "6.1", optional = true }
log = { version = "0.4", default-features = false, optional = true } log = { version = "0.4", default-features = false, optional = true }
hash-db = { version = "0.16.0", default-features = false } hash-db = { version = "0.16.0", default-features = false }
[dev-dependencies] [dev-dependencies]
array-bytes = "4.1" array-bytes = "6.1"
env_logger = "0.9" env_logger = "0.9"
sp-core = { version = "21.0.0", path = "../../primitives/core" } sp-core = { version = "21.0.0", path = "../../primitives/core" }
sp-runtime = { version = "24.0.0", path = "../../primitives/runtime" } sp-runtime = { version = "24.0.0", path = "../../primitives/runtime" }
+21 -27
View File
@@ -202,7 +202,7 @@ where
collect_proof collect_proof
.proof .proof
.iter() .iter()
.map(|s| array_bytes::bytes2hex("", s.as_ref())) .map(|s| array_bytes::bytes2hex("", s))
.collect::<Vec<_>>() .collect::<Vec<_>>()
); );
@@ -272,10 +272,10 @@ where
#[cfg(feature = "debug")] #[cfg(feature = "debug")]
log::debug!( log::debug!(
"[verify_proof]: (a, b) {:?}, {:?} => {:?} ({:?}) hash", "[verify_proof]: (a, b) {:?}, {:?} => {:?} ({:?}) hash",
array_bytes::bytes2hex("", &a.as_ref()), array_bytes::bytes2hex("", a),
array_bytes::bytes2hex("", &b.as_ref()), array_bytes::bytes2hex("", b),
array_bytes::bytes2hex("", &hash.as_ref()), array_bytes::bytes2hex("", hash),
array_bytes::bytes2hex("", &combined.as_ref()) array_bytes::bytes2hex("", &combined)
); );
position /= 2; position /= 2;
width = ((width - 1) / 2) + 1; width = ((width - 1) / 2) + 1;
@@ -316,8 +316,8 @@ where
#[cfg(feature = "debug")] #[cfg(feature = "debug")]
log::debug!( log::debug!(
" {:?}\n {:?}", " {:?}\n {:?}",
a.as_ref().map(|s| array_bytes::bytes2hex("", s.as_ref())), a.as_ref().map(|s| array_bytes::bytes2hex("", s)),
b.as_ref().map(|s| array_bytes::bytes2hex("", s.as_ref())) b.as_ref().map(|s| array_bytes::bytes2hex("", s))
); );
index += 2; index += 2;
@@ -339,7 +339,7 @@ where
#[cfg(feature = "debug")] #[cfg(feature = "debug")]
log::debug!( log::debug!(
"[merkelize_row] Next: {:?}", "[merkelize_row] Next: {:?}",
next.iter().map(|s| array_bytes::bytes2hex("", s.as_ref())).collect::<Vec<_>>() next.iter().map(|s| array_bytes::bytes2hex("", s)).collect::<Vec<_>>()
); );
return Err(next) return Err(next)
}, },
@@ -364,7 +364,7 @@ mod tests {
// then // then
assert_eq!( assert_eq!(
array_bytes::bytes2hex("", out.as_ref()), array_bytes::bytes2hex("", out),
"0000000000000000000000000000000000000000000000000000000000000000" "0000000000000000000000000000000000000000000000000000000000000000"
); );
} }
@@ -373,7 +373,7 @@ mod tests {
fn should_generate_single_root() { fn should_generate_single_root() {
// given // given
let _ = env_logger::try_init(); let _ = env_logger::try_init();
let data = vec![array_bytes::hex2array_unchecked::<20>( let data = vec![array_bytes::hex2array_unchecked::<_, 20>(
"E04CC55ebEE1cBCE552f250e85c57B70B2E2625b", "E04CC55ebEE1cBCE552f250e85c57B70B2E2625b",
)]; )];
@@ -382,7 +382,7 @@ mod tests {
// then // then
assert_eq!( assert_eq!(
array_bytes::bytes2hex("", out.as_ref()), array_bytes::bytes2hex("", out),
"aeb47a269393297f4b0a3c9c9cfd00c7a4195255274cf39d83dabc2fcc9ff3d7" "aeb47a269393297f4b0a3c9c9cfd00c7a4195255274cf39d83dabc2fcc9ff3d7"
); );
} }
@@ -392,8 +392,8 @@ mod tests {
// given // given
let _ = env_logger::try_init(); let _ = env_logger::try_init();
let data = vec![ let data = vec![
array_bytes::hex2array_unchecked::<20>("E04CC55ebEE1cBCE552f250e85c57B70B2E2625b"), array_bytes::hex2array_unchecked::<_, 20>("E04CC55ebEE1cBCE552f250e85c57B70B2E2625b"),
array_bytes::hex2array_unchecked::<20>("25451A4de12dcCc2D166922fA938E900fCc4ED24"), array_bytes::hex2array_unchecked::<_, 20>("25451A4de12dcCc2D166922fA938E900fCc4ED24"),
]; ];
// when // when
@@ -401,7 +401,7 @@ mod tests {
// then // then
assert_eq!( assert_eq!(
array_bytes::bytes2hex("", out.as_ref()), array_bytes::bytes2hex("", out),
"697ea2a8fe5b03468548a7a413424a6292ab44a82a6f5cc594c3fa7dda7ce402" "697ea2a8fe5b03468548a7a413424a6292ab44a82a6f5cc594c3fa7dda7ce402"
); );
} }
@@ -410,10 +410,7 @@ mod tests {
fn should_generate_root_complex() { fn should_generate_root_complex() {
let _ = env_logger::try_init(); let _ = env_logger::try_init();
let test = |root, data| { let test = |root, data| {
assert_eq!( assert_eq!(array_bytes::bytes2hex("", &merkle_root::<Keccak256, _>(data)), root);
array_bytes::bytes2hex("", &merkle_root::<Keccak256, _>(data).as_ref()),
root
);
}; };
test( test(
@@ -473,12 +470,12 @@ mod tests {
// then // then
assert_eq!( assert_eq!(
array_bytes::bytes2hex("", &proof0.root.as_ref()), array_bytes::bytes2hex("", &proof0.root),
array_bytes::bytes2hex("", &proof1.root.as_ref()) array_bytes::bytes2hex("", &proof1.root)
); );
assert_eq!( assert_eq!(
array_bytes::bytes2hex("", &proof2.root.as_ref()), array_bytes::bytes2hex("", &proof2.root),
array_bytes::bytes2hex("", &proof1.root.as_ref()) array_bytes::bytes2hex("", &proof1.root)
); );
assert!(!verify_proof::<Keccak256, _, _>( assert!(!verify_proof::<Keccak256, _, _>(
@@ -762,10 +759,7 @@ mod tests {
for l in 0..data.len() { for l in 0..data.len() {
// when // when
let proof = merkle_proof::<Keccak256, _, _>(data.clone(), l); let proof = merkle_proof::<Keccak256, _, _>(data.clone(), l);
assert_eq!( assert_eq!(array_bytes::bytes2hex("", &proof.root), array_bytes::bytes2hex("", &root));
array_bytes::bytes2hex("", &proof.root.as_ref()),
array_bytes::bytes2hex("", &root.as_ref())
);
assert_eq!(proof.leaf_index, l); assert_eq!(proof.leaf_index, l);
assert_eq!(&proof.leaf, &data[l]); assert_eq!(&proof.leaf, &data[l]);
@@ -805,7 +799,7 @@ mod tests {
], ],
number_of_leaves: data.len(), number_of_leaves: data.len(),
leaf_index: data.len() - 1, leaf_index: data.len() - 1,
leaf: array_bytes::hex2array_unchecked::<20>( leaf: array_bytes::hex2array_unchecked::<_, 20>(
"c26B34D375533fFc4c5276282Fa5D660F3d8cbcB" "c26B34D375533fFc4c5276282Fa5D660F3d8cbcB"
) )
.to_vec(), .to_vec(),
@@ -13,7 +13,7 @@ readme = "README.md"
targets = ["x86_64-unknown-linux-gnu"] targets = ["x86_64-unknown-linux-gnu"]
[dependencies] [dependencies]
array-bytes = "4.1" array-bytes = "6.1"
chrono = "0.4" chrono = "0.4"
clap = { version = "4.2.5", features = ["derive"] } clap = { version = "4.2.5", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.6.1" } codec = { package = "parity-scale-codec", version = "3.6.1" }