diff --git a/Cargo.lock b/Cargo.lock index 1e86d1c..5fca128 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -107,9 +107,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.12.0" +version = "3.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" +checksum = "9b1ce199063694f33ffb7dd4e0ee620741495c32833cde5aa08f02a0bf96f0c8" [[package]] name = "byte-slice-cast" @@ -171,9 +171,9 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cpufeatures" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280a9f2d8b3a38871a3c8a46fb80db65e5e5ed97da80c4d08bf27fb63e35e181" +checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" dependencies = [ "libc", ] @@ -235,13 +235,13 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d6a0976c999d473fe89ad888d5a284e55366d9dc9038b1ba2aa15128c4afa0" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" dependencies = [ "errno-dragonfly", "libc", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -265,9 +265,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.25" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" +checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" dependencies = [ "crc32fast", "miniz_oxide", @@ -381,9 +381,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" dependencies = [ "cfg-if", "libc", @@ -392,9 +392,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.16" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be7b54589b581f624f566bf5d8eb2bab1db736c51528720b6bd36b96b55924d" +checksum = "17f8a914c2987b688368b5138aa05321db91f4090cf26118185672ad588bce21" dependencies = [ "bytes", "fnv", @@ -457,9 +457,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.25" +version = "0.14.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" +checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" dependencies = [ "bytes", "futures-channel", @@ -572,15 +572,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.141" +version = "0.2.142" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5" +checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317" [[package]] name = "linux-raw-sys" -version = "0.3.1" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59d8c75012853d2e872fb56bc8a2e53718e2cafe1a4c823143141c6d90c322f" +checksum = "b64f40e5e03e0d54f03845c8197d0291253cdbedfb1cb46b13c2c117554a9f4c" [[package]] name = "log" @@ -605,9 +605,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.6.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" dependencies = [ "adler", ] @@ -666,9 +666,9 @@ checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" [[package]] name = "openssl" -version = "0.10.49" +version = "0.10.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d2f106ab837a24e03672c59b1239669a0596406ff657c3c0835b6b7f0f35a33" +checksum = "01b8574602df80f7b85fdfc5392fa884a4e3b3f4f35402c070ab34c3d3f78d56" dependencies = [ "bitflags", "cfg-if", @@ -687,7 +687,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] @@ -698,9 +698,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.84" +version = "0.9.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a20eace9dc2d82904039cb76dcf50fb1a0bba071cfd1629720b5d6f1ddba0fa" +checksum = "8e17f59264b2809d77ae94f0e1ebabc434773f370d6ca667bd223ea10e06cc7e" dependencies = [ "cc", "libc", @@ -710,9 +710,9 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.4.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "637935964ff85a605d114591d4d2c13c5d1ba2806dae97cea6bf180238a749ac" +checksum = "5ddb756ca205bd108aee3c62c6d3c994e1df84a59b9d6d4a5ea42ee1fd5a9a28" dependencies = [ "arrayvec 0.7.2", "bitvec", @@ -891,16 +891,16 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.7" +version = "0.37.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aae838e49b3d63e9274e1c01833cc8139d3fec468c3b84688c628f44b1ae11d" +checksum = "8bbfc1d1c7c40c01715f47d71444744a81669ca84e8b63e25a55e169b1f86433" dependencies = [ "bitflags", "errno", "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -1006,7 +1006,7 @@ checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] @@ -1091,7 +1091,7 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "subcryptor" -version = "0.10.0" +version = "0.10.1" dependencies = [ "base58", "blake2-rfc", @@ -1101,7 +1101,7 @@ dependencies = [ [[package]] name = "subhasher" -version = "0.10.0" +version = "0.10.1" dependencies = [ "blake2-rfc", "byteorder", @@ -1112,7 +1112,7 @@ dependencies = [ [[package]] name = "submetadatan" -version = "0.10.0" +version = "0.10.1" dependencies = [ "array-bytes", "frame-metadata", @@ -1125,7 +1125,7 @@ dependencies = [ [[package]] name = "subrpcer" -version = "0.10.0" +version = "0.10.1" dependencies = [ "affix", "once_cell", @@ -1138,14 +1138,14 @@ dependencies = [ [[package]] name = "subruntimer" -version = "0.10.0" +version = "0.10.1" dependencies = [ "serde", ] [[package]] name = "subspector" -version = "0.10.0" +version = "0.10.1" dependencies = [ "fxhash", "serde", @@ -1154,7 +1154,7 @@ dependencies = [ [[package]] name = "substorager" -version = "0.10.0" +version = "0.10.1" dependencies = [ "array-bytes", "parity-scale-codec", @@ -1163,7 +1163,7 @@ dependencies = [ [[package]] name = "subversioner" -version = "0.10.0" +version = "0.10.1" dependencies = [ "serde", ] @@ -1181,9 +1181,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.13" +version = "2.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c9da457c5285ac1f936ebd076af6dac17a61cfe7826f2076b4d015cf47bc8ec" +checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" dependencies = [ "proc-macro2", "quote", @@ -1226,7 +1226,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] @@ -1255,9 +1255,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.27.0" +version = "1.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0de47a4eecbe11f498978a9b29d792f0d2692d1dd003650c24c76510e3bc001" +checksum = "c3c786bf8134e5a3a166db9b29ab8f48134739014a3eca7bc6bfa95d673b136f" dependencies = [ "autocfg", "bytes", @@ -1265,7 +1265,7 @@ dependencies = [ "mio", "pin-project-lite", "socket2", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -1280,9 +1280,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" dependencies = [ "bytes", "futures-core", @@ -1317,10 +1317,11 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.38" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9cf6a813d3f40c88b0b6b6f29a5c95c6cdbf97c1f9cc53fb820200f5ad814d" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ + "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -1334,7 +1335,7 @@ checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] @@ -1725,9 +1726,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.4.1" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae8970b36c66498d8ff1d66685dc86b91b29db0c7739899012f63a63814b4b28" +checksum = "5617da7e1f97bf363947d767b91aaf3c2bbc19db7fda9c65af1278713d58e0a2" dependencies = [ "memchr", ] diff --git a/Cargo.toml b/Cargo.toml index 8a7f57e..b03203c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,14 +16,14 @@ members = [ homepage = "https://substrate-minimal.hack.ink" license = "GPL-3.0" repository = "https://github.com/hack-ink/substrate-minimal" - version = "0.10.0" + version = "0.10.1" [workspace.dependencies] # crates.io array-bytes = { version = "6.1" } fxhash = { version = "0.2" } once_cell = { version = "1.17" } - parity-scale-codec = { version = "3.4" } + parity-scale-codec = { version = "3.5" } reqwest = { version = "0.11" } scale-info = { version = "2.6" } serde = { version = "1.0" } diff --git a/subcryptor/src/test.rs b/subcryptor/src/test.rs index 5488392..18cfcd9 100644 --- a/subcryptor/src/test.rs +++ b/subcryptor/src/test.rs @@ -1,5 +1,5 @@ // substrate-minimal -use super::*; +use crate::*; const PUBLIC_KEY: &[u8] = &[ 180, 247, 240, 59, 235, 197, 110, 190, 150, 188, 82, 234, 94, 211, 21, 157, 69, 160, 206, 58, diff --git a/subhasher/Cargo.toml b/subhasher/Cargo.toml index d4c609d..38ae498 100644 --- a/subhasher/Cargo.toml +++ b/subhasher/Cargo.toml @@ -9,17 +9,9 @@ readme = "README.md" repository.workspace = true version.workspace = true -[dependencies] -# crates.io -blake2-rfc = { version = "0.2", default-features = false } -byteorder = { version = "1.4", default-features = false } -sha2 = { version = "0.10", default-features = false } -tiny-keccak = { version = "2.0", features = ["keccak"] } -twox-hash = { version = "1.6", default-features = false } - [features] default = [ - # hack-ink + # substrate-minimal "std", ] std = [ @@ -29,3 +21,12 @@ std = [ "sha2/std", "twox-hash/std", ] + + +[dependencies] +# crates.io +blake2-rfc = { version = "0.2", default-features = false } +byteorder = { version = "1.4", default-features = false } +sha2 = { version = "0.10", default-features = false } +tiny-keccak = { version = "2.0", features = ["keccak"] } +twox-hash = { version = "1.6", default-features = false } diff --git a/subhasher/src/test.rs b/subhasher/src/test.rs index 90eecd0..3c5e75c 100644 --- a/subhasher/src/test.rs +++ b/subhasher/src/test.rs @@ -1,5 +1,5 @@ // substrate-minimal -use super::*; +use crate::*; const DATA: &[u8] = &[ 180, 247, 240, 59, 235, 197, 110, 190, 150, 188, 82, 234, 94, 211, 21, 157, 69, 160, 206, 58, diff --git a/subrpcer/Cargo.toml b/subrpcer/Cargo.toml index 4ea3582..d6cf6c1 100644 --- a/subrpcer/Cargo.toml +++ b/subrpcer/Cargo.toml @@ -9,18 +9,12 @@ readme = "README.md" repository.workspace = true version.workspace = true -[dependencies] -# crates.io -# TODO: https://github.com/dtolnay/paste/issues/72 -affix = { version = "0.1" } -once_cell = { workspace = true, optional = true } -reqwest = { workspace = true, optional = true, features = ["json"] } -serde = { workspace = true } -serde_json = { workspace = true } -tracing = { workspace = true, optional = true } -ureq = { version = "2.6", optional = true, features = ["json"] } - [features] +trace = [ + # crates.io + "tracing", +] + reqwest-client = [ # crates.io "once_cell", @@ -30,3 +24,14 @@ ureq-client = [ # crates.io "ureq", ] + +[dependencies] +# crates.io +# TODO: https://github.com/dtolnay/paste/issues/72 +affix = { version = "0.1" } +once_cell = { workspace = true, optional = true } +reqwest = { workspace = true, optional = true, features = ["json"] } +serde = { workspace = true } +serde_json = { workspace = true } +tracing = { workspace = true, optional = true } +ureq = { version = "2.6", optional = true, features = ["json"] } diff --git a/subrpcer/src/lib.rs b/subrpcer/src/lib.rs index 54ceae4..7188950 100644 --- a/subrpcer/src/lib.rs +++ b/subrpcer/src/lib.rs @@ -119,8 +119,11 @@ pub fn rpc(id: usize, method: &str, params: Value) -> Value { "params": params }); - #[cfg(feature = "tracing")] - tracing::trace!("Rpc({:?})", serde_json::to_string(&rpc).unwrap()); + // This must not fail. + // + // `unwrap_or_default` is useless actually. + #[cfg(feature = "trace")] + tracing::trace!("Rpc({:?})", serde_json::to_string(&rpc).unwrap_or_default()); rpc } diff --git a/substorager/Cargo.toml b/substorager/Cargo.toml index 56a1ae8..cadefe3 100644 --- a/substorager/Cargo.toml +++ b/substorager/Cargo.toml @@ -9,15 +9,15 @@ readme = "README.md" repository.workspace = true version.workspace = true +[features] +codec = [ + # crates.io + "parity-scale-codec", +] + [dependencies] # crates.io array-bytes = { workspace = true } parity-scale-codec = { workspace = true, optional = true, features = ["derive"] } # hack-ink subhasher = { workspace = true } - -[features] -codec = [ - # crates.io - "parity-scale-codec", -] diff --git a/substorager/src/lib.rs b/substorager/src/lib.rs index 2cadd53..9f8dc31 100644 --- a/substorager/src/lib.rs +++ b/substorager/src/lib.rs @@ -48,13 +48,13 @@ impl From> for StorageKey { } } impl From<[u8; N]> for StorageKey { - fn from(a: [u8; N]) -> Self { - Self(a.to_vec()) + fn from(v: [u8; N]) -> Self { + Self(v.to_vec()) } } impl From<&[u8]> for StorageKey { - fn from(a: &[u8]) -> Self { - Self(a.to_vec()) + fn from(v: &[u8]) -> Self { + Self(v.to_vec()) } } diff --git a/substorager/src/test.rs b/substorager/src/test.rs index 414b026..34c9937 100644 --- a/substorager/src/test.rs +++ b/substorager/src/test.rs @@ -1,5 +1,5 @@ // substrate-minimal -use super::*; +use crate::*; #[test] fn storage_key_should_work() {