From afc4b7dddafdc01af39b176bfca6be6c3e728950 Mon Sep 17 00:00:00 2001 From: Alex Coats Date: Tue, 15 Aug 2023 08:55:03 -0400 Subject: [PATCH 1/7] Update ed25519-dalek and some other deps --- Cargo.lock | 1267 ++++++++++++---------- Cargo.toml | 8 +- src/analytics/ledger/transaction_size.rs | 2 +- src/bin/inx-chronicle/api/config.rs | 5 +- src/bin/inx-chronicle/api/error.rs | 2 + src/bin/inx-chronicle/api/secret_key.rs | 33 +- src/model/mod.rs | 1 + 7 files changed, 704 insertions(+), 614 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d73b709f8..3fbacc304 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,21 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "addr2line" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + [[package]] name = "ahash" version = "0.7.6" @@ -26,13 +41,19 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.20" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +checksum = "6748e8def348ed4d14996fa801f4122cd763fff530258cdc03f64b25f89d3a5a" dependencies = [ "memchr", ] +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + [[package]] name = "android_system_properties" version = "0.1.5" @@ -42,29 +63,35 @@ dependencies = [ "libc", ] +[[package]] +name = "anstyle" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" + [[package]] name = "anyhow" -version = "1.0.69" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224afbd727c3d6e4b90103ece64b8d1b67fbb1973b1046c2281eed3f3803f800" +checksum = "f768393e7fabd388fe8409b13faa4d93ab0fef35db1508438dfdb066918bcf38" [[package]] name = "arrayref" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" [[package]] name = "arrayvec" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "async-stream" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad445822218ce64be7a341abfb0b1ea43b5c23aa83902542a4542e78309d8e5e" +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" dependencies = [ "async-stream-impl", "futures-core", @@ -73,24 +100,24 @@ dependencies = [ [[package]] name = "async-stream-impl" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4655ae1a7b0cdf149156f780c5bf3f1352bc53cbd9e0a361a7ef7b22947e965" +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] name = "async-trait" -version = "0.1.66" +version = "0.1.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84f9ebcc6c1f5b8cb160f6990096a5c127f423fcb6e1ccc46c370cbdfb75dfc" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] @@ -101,7 +128,7 @@ checksum = "1569e82073f20324826e6445ae9924d57bd7b3ae8936307b35c0f96af32d66ea" dependencies = [ "jsonwebtoken", "rand", - "rust-argon2", + "rust-argon2 1.0.1", "serde", "thiserror", ] @@ -120,7 +147,7 @@ checksum = "acee9fd5073ab6b045a275b3e709c163dd36c90685219cb21804a147b58dba43" dependencies = [ "async-trait", "axum-core 0.2.9", - "bitflags", + "bitflags 1.3.2", "bytes", "futures-util", "headers", @@ -146,20 +173,20 @@ dependencies = [ [[package]] name = "axum" -version = "0.6.11" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13d8068b6ccb8b34db9de397c7043f91db8b4c66414952c6db944f238c4d3db3" +checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" dependencies = [ "async-trait", - "axum-core 0.3.3", - "bitflags", + "axum-core 0.3.4", + "bitflags 1.3.2", "bytes", "futures-util", "http", "http-body", "hyper", "itoa", - "matchit 0.7.0", + "matchit 0.7.2", "memchr", "mime", "percent-encoding", @@ -190,9 +217,9 @@ dependencies = [ [[package]] name = "axum-core" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2f958c80c248b34b9a877a643811be8dbca03ca5ba827f2b63baf3a81e5fc4e" +checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" dependencies = [ "async-trait", "bytes", @@ -205,6 +232,21 @@ dependencies = [ "tower-service", ] +[[package]] +name = "backtrace" +version = "0.3.68" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + [[package]] name = "base64" version = "0.13.1" @@ -213,9 +255,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.0" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" [[package]] name = "base64ct" @@ -244,6 +286,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" + [[package]] name = "bitvec" version = "1.0.1" @@ -262,7 +310,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -273,7 +321,7 @@ checksum = "3c2f0dc9a68c6317d884f97cc36cf5a3d20ba14ce404227df55e1af708ab04bc" dependencies = [ "arrayref", "arrayvec", - "constant_time_eq 0.2.5", + "constant_time_eq 0.2.6", ] [[package]] @@ -296,15 +344,15 @@ dependencies = [ [[package]] name = "bson" -version = "2.6.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cc3e671fc2a91c8e84396cf14a8ed5a4c929739446aa6a33763b7e7d1568bf4" +checksum = "9aeb8bae494e49dbc330dd23cf78f6f7accee22f640ce3ab17841badaa4ce232" dependencies = [ "ahash 0.7.6", "base64 0.13.1", "bitvec", "hex", - "indexmap", + "indexmap 1.9.3", "js-sys", "lazy_static", "rand", @@ -317,9 +365,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.12.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "byte-slice-cast" @@ -353,9 +401,12 @@ checksum = "38fcc2979eff34a4b84e1cf9a1e3da42a7d44b3b690a40cdcb23e3d556cfb2e5" [[package]] name = "cc" -version = "1.0.79" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "305fe645edc1442a0fa8b6726ba61d422798d37a52e12eaecf4b022ebbb88f01" +dependencies = [ + "libc", +] [[package]] name = "cfg-if" @@ -377,7 +428,7 @@ dependencies = [ "decimal", "derive_more", "dotenvy", - "ed25519 2.2.0", + "ed25519", "ed25519-dalek", "eyre", "futures", @@ -387,17 +438,17 @@ dependencies = [ "hyper", "influxdb", "inx", - "iota-crypto 0.17.0", + "iota-crypto 0.23.0", "iota-types", "mongodb", "packable", "pin-project", - "prefix-hex 0.7.0", + "prefix-hex 0.7.1", "primitive-types", "rand", "regex", "ron", - "rust-argon2", + "rust-argon2 2.0.0", "serde", "serde_bytes", "serde_json", @@ -408,7 +459,7 @@ dependencies = [ "tokio-stream", "tonic", "tower", - "tower-http 0.4.0", + "tower-http 0.4.3", "tracing", "tracing-subscriber", "uint", @@ -420,12 +471,12 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.24" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" +checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" dependencies = [ + "android-tzdata", "iana-time-zone", - "num-integer", "num-traits", "serde", "winapi", @@ -433,66 +484,61 @@ dependencies = [ [[package]] name = "clap" -version = "4.1.8" +version = "4.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d7ae14b20b94cb02149ed21a86c423859cbe18dc7ed69845cace50e52b40a5" +checksum = "c27cdf28c0f604ba3f512b0c9a409f8de8513e4816705deb0498b627e7c3a3fd" dependencies = [ - "bitflags", + "clap_builder", "clap_derive", - "clap_lex", "once_cell", +] + +[[package]] +name = "clap_builder" +version = "4.3.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08a9f1ab5e9f01a9b81f202e8562eb9a10de70abf9eaeac1be465c28b75aa4aa" +dependencies = [ + "anstyle", + "clap_lex", "terminal_size", ] [[package]] name = "clap_derive" -version = "4.1.8" +version = "4.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44bec8e5c9d09e439c4335b1af0abaab56dcf3b94999a936e1bb47b9134288f0" +checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" dependencies = [ "heck", - "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] name = "clap_lex" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "350b9cf31731f9957399229e9b2adc51eeabdfbe9d71d9a0552275fd12710d09" -dependencies = [ - "os_str_bytes", -] - -[[package]] -name = "codespan-reporting" -version = "0.11.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", -] +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" [[package]] name = "const-oid" -version = "0.9.2" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520fbf3c07483f94e3e3ca9d0cfd913d7718ef2483d2cfd91c0d9e91474ab913" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" [[package]] name = "constant_time_eq" -version = "0.1.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" +checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6" [[package]] name = "constant_time_eq" -version = "0.2.5" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13418e745008f7349ec7e449155f419a61b92b58a99cc3616942b926825ec76b" +checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" [[package]] name = "convert_case" @@ -502,15 +548,15 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "core-foundation-sys" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cpufeatures" -version = "0.2.5" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" dependencies = [ "libc", ] @@ -545,47 +591,31 @@ dependencies = [ ] [[package]] -name = "cxx" -version = "1.0.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a140f260e6f3f79013b8bfc65e7ce630c9ab4388c6a89c71e07226f49487b72" -dependencies = [ - "cc", - "cxxbridge-flags", - "cxxbridge-macro", - "link-cplusplus", -] - -[[package]] -name = "cxx-build" -version = "1.0.92" +name = "curve25519-dalek" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da6383f459341ea689374bf0a42979739dc421874f112ff26f829b8040b8e613" +checksum = "f711ade317dd348950a9910f81c5947e3d8907ebd2b83f76203ff1807e6a2bc2" dependencies = [ - "cc", - "codespan-reporting", - "once_cell", - "proc-macro2", - "quote", - "scratch", - "syn", + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto", + "platforms", + "rustc_version 0.4.0", + "subtle", + "zeroize", ] [[package]] -name = "cxxbridge-flags" -version = "1.0.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90201c1a650e95ccff1c8c0bb5a343213bdd317c6e600a93075bca2eff54ec97" - -[[package]] -name = "cxxbridge-macro" -version = "1.0.92" +name = "curve25519-dalek-derive" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b75aed41bb2e6367cae39e6326ef817a851db13c13e4f3263714ca3cfb8de56" +checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] @@ -609,7 +639,7 @@ dependencies = [ "proc-macro2", "quote", "strsim", - "syn", + "syn 1.0.109", ] [[package]] @@ -620,14 +650,14 @@ checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" dependencies = [ "darling_core", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "data-encoding" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" +checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "decimal" @@ -635,7 +665,7 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a8ab77e91baeb15034c3be91e87bff4665c9036216148e4996d9a9f5792114d" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cc", "libc", "serde", @@ -643,15 +673,24 @@ dependencies = [ [[package]] name = "der" -version = "0.7.1" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc906908ea6458456e5eaa160a9c08543ec3d1e6f71e2235cedd660cb65f9df0" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" dependencies = [ "const-oid", "pem-rfc7468", "zeroize", ] +[[package]] +name = "deranged" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7684a49fb1af197853ef7b2ee694bc1f5b4179556f1e5710e1760c5db6f5e929" +dependencies = [ + "serde", +] + [[package]] name = "derivative" version = "2.2.0" @@ -660,7 +699,7 @@ checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -673,7 +712,7 @@ dependencies = [ "proc-macro2", "quote", "rustc_version 0.4.0", - "syn", + "syn 1.0.109", ] [[package]] @@ -687,9 +726,9 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", "crypto-common", @@ -698,38 +737,30 @@ dependencies = [ [[package]] name = "dotenvy" -version = "0.15.6" +version = "0.15.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03d8c417d7a8cb362e0c37e5d815f5eb7c37f79ff93707329d5a194e42e54ca0" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" [[package]] name = "ed25519" -version = "1.5.3" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" -dependencies = [ - "signature 1.6.4", -] - -[[package]] -name = "ed25519" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be522bee13fa6d8059f4903a4084aa3bd50725e18150202f0238deb615cd6371" +checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d" dependencies = [ "pkcs8", - "signature 2.0.0", + "signature", ] [[package]] name = "ed25519-dalek" -version = "1.0.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" dependencies = [ - "curve25519-dalek", - "ed25519 1.5.3", - "sha2 0.9.9", + "curve25519-dalek 4.0.0", + "ed25519", + "serde", + "sha2 0.10.7", "zeroize", ] @@ -739,7 +770,7 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" dependencies = [ - "curve25519-dalek", + "curve25519-dalek 3.2.0", "hashbrown 0.12.3", "hex", "rand_core 0.6.4", @@ -749,9 +780,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "encoding_rs" @@ -771,18 +802,24 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + [[package]] name = "errno" -version = "0.2.8" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" dependencies = [ "errno-dragonfly", "libc", - "winapi", + "windows-sys", ] [[package]] @@ -807,12 +844,15 @@ dependencies = [ [[package]] name = "fastrand" -version = "1.9.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" + +[[package]] +name = "fiat-crypto" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e825f6987101665dea6ec934c09ec6d721de7bc1bf92248e1d5810c8cd636b77" [[package]] name = "fixed-hash" @@ -840,9 +880,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ "percent-encoding", ] @@ -855,9 +895,9 @@ checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] name = "futures" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531ac96c6ff5fd7c62263c5e3c67a603af4fcaee2e1a0ae5565ba3a11e69e549" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" dependencies = [ "futures-channel", "futures-core", @@ -869,9 +909,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "164713a5a0dcc3e7b4b1ed7d3b433cabc18025386f9339346e8daf15963cf7ac" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ "futures-core", "futures-sink", @@ -879,15 +919,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" [[package]] name = "futures-executor" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1997dd9df74cdac935c76252744c1ed5794fac083242ea4fe77ef3ed60ba0f83" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" dependencies = [ "futures-core", "futures-task", @@ -896,38 +936,38 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d422fa3cbe3b40dca574ab087abb5bc98258ea57eea3fd6f1fa7162c778b91" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" [[package]] name = "futures-macro" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eb14ed937631bd8b8b8977f2c198443447a8355b6e3ca599f38c975e5a963b6" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] name = "futures-sink" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec93083a4aecafb2a80a885c9de1f0ccae9dbd32c2bb54b0c3a65690e0b8d2f2" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" [[package]] name = "futures-task" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd65540d33b37b16542a0438c12e6aeead10d4ac5d05bd3f805b8f35ab592879" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" [[package]] name = "futures-util" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ef6b17e481503ec85211fed8f39d1970f128935ca1f814cd32ac4a6842e84ab" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ "futures-core", "futures-io", @@ -942,9 +982,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -952,9 +992,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.8" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if", "libc", @@ -970,14 +1010,20 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] +[[package]] +name = "gimli" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" + [[package]] name = "h2" -version = "0.3.17" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66b91535aa35fea1523ad1b86cb6b53c28e0ae566ba4a460f4457e936cad7c6f" +checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" dependencies = [ "bytes", "fnv", @@ -985,7 +1031,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 1.9.3", "slab", "tokio", "tokio-util", @@ -1011,6 +1057,12 @@ dependencies = [ "serde", ] +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" + [[package]] name = "headers" version = "0.3.8" @@ -1018,7 +1070,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3e372db8e5c0d213e0cd0b9be18be2aca3d44cf2fe30a9d46a65581cd454584" dependencies = [ "base64 0.13.1", - "bitflags", + "bitflags 1.3.2", "bytes", "headers-core", "http", @@ -1044,12 +1096,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.2.6" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" [[package]] name = "hex" @@ -1063,7 +1112,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -1101,9 +1150,9 @@ dependencies = [ [[package]] name = "http-range-header" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" +checksum = "add0ab9360ddbd88cfeb3bd9574a1d85cfdfa14db10b3e21d3700dbc4328758f" [[package]] name = "httparse" @@ -1113,9 +1162,9 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "humantime" @@ -1135,9 +1184,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.25" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes", "futures-channel", @@ -1150,7 +1199,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.9", "tokio", "tower-service", "tracing", @@ -1159,15 +1208,16 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.23.2" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" dependencies = [ + "futures-util", "http", "hyper", - "rustls", + "rustls 0.21.6", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", ] [[package]] @@ -1184,26 +1234,25 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.53" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +checksum = "2fad5b825842d2b38bd206f3e81d6957625fd7f0a361e345c30e01a0ae2dd613" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "winapi", + "windows", ] [[package]] name = "iana-time-zone-haiku" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ - "cxx", - "cxx-build", + "cc", ] [[package]] @@ -1225,9 +1274,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1259,7 +1308,7 @@ checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1270,14 +1319,24 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" [[package]] name = "indexmap" -version = "1.9.2" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", "hashbrown 0.12.3", ] +[[package]] +name = "indexmap" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown 0.14.0", +] + [[package]] name = "influxdb" version = "0.5.2" @@ -1298,22 +1357,13 @@ dependencies = [ [[package]] name = "influxdb_derive" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d81efbf97cec06c647f05a8b5edcbc52434cdf980d8d4ace68e1028c90241d3" +checksum = "6ac96b3660efd0cde32b0b20bc86cc93f33269cd9f6c97e759e0b0259b2133fb" dependencies = [ "proc-macro2", "quote", - "syn", -] - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", + "syn 2.0.28", ] [[package]] @@ -1329,12 +1379,13 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "1.0.6" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfa919a82ea574332e2de6e74b4c36e74d41982b335080fa59d4ef31be20fdf3" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ + "hermit-abi", "libc", - "windows-sys 0.45.0", + "windows-sys", ] [[package]] @@ -1345,7 +1396,7 @@ checksum = "4e04d492224bff6e97142f033d0a4383bcbc05918be1ff7b3abd2c1cc85205a2" dependencies = [ "autocfg", "blake2", - "digest 0.10.6", + "digest 0.10.7", "ed25519-zebra", "num-traits", "serde", @@ -1353,13 +1404,13 @@ dependencies = [ [[package]] name = "iota-crypto" -version = "0.17.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef4f42fc99281d9677950005223e2d0b122f5b08da6c92d91833017b279373db" +checksum = "c5d5a986d972c3a703d48ced24fdc0bf16fb2d02959ff4b152fa77b9132f6fb0" dependencies = [ "autocfg", "blake2", - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -1369,7 +1420,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31d51adb91478d259bcb6fb242db62d075e3a800adaaaa5bdce3d7ce75557b52" dependencies = [ "bech32", - "bitflags", + "bitflags 1.3.2", "bytemuck", "derive_more", "getset", @@ -1389,21 +1440,21 @@ dependencies = [ [[package]] name = "ipconfig" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd302af1b90f2463a98fa5ad469fc212c8e3175a41c3068601bfa2727591c5be" +checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2", + "socket2 0.5.3", "widestring", - "winapi", - "winreg", + "windows-sys", + "winreg 0.50.0", ] [[package]] name = "ipnet" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" [[package]] name = "iterator-sorted" @@ -1422,26 +1473,26 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "js-sys" -version = "0.3.61" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ "wasm-bindgen", ] [[package]] name = "jsonwebtoken" -version = "8.2.0" +version = "8.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09f4f04699947111ec1733e71778d763555737579e44b85844cae8e1940a1828" +checksum = "6971da4d9c3aa03c3d8f3ff0f4155b534aad021292003895a469716b2a230378" dependencies = [ - "base64 0.13.1", + "base64 0.21.2", "ring", "serde", "serde_json", @@ -1455,18 +1506,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.140" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" - -[[package]] -name = "link-cplusplus" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" -dependencies = [ - "cc", -] +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "linked-hash-map" @@ -1476,15 +1518,21 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.1.4" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "linux-raw-sys" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" +checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" [[package]] name = "lock_api" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" dependencies = [ "autocfg", "scopeguard", @@ -1492,12 +1540,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lru-cache" @@ -1520,7 +1565,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ - "regex-automata", + "regex-automata 0.1.10", ] [[package]] @@ -1537,9 +1582,9 @@ checksum = "73cbba799671b762df5a175adf59ce145165747bb891505c43d09aefbbf38beb" [[package]] name = "matchit" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b87248edafb776e59e6ee64a79086f65890d3510f2c656c000bf2a7e8a0aea40" +checksum = "ed1202b2a6f884ae56f04cff409ab315c5ce26b5e58d7412e484f01fd52f52ef" [[package]] name = "md-5" @@ -1547,7 +1592,7 @@ version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -1558,31 +1603,39 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "mime" -version = "0.3.16" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "miniz_oxide" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] [[package]] name = "mio" -version = "0.8.6" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", - "log", "wasi", - "windows-sys 0.45.0", + "windows-sys", ] [[package]] name = "mongodb" -version = "2.4.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a37fe10c1485a0cd603468e284a1a8535b4ecf46808f5f7de3639a1e1252dbf8" +checksum = "ebcd85ec209a5b84fd9f54b9e381f6fa17462bc74160d018fc94fd8b9f61faa8" dependencies = [ "async-trait", "base64 0.13.1", - "bitflags", + "bitflags 1.3.2", "bson", "chrono", "derivative", @@ -1599,20 +1652,20 @@ dependencies = [ "percent-encoding", "rand", "rustc_version_runtime", - "rustls", + "rustls 0.20.8", "rustls-pemfile", "serde", "serde_bytes", "serde_with", "sha-1", - "sha2 0.10.6", - "socket2", + "sha2 0.10.7", + "socket2 0.4.9", "stringprep", "strsim", "take_mut", "thiserror", "tokio", - "tokio-rustls", + "tokio-rustls 0.23.4", "tokio-util", "trust-dns-proto", "trust-dns-resolver", @@ -1637,30 +1690,20 @@ dependencies = [ "winapi", ] -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", ] [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ "hermit-abi", "libc", @@ -1675,11 +1718,20 @@ dependencies = [ "libc", ] +[[package]] +name = "object" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" -version = "1.17.1" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "opaque-debug" @@ -1687,12 +1739,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" -[[package]] -name = "os_str_bytes" -version = "6.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" - [[package]] name = "overload" version = "0.1.1" @@ -1721,14 +1767,14 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "parity-scale-codec" -version = "3.4.0" +version = "3.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "637935964ff85a605d114591d4d2c13c5d1ba2806dae97cea6bf180238a749ac" +checksum = "dd8e946cc0cc711189c0b0249fb8b599cbeeab9784d83c415719368bb8d4ac64" dependencies = [ "arrayvec", "bitvec", @@ -1740,14 +1786,14 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.1.4" +version = "3.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b26a931f824dd4eca30b3e43bb4f31cd5f0d3a403c5f5ff27106b805bfde7b" +checksum = "2a296c3079b5fefbc499e1de58dc26c09b1b9a5952d26694ee89f04a43ebbb3e" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1762,15 +1808,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.7" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-sys 0.45.0", + "windows-targets", ] [[package]] @@ -1779,7 +1825,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -1793,9 +1839,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "petgraph" @@ -1804,34 +1850,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" dependencies = [ "fixedbitset", - "indexmap", + "indexmap 1.9.3", ] [[package]] name = "pin-project" -version = "1.0.12" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.12" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05" [[package]] name = "pin-utils" @@ -1841,14 +1887,20 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkcs8" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d2820d87d2b008616e5c27212dd9e0e694fb4c6b522de06094106813328cb49" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ "der", "spki", ] +[[package]] +name = "platforms" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -1868,9 +1920,9 @@ dependencies = [ [[package]] name = "prefix-hex" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9653998c1c55e1705580cf92d156b57094bbae6c83482d406f2223439cd354a" +checksum = "1f1799f398371ad6957951ec446d3ff322d35c46d9db2e217b67e828b311c249" dependencies = [ "hex", "primitive-types", @@ -1884,7 +1936,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" dependencies = [ "proc-macro2", - "syn", + "syn 1.0.109", ] [[package]] @@ -1918,7 +1970,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.109", "version_check", ] @@ -1935,18 +1987,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.52" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d0e1ae9e836cc3beddd63db0df682593d7e2d3d891ae8c9083d2113e1744224" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "prost" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48e50df39172a3e7eb17e14642445da64996989bc212b583015435d39a58537" +checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" dependencies = [ "bytes", "prost-derive", @@ -1954,9 +2006,9 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c828f93f5ca4826f97fedcbd3f9a536c16b12cff3dbbb4a007f932bbad95b12" +checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" dependencies = [ "bytes", "heck", @@ -1969,29 +2021,29 @@ dependencies = [ "prost", "prost-types", "regex", - "syn", + "syn 1.0.109", "tempfile", "which", ] [[package]] name = "prost-derive" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea9b0f8cbe5e15a8a042d030bd96668db28ecb567ec37d691971ff5731d2b1b" +checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" dependencies = [ "anyhow", "itertools", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] name = "prost-types" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "379119666929a1afd7a043aa6cf96fa67a6dce9af60c88095a4686dbce4c9c88" +checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" dependencies = [ "prost", ] @@ -2004,9 +2056,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.26" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" dependencies = [ "proc-macro2", ] @@ -2055,22 +2107,23 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] name = "regex" -version = "1.7.1" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" +checksum = "81bc1d4caf89fac26a70747fe603c130093b53c773888797a6329091246d651a" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-automata 0.3.6", + "regex-syntax 0.7.4", ] [[package]] @@ -2079,22 +2132,39 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" dependencies = [ - "regex-syntax", + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.7.4", ] [[package]] name = "regex-syntax" -version = "0.6.28" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" +checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" [[package]] name = "reqwest" -version = "0.11.14" +version = "0.11.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21eed90ec8570952d53b772ecf8f206aa1ec9a3d76b2521c56c42973f2d91ee9" +checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" dependencies = [ - "base64 0.21.0", + "base64 0.21.2", "bytes", "encoding_rs", "futures-core", @@ -2111,20 +2181,20 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls", + "rustls 0.21.6", "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", "webpki-roots", - "winreg", + "winreg 0.10.1", ] [[package]] @@ -2159,21 +2229,38 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "300a51053b1cb55c80b7a9fde4120726ddf25ca241a1cbb926626f62fb136bff" dependencies = [ "base64 0.13.1", - "bitflags", + "bitflags 1.3.2", "serde", ] [[package]] name = "rust-argon2" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b50162d19404029c1ceca6f6980fe40d45c8b369f6f44446fa14bb39573b5bb9" +checksum = "a5885493fdf0be6cdff808d1533ce878d21cfa49c7086fa00c66355cd9141bfc" dependencies = [ - "base64 0.13.1", + "base64 0.21.2", "blake2b_simd", - "constant_time_eq 0.1.5", + "constant_time_eq 0.3.0", ] +[[package]] +name = "rust-argon2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e71971821b3ae0e769e4a4328dbcb517607b434db7697e9aba17203ec14e46a" +dependencies = [ + "base64 0.21.2", + "blake2b_simd", + "constant_time_eq 0.3.0", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + [[package]] name = "rustc-hex" version = "2.1.0" @@ -2195,7 +2282,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.17", + "semver 1.0.18", ] [[package]] @@ -2210,16 +2297,29 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.9" +version = "0.37.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd5c6ff11fecd55b40746d1995a02f2eb375bf8c00d192d521ee09f42bef37bc" +checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" dependencies = [ - "bitflags", + "bitflags 1.3.2", "errno", "io-lifetimes", "libc", - "linux-raw-sys", - "windows-sys 0.45.0", + "linux-raw-sys 0.3.8", + "windows-sys", +] + +[[package]] +name = "rustix" +version = "0.38.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f" +dependencies = [ + "bitflags 2.4.0", + "errno", + "libc", + "linux-raw-sys 0.4.5", + "windows-sys", ] [[package]] @@ -2234,38 +2334,54 @@ dependencies = [ "webpki", ] +[[package]] +name = "rustls" +version = "0.21.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1feddffcfcc0b33f5c6ce9a29e341e4cd59c3f78e7ee45f4a40c038b1d6cbb" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct", +] + [[package]] name = "rustls-pemfile" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.0", + "base64 0.21.2", ] [[package]] -name = "rustversion" -version = "1.0.12" +name = "rustls-webpki" +version = "0.101.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" +checksum = "261e9e0888cba427c3316e6322805653c9425240b6fd96cee7cb671ab70ab8d0" +dependencies = [ + "ring", + "untrusted", +] [[package]] -name = "ryu" -version = "1.0.13" +name = "rustversion" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] -name = "scopeguard" -version = "1.1.0" +name = "ryu" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] -name = "scratch" -version = "1.0.5" +name = "scopeguard" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1792db035ce95be60c3f8853017b3999209281c24e2ba5bc8e59bf97a0c590c1" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sct" @@ -2288,9 +2404,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" [[package]] name = "semver-parser" @@ -2300,9 +2416,9 @@ checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" [[package]] name = "serde" -version = "1.0.156" +version = "1.0.183" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "314b5b092c0ade17c00142951e50ced110ec27cea304b1037c6969246c2469a4" +checksum = "32ac8da02677876d532745a130fc9d8e6edfa81a269b107c5b00829b91d8eb3c" dependencies = [ "serde_derive", ] @@ -2318,31 +2434,31 @@ dependencies = [ [[package]] name = "serde_bytes" -version = "0.11.9" +version = "0.11.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "416bda436f9aab92e02c8e10d49a15ddd339cea90b6e340fe51ed97abb548294" +checksum = "ab33ec92f677585af6d88c65593ae2375adde54efdbf16d597f2cbc7a6d368ff" dependencies = [ "serde", ] [[package]] name = "serde_derive" -version = "1.0.156" +version = "1.0.183" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7e29c4601e36bcec74a223228dce795f4cd3616341a4af93520ca1a837c087d" +checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] name = "serde_json" -version = "1.0.94" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea" +checksum = "076066c5f1078eac5b722a31827a8832fe108bed65dfa75e233c89f8206e976c" dependencies = [ - "indexmap", + "indexmap 2.0.0", "itoa", "ryu", "serde", @@ -2350,13 +2466,13 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.11" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395627de918015623b32e7669714206363a7fc00382bf477e72c1f7533e8eafc" +checksum = "8725e1dfadb3a50f7e5ce0b1a540466f6ed3fe7a0fca2ac2b8b831d31316bd00" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] @@ -2390,7 +2506,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2401,7 +2517,7 @@ checksum = "f5058ada175748e33390e40e872bd0fe59a19f265d0158daa551c5a88a76009c" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -2412,7 +2528,7 @@ checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -2430,13 +2546,13 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" dependencies = [ "cfg-if", "cpufeatures", - "digest 0.10.6", + "digest 0.10.7", ] [[package]] @@ -2459,15 +2575,9 @@ dependencies = [ [[package]] name = "signature" -version = "1.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" - -[[package]] -name = "signature" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fe458c98333f9c8152221191a77e2a44e8325d0193484af2e9421a53019e57d" +checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" [[package]] name = "slab" @@ -2480,9 +2590,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" [[package]] name = "socket2" @@ -2494,6 +2604,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "socket2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +dependencies = [ + "libc", + "windows-sys", +] + [[package]] name = "spin" version = "0.5.2" @@ -2502,9 +2622,9 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] name = "spki" -version = "0.7.0" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0445c905640145c7ea8c1993555957f65e7c46d0535b91ba501bc9bfc85522f" +checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" dependencies = [ "base64ct", "der", @@ -2518,9 +2638,9 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "stringprep" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ee348cb74b87454fff4b551cbf727025810a004f88aeacae7f85b87f4e9a1c1" +checksum = "db3737bde7edce97102e0e2b15365bf7a20bfdb5f60f4f9e8d7004258a51a8da" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -2534,9 +2654,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" @@ -2550,23 +2670,22 @@ dependencies = [ ] [[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - -[[package]] -name = "synstructure" -version = "0.12.6" +name = "syn" +version = "2.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" dependencies = [ "proc-macro2", "quote", - "syn", - "unicode-xid", + "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "take_mut" version = "0.2.2" @@ -2581,54 +2700,45 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.4.0" +version = "3.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95" +checksum = "dc02fddf48964c42031a0b3fe0428320ecf3a73c401040fc0096f97794310651" dependencies = [ "cfg-if", "fastrand", "redox_syscall", - "rustix", - "windows-sys 0.42.0", -] - -[[package]] -name = "termcolor" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" -dependencies = [ - "winapi-util", + "rustix 0.38.8", + "windows-sys", ] [[package]] name = "terminal_size" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c9afddd2cec1c0909f06b00ef33f94ab2cc0578c4a610aa208ddfec8aa2b43a" +checksum = "8e6bf6f19e9f8ed8d4048dc22981458ebcf406d67e94cd422e5ecd73d63b3237" dependencies = [ - "rustix", - "windows-sys 0.45.0", + "rustix 0.37.23", + "windows-sys", ] [[package]] name = "thiserror" -version = "1.0.39" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5ab016db510546d856297882807df8da66a16fb8c4101cb8b30054b0d5b2d9c" +checksum = "dedd246497092a89beedfe2c9f176d44c1b672ea6090edc20544ade01fbb7ea0" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.39" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5420d42e90af0c38c3290abcca25b9b3bdf379fc9f55c528f53a269d9c9a267e" +checksum = "7d7b1fadccbbc7e19ea64708629f9d8dccd007c260d66485f20a6d41bc1cf4b3" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] @@ -2643,10 +2753,11 @@ dependencies = [ [[package]] name = "time" -version = "0.3.20" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" +checksum = "b0fdd63d58b18d663fbdf70e049f00a22c8e42be082203be7f26589213cd75ea" dependencies = [ + "deranged", "itoa", "libc", "num_threads", @@ -2657,15 +2768,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" +checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.8" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd80a657e71da814b8e5d60d3374fc6d35045062245d80224748ae522dd76f36" +checksum = "eb71511c991639bb078fd5bf97757e03914361c48100d52878b8e52b46fb92cd" dependencies = [ "time-core", ] @@ -2687,21 +2798,20 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.26.0" +version = "1.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" +checksum = "40de3a2ba249dcb097e01be5e67a5ff53cf250397715a071a81543e8a832a920" dependencies = [ - "autocfg", + "backtrace", "bytes", "libc", - "memchr", "mio", "num_cpus", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.3", "tokio-macros", - "windows-sys 0.45.0", + "windows-sys", ] [[package]] @@ -2716,13 +2826,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.8.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] @@ -2731,16 +2841,26 @@ version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ - "rustls", + "rustls 0.20.8", "tokio", "webpki", ] +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls 0.21.6", + "tokio", +] + [[package]] name = "tokio-stream" -version = "0.1.12" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", "pin-project-lite", @@ -2749,9 +2869,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", @@ -2764,17 +2884,17 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.1" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" [[package]] name = "toml_edit" -version = "0.19.7" +version = "0.19.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc18466501acd8ac6a3f615dd29a3438f8ca6bb3b19537138b3106e575621274" +checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" dependencies = [ - "indexmap", + "indexmap 2.0.0", "toml_datetime", "winnow", ] @@ -2787,7 +2907,7 @@ checksum = "8f219fad3b929bef19b1f86fbc0358d35daed8f2cac972037ac0dc10bbb8d5fb" dependencies = [ "async-stream", "async-trait", - "axum 0.6.11", + "axum 0.6.20", "base64 0.13.1", "bytes", "futures-core", @@ -2821,7 +2941,7 @@ dependencies = [ "proc-macro2", "prost-build", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -2832,7 +2952,7 @@ checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" dependencies = [ "futures-core", "futures-util", - "indexmap", + "indexmap 1.9.3", "pin-project", "pin-project-lite", "rand", @@ -2850,7 +2970,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858" dependencies = [ - "bitflags", + "bitflags 1.3.2", "bytes", "futures-core", "futures-util", @@ -2865,11 +2985,11 @@ dependencies = [ [[package]] name = "tower-http" -version = "0.4.0" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d1d42a9b3f3ec46ba828e8d376aec14592ea199f70a06a548587ecd1c4ab658" +checksum = "55ae70283aba8d2a8b411c695c437fe25b8b5e44e23e780662002fc72fb47a82" dependencies = [ - "bitflags", + "bitflags 2.4.0", "bytes", "futures-core", "futures-util", @@ -2909,20 +3029,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", ] [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", "valuable", @@ -2951,9 +3071,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" +checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" dependencies = [ "matchers", "nu-ansi-term", @@ -3027,7 +3147,7 @@ checksum = "89851716b67b937e393b3daa8423e67ddfc4bbbf1654bcf05488e95e0828db0c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -3050,15 +3170,15 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.11" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524b68aca1d05e03fdf03fcdce2c6c94b6daf6d16861ddaa7e4f2b6638a9052c" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.8" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "unicode-normalization" @@ -3069,18 +3189,6 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-width" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" - -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - [[package]] name = "untrusted" version = "0.7.1" @@ -3089,20 +3197,20 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" dependencies = [ "form_urlencoded", - "idna 0.3.0", + "idna 0.4.0", "percent-encoding", ] [[package]] name = "uuid" -version = "1.3.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1674845326ee10d37ca60470760d4288a6f80f304007d92e5c53bab78c9cfd79" +checksum = "79daa5ed5740825c40b389c5e50312b9c86df53fccd33f281df655642b43869d" dependencies = [ "getrandom", "serde", @@ -3122,11 +3230,10 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log", "try-lock", ] @@ -3138,9 +3245,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -3148,24 +3255,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.28", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.34" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" dependencies = [ "cfg-if", "js-sys", @@ -3175,9 +3282,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3185,28 +3292,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.28", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.84" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "web-sys" -version = "0.3.61" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" dependencies = [ "js-sys", "wasm-bindgen", @@ -3244,9 +3351,9 @@ dependencies = [ [[package]] name = "widestring" -version = "0.5.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" +checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" [[package]] name = "winapi" @@ -3264,15 +3371,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -3280,34 +3378,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "windows-sys" -version = "0.42.0" +name = "windows" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows-targets", ] [[package]] name = "windows-sys" -version = "0.45.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ "windows-targets", ] [[package]] name = "windows-targets" -version = "0.42.2" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +checksum = "d1eeca1c172a285ee6c2c84c341ccea837e7c01b12fbb2d0fe3c9e550ce49ec8" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -3320,51 +3412,51 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.2" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +checksum = "b10d0c968ba7f6166195e13d593af609ec2e3d24f916f081690695cf5eaffb2f" [[package]] name = "windows_aarch64_msvc" -version = "0.42.2" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +checksum = "571d8d4e62f26d4932099a9efe89660e8bd5087775a2ab5cdd8b747b811f1058" [[package]] name = "windows_i686_gnu" -version = "0.42.2" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +checksum = "2229ad223e178db5fbbc8bd8d3835e51e566b8474bfca58d2e6150c48bb723cd" [[package]] name = "windows_i686_msvc" -version = "0.42.2" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +checksum = "600956e2d840c194eedfc5d18f8242bc2e17c7775b6684488af3a9fff6fe3287" [[package]] name = "windows_x86_64_gnu" -version = "0.42.2" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +checksum = "ea99ff3f8b49fb7a8e0d305e5aec485bd068c2ba691b6e277d29eaeac945868a" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.2" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +checksum = "8f1a05a1ece9a7a0d5a7ccf30ba2c33e3a61a30e042ffd247567d1de1d94120d" [[package]] name = "windows_x86_64_msvc" -version = "0.42.2" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +checksum = "d419259aba16b663966e29e6d7c6ecfa0bb8425818bb96f6f1f3c3eb71a6e7b9" [[package]] name = "winnow" -version = "0.3.6" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d020b441f92996c80d94ae9166e8501e59c7bb56121189dc9eab3bd8216966" +checksum = "5504cc7644f4b593cbc05c4a55bf9bd4e94b867c3c0bd440934174d50482427d" dependencies = [ "memchr", ] @@ -3378,6 +3470,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys", +] + [[package]] name = "wyz" version = "0.5.1" @@ -3389,27 +3491,26 @@ dependencies = [ [[package]] name = "yazi" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c03b3e19c937b5b9bd8e52b1c88f30cce5c0d33d676cf174866175bb794ff658" +checksum = "c94451ac9513335b5e23d7a8a2b61a7102398b8cca5160829d313e84c9d98be1" [[package]] name = "zeroize" -version = "1.5.7" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" +checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" dependencies = [ "zeroize_derive", ] [[package]] name = "zeroize_derive" -version = "1.3.3" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44bf07cb3e50ea2003396695d58bf46bc9887a1f362260446fad6bc4e79bd36c" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn", - "synstructure", + "syn 2.0.28", ] diff --git a/Cargo.toml b/Cargo.toml index c9e577932..940540374 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,7 @@ eyre = { version = "0.6", default-features = false, features = [ "track-caller", futures = { version = "0.3", default-features = false } humantime = { version = "2.1.0", default-features = false } humantime-serde = { version = "1.1", default-features = false } -iota-crypto = { version = "0.17", default-features = false, features = [ "blake2b" ] } +iota-crypto = { version = "0.23", default-features = false, features = [ "blake2b" ] } iota-types = { version = "1.0.0-rc.7", default-features = false, features = [ "api", "block", "std" ] } mongodb = { version = "2.4", default-features = false, features = [ "tokio-runtime" ] } packable = { version = "0.7", default-features = false } @@ -60,16 +60,16 @@ influxdb = { version = "0.5", default-features = false, features = [ "use-serde" auth-helper = { version = "0.3", default-features = false, optional = true } axum = { version = "0.5", default-features = false, features = [ "http1", "json", "query", "original-uri", "headers" ], optional = true } ed25519 = { version = "2.0", default-features = false, features = [ "alloc", "pkcs8", "pem" ], optional = true } -ed25519-dalek = { version = "1.0", default-features = false, features = [ "u64_backend" ], optional = true } +ed25519-dalek = { version = "2.0", default-features = false, features = [ "std", "fast", "zeroize" ], optional = true } hex = { version = "0.4", default-features = false, optional = true } hyper = { version = "0.14", default-features = false, features = [ "server", "tcp", "stream" ], optional = true } rand = { version = "0.8", default-features = false, features = [ "std" ], optional = true } regex = { version = "1.7", default-features = false, features = [ "std" ], optional = true } -rust-argon2 = { version = "1.0.0", default-features = false, optional = true } +rust-argon2 = { version = "2.0.0", default-features = false, optional = true } serde_urlencoded = { version = "0.7", default-features = false, optional = true } tower = { version = "0.4", default-features = false, optional = true } tower-http = { version = "0.4", default-features = false, features = [ "cors", "catch-panic", "trace" ], optional = true } -zeroize = { version = "1.5", default-features = false, features = [ "std" ], optional = true } +zeroize = { version = "1.5", default-features = false, features = [ "std", "zeroize_derive" ], optional = true } # INX inx = { version = "1.0.0-beta.8", default-features = false, optional = true } diff --git a/src/analytics/ledger/transaction_size.rs b/src/analytics/ledger/transaction_size.rs index 365746108..041acd9fc 100644 --- a/src/analytics/ledger/transaction_size.rs +++ b/src/analytics/ledger/transaction_size.rs @@ -40,7 +40,7 @@ impl TransactionSizeBuckets { /// Gets an enumerated iterator over the single buckets. pub(crate) fn single_buckets(&self) -> impl Iterator { - (1..8).zip(self.single.into_iter()) + (1..8).zip(self.single) } } diff --git a/src/bin/inx-chronicle/api/config.rs b/src/bin/inx-chronicle/api/config.rs index 3b3a451f4..9e8cfd21e 100644 --- a/src/bin/inx-chronicle/api/config.rs +++ b/src/bin/inx-chronicle/api/config.rs @@ -82,9 +82,7 @@ impl TryFrom for ApiConfigData { config.jwt_password.as_bytes(), config.jwt_salt.as_bytes(), &Into::into(&JwtArgonConfig::default()), - ) - // TODO: Replace this once we switch to a better error lib - .expect("invalid JWT config"), + )?, jwt_password_salt: config.jwt_salt, jwt_secret_key: match &config.jwt_identity_file { Some(path) => SecretKey::from_file(path)?, @@ -200,7 +198,6 @@ impl<'a> From<&'a JwtArgonConfig> for argon2::Config<'a> { lanes: val.parallelism, mem_cost: val.mem_cost, secret: &[], - thread_mode: Default::default(), time_cost: val.iterations, variant: val.variant, version: val.version, diff --git a/src/bin/inx-chronicle/api/error.rs b/src/bin/inx-chronicle/api/error.rs index 224803aee..84c9ff290 100644 --- a/src/bin/inx-chronicle/api/error.rs +++ b/src/bin/inx-chronicle/api/error.rs @@ -201,6 +201,8 @@ pub enum ConfigError { InvalidHex(#[from] hex::FromHexError), #[error("invalid regex in config: {0}")] InvalidRegex(#[from] regex::Error), + #[error("invalid JWT config: {0}")] + Jwt(#[from] argon2::Error), #[error("invalid secret key: {0}")] SecretKey(#[from] super::secret_key::SecretKeyError), } diff --git a/src/bin/inx-chronicle/api/secret_key.rs b/src/bin/inx-chronicle/api/secret_key.rs index ed14d7419..573756362 100644 --- a/src/bin/inx-chronicle/api/secret_key.rs +++ b/src/bin/inx-chronicle/api/secret_key.rs @@ -3,6 +3,7 @@ use ed25519::pkcs8::{DecodePrivateKey, KeypairBytes}; use thiserror::Error; +use zeroize::Zeroize; #[derive(Error, Debug)] pub enum SecretKeyError { @@ -15,19 +16,13 @@ pub enum SecretKeyError { } /// An Ed25519 secret key. +#[derive(Clone, Zeroize)] pub struct SecretKey(ed25519_dalek::SecretKey); /// View the bytes of the secret key. impl AsRef<[u8]> for SecretKey { fn as_ref(&self) -> &[u8] { - self.0.as_bytes() - } -} - -impl Clone for SecretKey { - fn clone(&self) -> SecretKey { - let mut sk_bytes = self.0.to_bytes(); - Self::from_bytes(&mut sk_bytes).expect("ed25519_dalek::SecretKey::from_bytes(to_bytes(k)) != k") + &self.0 } } @@ -39,28 +34,22 @@ impl std::fmt::Debug for SecretKey { impl SecretKey { /// Generate a new Ed25519 secret key. - pub fn generate() -> SecretKey { + pub fn generate() -> Self { use rand::RngCore; let mut bytes = [0u8; 32]; rand::thread_rng().fill_bytes(&mut bytes); - SecretKey(ed25519_dalek::SecretKey::from_bytes(&bytes).unwrap()) + Self::from_bytes(bytes) } - /// Create an Ed25519 secret key from a byte slice, zeroing the input on success. - /// If the bytes do not constitute a valid Ed25519 secret key, an error is - /// returned. - pub fn from_bytes(mut sk_bytes: impl AsMut<[u8]>) -> Result { - use zeroize::Zeroize; - let sk_bytes = sk_bytes.as_mut(); - let secret = ed25519_dalek::SecretKey::from_bytes(&*sk_bytes).map_err(SecretKeyError::Decode)?; - sk_bytes.zeroize(); - Ok(SecretKey(secret)) + /// Create an Ed25519 secret key from a 32 byte array. + pub fn from_bytes(sk_bytes: ed25519_dalek::SecretKey) -> Self { + Self(sk_bytes) } /// Create an Ed25519 secret key from a PEM file. - pub fn from_file(path: &str) -> Result { - let mut bytes = KeypairBytes::from_pkcs8_pem(&std::fs::read_to_string(std::path::Path::new(path))?) + pub fn from_file(path: &str) -> Result { + let bytes = KeypairBytes::from_pkcs8_pem(&std::fs::read_to_string(std::path::Path::new(path))?) .map_err(|_| SecretKeyError::Read)?; - SecretKey::from_bytes(&mut bytes.secret_key) + Ok(Self(bytes.secret_key)) } } diff --git a/src/model/mod.rs b/src/model/mod.rs index b2b8630d2..5a12cdf86 100644 --- a/src/model/mod.rs +++ b/src/model/mod.rs @@ -17,6 +17,7 @@ pub use util::*; pub mod utxo { //! A logical grouping of UTXO types for convenience. + #![allow(ambiguous_glob_reexports)] pub use super::block::payload::transaction::{ input::*, output::{address::*, unlock_condition::*, *}, From 425d1864fc965f85d85a18c830ffc4e6ee18ee77 Mon Sep 17 00:00:00 2001 From: Alex Coats Date: Tue, 15 Aug 2023 10:35:17 -0400 Subject: [PATCH 2/7] Use iota-sdk --- Cargo.lock | 887 +++++++++++++++--- Cargo.toml | 16 +- src/analytics/ledger/ledger_size.rs | 13 +- src/analytics/ledger/mod.rs | 27 +- src/analytics/mod.rs | 2 +- src/analytics/tangle/mod.rs | 4 +- src/bin/inx-chronicle/api/core/responses.rs | 8 +- src/bin/inx-chronicle/api/core/routes.rs | 132 +-- src/bin/inx-chronicle/api/error.rs | 4 +- src/bin/inx-chronicle/api/explorer/routes.rs | 16 +- src/bin/inx-chronicle/api/poi/error.rs | 2 +- src/bin/inx-chronicle/api/poi/merkle_proof.rs | 2 +- src/bin/inx-chronicle/api/poi/responses.rs | 2 +- src/bin/inx-chronicle/api/poi/routes.rs | 13 +- src/bin/inx-chronicle/api/secret_key.rs | 19 +- src/db/mongodb/collections/block.rs | 8 +- .../collections/outputs/indexer/alias.rs | 2 +- src/inx/block.rs | 2 +- src/inx/ledger.rs | 2 +- src/inx/milestone.rs | 2 +- src/inx/node/config.rs | 2 +- src/inx/protocol.rs | 2 +- src/inx/raw.rs | 26 +- src/model/block/metadata/conflict_reason.rs | 2 +- src/model/block/metadata/inclusion_state.rs | 14 +- src/model/block/mod.rs | 47 +- .../block/payload/milestone/milestone_id.rs | 6 +- .../payload/milestone/milestone_index.rs | 2 +- src/model/block/payload/milestone/mod.rs | 52 +- src/model/block/payload/mod.rs | 38 +- src/model/block/payload/tagged_data.rs | 12 +- src/model/block/payload/transaction/input.rs | 6 +- src/model/block/payload/transaction/mod.rs | 59 +- .../transaction/output/address/alias.rs | 6 +- .../transaction/output/address/ed25519.rs | 6 +- .../payload/transaction/output/address/mod.rs | 6 +- .../payload/transaction/output/address/nft.rs | 6 +- .../block/payload/transaction/output/alias.rs | 73 +- .../block/payload/transaction/output/basic.rs | 39 +- .../payload/transaction/output/feature.rs | 20 +- .../payload/transaction/output/foundry.rs | 48 +- .../payload/transaction/output/ledger.rs | 21 +- .../block/payload/transaction/output/mod.rs | 62 +- .../transaction/output/native_token.rs | 39 +- .../block/payload/transaction/output/nft.rs | 51 +- .../payload/transaction/output/treasury.rs | 12 +- .../output/unlock_condition/address.rs | 4 +- .../output/unlock_condition/expiration.rs | 8 +- .../unlock_condition/governor_address.rs | 4 +- .../immutable_alias_address.rs | 6 +- .../output/unlock_condition/mod.rs | 2 +- .../state_controller_address.rs | 4 +- .../storage_deposit_return.rs | 10 +- .../output/unlock_condition/timelock.rs | 6 +- src/model/block/payload/transaction/unlock.rs | 10 +- .../block/payload/treasury_transaction.rs | 32 +- src/model/protocol.rs | 15 +- src/model/signature.rs | 38 +- src/model/util/context.rs | 11 +- src/tangle/sources/inx.rs | 2 +- tests/blocks.rs | 16 +- tests/ledger_updates.rs | 8 +- tests/milestones.rs | 2 +- tests/outputs.rs | 2 +- tests/protocol_updates.rs | 6 +- tests/treasury_updates.rs | 4 +- 66 files changed, 1343 insertions(+), 667 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3fbacc304..554de2aa8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,41 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "aead" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" +dependencies = [ + "crypto-common", + "generic-array", +] + +[[package]] +name = "aes" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "aes-gcm" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "209b47e8954a928e1d72e86eca7000ebb6655fe1436d33eefc2201cad027e237" +dependencies = [ + "aead", + "aes", + "cipher", + "ctr", + "ghash", + "subtle", +] + [[package]] name = "ahash" version = "0.7.6" @@ -48,6 +83,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -128,7 +169,7 @@ checksum = "1569e82073f20324826e6445ae9924d57bd7b3ae8936307b35c0f96af32d66ea" dependencies = [ "jsonwebtoken", "rand", - "rust-argon2 1.0.1", + "rust-argon2 1.0.0", "serde", "thiserror", ] @@ -247,6 +288,12 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + [[package]] name = "base64" version = "0.13.1" @@ -326,18 +373,18 @@ dependencies = [ [[package]] name = "block-buffer" -version = "0.9.0" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" dependencies = [ "generic-array", ] [[package]] -name = "block-buffer" -version = "0.10.4" +name = "block-padding" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93" dependencies = [ "generic-array", ] @@ -414,6 +461,30 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "chacha20" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", +] + +[[package]] +name = "chacha20poly1305" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" +dependencies = [ + "aead", + "chacha20", + "cipher", + "poly1305", + "zeroize", +] + [[package]] name = "chronicle" version = "1.0.0-rc.1" @@ -428,8 +499,7 @@ dependencies = [ "decimal", "derive_more", "dotenvy", - "ed25519", - "ed25519-dalek", + "ed25519-zebra", "eyre", "futures", "hex", @@ -438,12 +508,12 @@ dependencies = [ "hyper", "influxdb", "inx", - "iota-crypto 0.23.0", - "iota-types", + "iota-crypto", + "iota-sdk", "mongodb", "packable", "pin-project", - "prefix-hex 0.7.1", + "prefix-hex", "primitive-types", "rand", "regex", @@ -482,6 +552,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", + "zeroize", +] + [[package]] name = "clap" version = "4.3.21" @@ -528,6 +609,12 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + [[package]] name = "constant_time_eq" version = "0.2.6" @@ -561,12 +648,33 @@ dependencies = [ "libc", ] +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if", +] + [[package]] name = "crunchy" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-bigint" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4c2f4e1afd912bc40bfd6fed5d9dc1f288e0ba01bfcc835cc5bc3eb13efe15" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -577,6 +685,15 @@ dependencies = [ "typenum", ] +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher", +] + [[package]] name = "curve25519-dalek" version = "3.2.0" @@ -592,9 +709,9 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "4.0.0" +version = "4.0.0-rc.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f711ade317dd348950a9910f81c5947e3d8907ebd2b83f76203ff1807e6a2bc2" +checksum = "436ace70fc06e06f7f689d2624dc4e2f0ea666efb5aa704215f7249ae6e047a7" dependencies = [ "cfg-if", "cpufeatures", @@ -624,8 +741,18 @@ version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" dependencies = [ - "darling_core", - "darling_macro", + "darling_core 0.13.4", + "darling_macro 0.13.4", +] + +[[package]] +name = "darling" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850" +dependencies = [ + "darling_core 0.14.4", + "darling_macro 0.14.4", ] [[package]] @@ -642,13 +769,38 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "darling_core" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", +] + [[package]] name = "darling_macro" version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" dependencies = [ - "darling_core", + "darling_core 0.13.4", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e" +dependencies = [ + "darling_core 0.14.4", "quote", "syn 1.0.109", ] @@ -702,6 +854,37 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive_builder" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f" +dependencies = [ + "darling 0.14.4", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_builder_macro" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e" +dependencies = [ + "derive_builder_core", + "syn 1.0.109", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -730,11 +913,53 @@ version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ - "block-buffer 0.10.4", + "block-buffer", + "const-oid", "crypto-common", "subtle", ] +[[package]] +name = "dirs" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + [[package]] name = "dotenvy" version = "0.15.7" @@ -742,39 +967,46 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" [[package]] -name = "ed25519" -version = "2.2.2" +name = "ecdsa" +version = "0.16.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d" +checksum = "a4b1e0c257a9e9f25f90ff76d7a68360ed497ee519c8e428d1825ef0000799d4" dependencies = [ - "pkcs8", + "der", + "digest 0.10.7", + "elliptic-curve", + "rfc6979", + "serdect", "signature", + "spki", ] [[package]] -name = "ed25519-dalek" -version = "2.0.0" +name = "ed25519" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" +checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d" dependencies = [ - "curve25519-dalek 4.0.0", - "ed25519", + "pkcs8", "serde", - "sha2 0.10.7", - "zeroize", + "signature", ] [[package]] name = "ed25519-zebra" -version = "3.1.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" +checksum = "ffb0d653b2c06ec7ec1b4c570bb4eac748035d6f44dd14e5fd9e7e2549938488" dependencies = [ - "curve25519-dalek 3.2.0", - "hashbrown 0.12.3", + "curve25519-dalek 4.0.0-rc.3", + "der", + "ed25519", + "hashbrown 0.14.0", "hex", + "pkcs8", "rand_core 0.6.4", - "sha2 0.9.9", + "serde", + "sha2", "zeroize", ] @@ -784,6 +1016,27 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +[[package]] +name = "elliptic-curve" +version = "0.13.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest 0.10.7", + "ff", + "generic-array", + "group", + "pem-rfc7468", + "pkcs8", + "rand_core 0.6.4", + "sec1", + "serdect", + "subtle", + "zeroize", +] + [[package]] name = "encoding_rs" version = "0.8.32" @@ -848,6 +1101,16 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "fiat-crypto" version = "0.1.20" @@ -988,6 +1251,7 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] @@ -997,8 +1261,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi", + "wasm-bindgen", ] [[package]] @@ -1013,12 +1279,45 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ghash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d930750de5717d2dd0b8c0d42c076c0e884c81a73e6cab859bbd2339c71e3e40" +dependencies = [ + "opaque-debug", + "polyval", +] + [[package]] name = "gimli" version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +[[package]] +name = "gloo-timers" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" +dependencies = [ + "futures-channel", + "futures-core", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "h2" version = "0.3.20" @@ -1043,26 +1342,18 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.6", -] [[package]] name = "hashbrown" -version = "0.13.2" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" dependencies = [ "ahash 0.8.3", + "allocator-api2", "serde", ] -[[package]] -name = "hashbrown" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" - [[package]] name = "headers" version = "0.3.8" @@ -1106,6 +1397,15 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hkdf" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791a029f6b9fc27657f6f188ec6e5e43f6911f6f878e0dc5501396e09809d437" +dependencies = [ + "hmac", +] + [[package]] name = "hmac" version = "0.12.1" @@ -1243,7 +1543,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows", + "windows 0.48.0", ] [[package]] @@ -1366,6 +1666,16 @@ dependencies = [ "syn 2.0.28", ] +[[package]] +name = "inout" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" +dependencies = [ + "block-padding", + "generic-array", +] + [[package]] name = "inx" version = "1.0.0-beta.8" @@ -1390,52 +1700,87 @@ dependencies = [ [[package]] name = "iota-crypto" -version = "0.15.3" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e04d492224bff6e97142f033d0a4383bcbc05918be1ff7b3abd2c1cc85205a2" +checksum = "c5d5a986d972c3a703d48ced24fdc0bf16fb2d02959ff4b152fa77b9132f6fb0" dependencies = [ + "aead", + "aes", + "aes-gcm", "autocfg", + "base64 0.21.2", "blake2", + "chacha20poly1305", + "cipher", + "curve25519-dalek 3.2.0", "digest 0.10.7", "ed25519-zebra", + "generic-array", + "getrandom", + "hkdf", + "hmac", + "iterator-sorted", + "k256", "num-traits", + "pbkdf2 0.12.2", + "rand", + "scrypt", "serde", + "sha2", + "tiny-keccak", + "unicode-normalization", + "x25519-dalek", + "zeroize", ] [[package]] -name = "iota-crypto" -version = "0.23.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5d5a986d972c3a703d48ced24fdc0bf16fb2d02959ff4b152fa77b9132f6fb0" -dependencies = [ - "autocfg", - "blake2", - "digest 0.10.7", -] - -[[package]] -name = "iota-types" -version = "1.0.0-rc.7" +name = "iota-sdk" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31d51adb91478d259bcb6fb242db62d075e3a800adaaaa5bdce3d7ce75557b52" +checksum = "9b0b2dbcf4bc51d89a0f5c6a43ea390c38856907c8f8bbfe8c8744f5d15fdf7d" dependencies = [ "bech32", - "bitflags 1.3.2", + "bitflags 2.4.0", "bytemuck", + "derive_builder", "derive_more", "getset", - "hashbrown 0.13.2", + "gloo-timers", + "hashbrown 0.14.0", "hex", - "iota-crypto 0.15.3", + "iota-crypto", + "iota_stronghold", "iterator-sorted", + "itertools 0.11.0", + "lazy_static", + "once_cell", "packable", - "prefix-hex 0.5.0", + "prefix-hex", "primitive-types", "rand", + "regex", "serde", - "serde-big-array", "serde_json", "serde_repr", + "zeroize", +] + +[[package]] +name = "iota_stronghold" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04436fca4c5e566318aa3da37b97cd833d1f2f794a2fe373b05a85b68454a212" +dependencies = [ + "bincode", + "hkdf", + "iota-crypto", + "rust-argon2 1.0.0", + "serde", + "stronghold-derive", + "stronghold-utils", + "stronghold_engine", + "thiserror", + "zeroize", ] [[package]] @@ -1464,9 +1809,18 @@ checksum = "d101775d2bc8f99f4ac18bf29b9ed70c0dd138b9a1e88d7b80179470cbbe8bd2" [[package]] name = "itertools" -version = "0.10.5" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" dependencies = [ "either", ] @@ -1498,6 +1852,20 @@ dependencies = [ "serde_json", ] +[[package]] +name = "k256" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "once_cell", + "serdect", + "sha2", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -1510,6 +1878,18 @@ version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +[[package]] +name = "libsodium-sys" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b779387cd56adfbc02ea4a668e704f729be8d6a6abd2c27ca5ee537849a92fd" +dependencies = [ + "cc", + "libc", + "pkg-config", + "walkdir", +] + [[package]] name = "linked-hash-map" version = "0.5.6" @@ -1601,6 +1981,15 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + [[package]] name = "mime" version = "0.3.17" @@ -1648,7 +2037,7 @@ dependencies = [ "hmac", "lazy_static", "md-5", - "pbkdf2", + "pbkdf2 0.11.0", "percent-encoding", "rand", "rustc_version_runtime", @@ -1658,7 +2047,7 @@ dependencies = [ "serde_bytes", "serde_with", "sha-1", - "sha2 0.10.7", + "sha2", "socket2 0.4.9", "stringprep", "strsim", @@ -1680,6 +2069,18 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" +[[package]] +name = "nix" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" +dependencies = [ + "bitflags 1.3.2", + "cfg-if", + "libc", + "memoffset", +] + [[package]] name = "nu-ansi-term" version = "0.46.0" @@ -1747,9 +2148,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "packable" -version = "0.7.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8013e43f83d46fba11c27e96b3c9d152614e085756fad393c1501cc3ecc0cd5" +checksum = "eac6939609218dd61191d0ec495e00c9eac5c80f29986775be1f62bfae69dee3" dependencies = [ "autocfg", "packable-derive", @@ -1814,11 +2215,17 @@ checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.3.5", "smallvec", "windows-targets", ] +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + [[package]] name = "pbkdf2" version = "0.11.0" @@ -1828,6 +2235,16 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "pbkdf2" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" +dependencies = [ + "digest 0.10.7", + "hmac", +] + [[package]] name = "pem-rfc7468" version = "0.7.0" @@ -1895,6 +2312,12 @@ dependencies = [ "spki", ] +[[package]] +name = "pkg-config" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" + [[package]] name = "platforms" version = "3.0.2" @@ -1902,22 +2325,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" [[package]] -name = "ppv-lite86" -version = "0.2.17" +name = "poly1305" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" +dependencies = [ + "cpufeatures", + "opaque-debug", + "universal-hash", +] [[package]] -name = "prefix-hex" -version = "0.5.0" +name = "polyval" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75e3396888185b76a6e4c8fc883b3f039e56d3c0bca279744d2df70b3662e784" +checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" dependencies = [ - "hex", - "primitive-types", - "uint", + "cfg-if", + "cpufeatures", + "opaque-debug", + "universal-hash", ] +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + [[package]] name = "prefix-hex" version = "0.7.1" @@ -2012,7 +2447,7 @@ checksum = "119533552c9a7ffacc21e099c24a0ac8bb19c2a2a3f363de84cd9b844feab270" dependencies = [ "bytes", "heck", - "itertools", + "itertools 0.10.5", "lazy_static", "log", "multimap", @@ -2033,7 +2468,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" dependencies = [ "anyhow", - "itertools", + "itertools 0.10.5", "proc-macro2", "quote", "syn 1.0.109", @@ -2105,6 +2540,15 @@ dependencies = [ "getrandom", ] +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "redox_syscall" version = "0.3.5" @@ -2114,6 +2558,17 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_users" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +dependencies = [ + "getrandom", + "redox_syscall 0.2.16", + "thiserror", +] + [[package]] name = "regex" version = "1.9.3" @@ -2207,6 +2662,16 @@ dependencies = [ "quick-error", ] +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + [[package]] name = "ring" version = "0.16.20" @@ -2235,13 +2700,14 @@ dependencies = [ [[package]] name = "rust-argon2" -version = "1.0.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5885493fdf0be6cdff808d1533ce878d21cfa49c7086fa00c66355cd9141bfc" +checksum = "b50162d19404029c1ceca6f6980fe40d45c8b369f6f44446fa14bb39573b5bb9" dependencies = [ - "base64 0.21.2", + "base64 0.13.1", "blake2b_simd", - "constant_time_eq 0.3.0", + "constant_time_eq 0.1.5", + "crossbeam-utils", ] [[package]] @@ -2377,12 +2843,41 @@ version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +[[package]] +name = "salsa20" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" +dependencies = [ + "cipher", +] + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "scopeguard" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "scrypt" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0516a385866c09368f0b5bcd1caff3366aace790fcd46e2bb032697bb172fd1f" +dependencies = [ + "pbkdf2 0.12.2", + "salsa20", + "sha2", +] + [[package]] name = "sct" version = "0.7.0" @@ -2393,6 +2888,21 @@ dependencies = [ "untrusted", ] +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "serdect", + "subtle", + "zeroize", +] + [[package]] name = "semver" version = "0.9.0" @@ -2423,15 +2933,6 @@ dependencies = [ "serde_derive", ] -[[package]] -name = "serde-big-array" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11fc7cc2c76d73e0f27ee52abbd64eec84d46f370c88371120433196934e4b7f" -dependencies = [ - "serde", -] - [[package]] name = "serde_bytes" version = "0.11.12" @@ -2503,12 +3004,22 @@ version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" dependencies = [ - "darling", + "darling 0.13.4", "proc-macro2", "quote", "syn 1.0.109", ] +[[package]] +name = "serdect" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a84f14a19e9a014bb9f4512488d9829a68e04ecabffb0f9904cd1ace94598177" +dependencies = [ + "base16ct", + "serde", +] + [[package]] name = "sha-1" version = "0.10.1" @@ -2531,19 +3042,6 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "sha2" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures", - "digest 0.9.0", - "opaque-debug", -] - [[package]] name = "sha2" version = "0.10.7" @@ -2578,6 +3076,10 @@ name = "signature" version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" +dependencies = [ + "digest 0.10.7", + "rand_core 0.6.4", +] [[package]] name = "slab" @@ -2646,6 +3148,64 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "stronghold-derive" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2835db23c4724c05a2f85b81c4681f4aa8ea158edc8a7f4ad791c916fb766c2e" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "stronghold-runtime" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d20d73c3c41bdfcfa4e223cd6636111723081ef097a8d90354a9846b3bd60ede" +dependencies = [ + "dirs", + "iota-crypto", + "libc", + "libsodium-sys", + "log", + "nix", + "rand", + "serde", + "thiserror", + "windows 0.36.1", + "zeroize", +] + +[[package]] +name = "stronghold-utils" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8300214898af5e153e7f66e49dbd1c6a21585f2d592d9f24f58b969792475ed6" +dependencies = [ + "rand", + "stronghold-derive", +] + +[[package]] +name = "stronghold_engine" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ad9c397e3215857f4f8bd2bd2a5b90c6332d0077d8fb4b6ba61b27b544647ca" +dependencies = [ + "anyhow", + "dirs-next", + "hex", + "iota-crypto", + "once_cell", + "paste", + "serde", + "stronghold-runtime", + "thiserror", + "zeroize", +] + [[package]] name = "strsim" version = "0.10.0" @@ -2706,7 +3266,7 @@ checksum = "dc02fddf48964c42031a0b3fe0428320ecf3a73c401040fc0096f97794310651" dependencies = [ "cfg-if", "fastrand", - "redox_syscall", + "redox_syscall 0.3.5", "rustix 0.38.8", "windows-sys", ] @@ -2781,6 +3341,15 @@ dependencies = [ "time-core", ] +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -3189,6 +3758,16 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "universal-hash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" +dependencies = [ + "crypto-common", + "subtle", +] + [[package]] name = "untrusted" version = "0.7.1" @@ -3228,6 +3807,16 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "walkdir" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +dependencies = [ + "same-file", + "winapi-util", +] + [[package]] name = "want" version = "0.3.1" @@ -3371,12 +3960,34 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e53b97a83176b369b0eb2fd8158d4ae215357d02df9d40c1e1bf1879c5482c80" +dependencies = [ + "windows_aarch64_msvc 0.36.1", + "windows_i686_gnu 0.36.1", + "windows_i686_msvc 0.36.1", + "windows_x86_64_gnu 0.36.1", + "windows_x86_64_msvc 0.36.1", +] + [[package]] name = "windows" version = "0.48.0" @@ -3402,12 +4013,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d1eeca1c172a285ee6c2c84c341ccea837e7c01b12fbb2d0fe3c9e550ce49ec8" dependencies = [ "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", + "windows_aarch64_msvc 0.48.2", + "windows_i686_gnu 0.48.2", + "windows_i686_msvc 0.48.2", + "windows_x86_64_gnu 0.48.2", "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_x86_64_msvc 0.48.2", ] [[package]] @@ -3416,24 +4027,48 @@ version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b10d0c968ba7f6166195e13d593af609ec2e3d24f916f081690695cf5eaffb2f" +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + [[package]] name = "windows_aarch64_msvc" version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "571d8d4e62f26d4932099a9efe89660e8bd5087775a2ab5cdd8b747b811f1058" +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + [[package]] name = "windows_i686_gnu" version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2229ad223e178db5fbbc8bd8d3835e51e566b8474bfca58d2e6150c48bb723cd" +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + [[package]] name = "windows_i686_msvc" version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "600956e2d840c194eedfc5d18f8242bc2e17c7775b6684488af3a9fff6fe3287" +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + [[package]] name = "windows_x86_64_gnu" version = "0.48.2" @@ -3446,6 +4081,12 @@ version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f1a05a1ece9a7a0d5a7ccf30ba2c33e3a61a30e042ffd247567d1de1d94120d" +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" + [[package]] name = "windows_x86_64_msvc" version = "0.48.2" @@ -3489,6 +4130,17 @@ dependencies = [ "tap", ] +[[package]] +name = "x25519-dalek" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a0c105152107e3b96f6a00a65e86ce82d9b125230e1c4302940eca58ff71f4f" +dependencies = [ + "curve25519-dalek 3.2.0", + "rand_core 0.5.1", + "zeroize", +] + [[package]] name = "yazi" version = "0.1.6" @@ -3501,6 +4153,7 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" dependencies = [ + "serde", "zeroize_derive", ] diff --git a/Cargo.toml b/Cargo.toml index 940540374..24949c8bf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,10 +32,10 @@ eyre = { version = "0.6", default-features = false, features = [ "track-caller", futures = { version = "0.3", default-features = false } humantime = { version = "2.1.0", default-features = false } humantime-serde = { version = "1.1", default-features = false } -iota-crypto = { version = "0.23", default-features = false, features = [ "blake2b" ] } -iota-types = { version = "1.0.0-rc.7", default-features = false, features = [ "api", "block", "std" ] } +iota-crypto = { version = "0.23", default-features = false, features = [ "blake2b", "ed25519", "slip10", "bip39-en" ] } +iota-sdk = { version = "1.0", default-features = false, features = [ "std", "serde" ] } mongodb = { version = "2.4", default-features = false, features = [ "tokio-runtime" ] } -packable = { version = "0.7", default-features = false } +packable = { version = "0.8", default-features = false } pin-project = { version = "1.0", default-features = false } prefix-hex = { version = "0.7.0", default-features = false, features = [ "primitive-types", "std" ] } primitive-types = { version = "0.12", default-features = false } @@ -59,8 +59,7 @@ influxdb = { version = "0.5", default-features = false, features = [ "use-serde" # API auth-helper = { version = "0.3", default-features = false, optional = true } axum = { version = "0.5", default-features = false, features = [ "http1", "json", "query", "original-uri", "headers" ], optional = true } -ed25519 = { version = "2.0", default-features = false, features = [ "alloc", "pkcs8", "pem" ], optional = true } -ed25519-dalek = { version = "2.0", default-features = false, features = [ "std", "fast", "zeroize" ], optional = true } +ed25519-zebra = { version = "4.0", default-features = false, features = [ "std", "pkcs8", "pem" ], optional = true } hex = { version = "0.4", default-features = false, optional = true } hyper = { version = "0.14", default-features = false, features = [ "server", "tcp", "stream" ], optional = true } rand = { version = "0.8", default-features = false, features = [ "std" ], optional = true } @@ -77,7 +76,7 @@ tonic = { version = "0.8", default-features = false, optional = true } [dev-dependencies] bincode = { version = "1.3", default-features = false } -iota-types = { version = "1.0.0-rc.7", default-features = false, features = [ "api", "block", "std", "rand" ] } +iota-sdk = { version = "1.0", default-features = false, features = [ "std", "serde", "rand" ] } rand = { version = "0.8", default-features = false, features = [ "std" ] } ron = { version = "0.8", default-features = false } yazi = { version = "0.1", default-features = false } @@ -96,8 +95,7 @@ analytics = [ api = [ "dep:auth-helper", "dep:axum", - "dep:ed25519", - "dep:ed25519-dalek", + "dep:ed25519-zebra", "dep:hex", "derive_more/from", "dep:hyper", @@ -124,7 +122,7 @@ poi = [ "api", ] rand = [ - "iota-types/rand", + "iota-sdk/rand", ] [profile.production] diff --git a/src/analytics/ledger/ledger_size.rs b/src/analytics/ledger/ledger_size.rs index b99b69f2d..6d9adb7d1 100644 --- a/src/analytics/ledger/ledger_size.rs +++ b/src/analytics/ledger/ledger_size.rs @@ -1,6 +1,8 @@ // Copyright 2023 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 +use iota_sdk::types::block::output::Rent; + use super::*; use crate::model::{ledger::RentStructureBytes, ProtocolParameters, TryFromWithContext}; @@ -11,16 +13,13 @@ trait LedgerSize { impl LedgerSize for Output { fn ledger_size(&self, protocol_params: &ProtocolParameters) -> LedgerSizeMeasurement { // Unwrap: acceptable risk - let protocol_params = iota_types::block::protocol::ProtocolParameters::try_from(protocol_params.clone()) + let protocol_params = iota_sdk::types::block::protocol::ProtocolParameters::try_from(protocol_params.clone()) .expect("protocol parameters conversion error"); - let output = iota_types::block::output::Output::try_from_with_context(&protocol_params, self.clone()).unwrap(); + let output = + iota_sdk::types::block::output::Output::try_from_with_context(&protocol_params, self.clone()).unwrap(); let rent_bytes = RentStructureBytes::compute(&output); LedgerSizeMeasurement { - total_storage_deposit_amount: iota_types::block::output::Rent::rent_cost( - &output, - protocol_params.rent_structure(), - ) - .into(), + total_storage_deposit_amount: Rent::rent_cost(&output, protocol_params.rent_structure()).into(), total_key_bytes: rent_bytes.num_key_bytes, total_data_bytes: rent_bytes.num_data_bytes, } diff --git a/src/analytics/ledger/mod.rs b/src/analytics/ledger/mod.rs index 1a6131024..b8529fd81 100644 --- a/src/analytics/ledger/mod.rs +++ b/src/analytics/ledger/mod.rs @@ -80,14 +80,14 @@ mod test { fn rand_output_with_amount(amount: TokenAmount) -> Output { // We use `BasicOutput`s in the genesis. - let mut output = BasicOutput::rand(&iota_types::block::protocol::protocol_parameters()); + let mut output = BasicOutput::rand(&iota_sdk::types::block::protocol::protocol_parameters()); output.amount = amount; Output::Basic(output) } #[test] fn test_claiming() { - let protocol_params = iota_types::block::protocol::protocol_parameters(); + let protocol_params = iota_sdk::types::block::protocol::protocol_parameters(); // All the unclaimed tokens let ledger_state = (1u32..=5) @@ -170,7 +170,7 @@ mod test { #[test] fn test_alias_output_activity() { - let protocol_params = iota_types::block::protocol::protocol_parameters(); + let protocol_params = iota_sdk::types::block::protocol::protocol_parameters(); // The id of the spending transaction. let transaction_id = TransactionId::rand(); @@ -275,7 +275,7 @@ mod test { #[test] fn test_nft_output_activity() { - let protocol_params = iota_types::block::protocol::protocol_parameters(); + let protocol_params = iota_sdk::types::block::protocol::protocol_parameters(); // The id of the spending transaction. let transaction_id = TransactionId::rand(); @@ -434,28 +434,23 @@ mod test { assert_eq!(output_activity_measurement.nft.destroyed_count, 0); } - fn rand_output_with_address_and_amount( - address: Address, - amount: u64, - ctx: &iota_types::block::protocol::ProtocolParameters, - ) -> Output { - use iota_types::block::{ + fn rand_output_with_address_and_amount(address: Address, amount: u64) -> Output { + use iota_sdk::types::block::{ address::Address, output::{unlock_condition::AddressUnlockCondition, BasicOutput}, rand::output::feature::rand_allowed_features, }; let output = BasicOutput::build_with_amount(amount) - .unwrap() .with_features(rand_allowed_features(BasicOutput::ALLOWED_FEATURES)) - .add_unlock_condition(AddressUnlockCondition::from(Address::from(address)).into()) - .finish(ctx.token_supply()) + .add_unlock_condition(AddressUnlockCondition::from(Address::from(address))) + .finish() .unwrap(); Output::Basic(output.into()) } #[test] fn test_base_tokens() { - let protocol_params = iota_types::block::protocol::protocol_parameters(); + let protocol_params = iota_sdk::types::block::protocol::protocol_parameters(); let address_1 = Address::rand_ed25519(); let address_2 = Address::rand_ed25519(); @@ -483,7 +478,7 @@ mod test { num_key_bytes: 0, num_data_bytes: 100, }, - output: rand_output_with_address_and_amount(address, amount, &protocol_params), + output: rand_output_with_address_and_amount(address, amount), block_id: BlockId::rand(), booked: milestone, }) @@ -495,7 +490,7 @@ mod test { num_key_bytes: 0, num_data_bytes: 100, }, - output: rand_output_with_address_and_amount(address, amount, &protocol_params), + output: rand_output_with_address_and_amount(address, amount), block_id: BlockId::rand(), booked: milestone, }; diff --git a/src/analytics/mod.rs b/src/analytics/mod.rs index 98c986a07..d28e2613c 100644 --- a/src/analytics/mod.rs +++ b/src/analytics/mod.rs @@ -675,7 +675,7 @@ mod test { fn from(value: BsonBlockData) -> Self { Self { block_id: value.block_id, - block: iota_types::block::Block::unpack_unverified(value.raw.clone()) + block: iota_sdk::types::block::Block::unpack_unverified(value.raw.clone()) .unwrap() .into(), raw: value.raw, diff --git a/src/analytics/tangle/mod.rs b/src/analytics/tangle/mod.rs index 9c429f97f..59a8d52d6 100644 --- a/src/analytics/tangle/mod.rs +++ b/src/analytics/tangle/mod.rs @@ -32,7 +32,7 @@ mod test { #[test] fn test_block_analytics() { - let protocol_params = iota_types::block::protocol::protocol_parameters(); + let protocol_params = iota_sdk::types::block::protocol::protocol_parameters(); let blocks = vec![ Block::rand_treasury_transaction(&protocol_params), @@ -48,7 +48,7 @@ mod test { BlockData { block_id: BlockId::rand(), block, - raw: iota_types::block::rand::bytes::rand_bytes((i + 1) * 100), + raw: iota_sdk::types::block::rand::bytes::rand_bytes((i + 1) * 100), metadata: BlockMetadata { parents, is_solid: true, diff --git a/src/bin/inx-chronicle/api/core/responses.rs b/src/bin/inx-chronicle/api/core/responses.rs index a24176521..d93790b94 100644 --- a/src/bin/inx-chronicle/api/core/responses.rs +++ b/src/bin/inx-chronicle/api/core/responses.rs @@ -1,7 +1,7 @@ // Copyright 2022 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -use iota_types::{api::core::response as iota, block::protocol::dto::ProtocolParametersDto}; +use iota_sdk::types::{api::core::response as iota, block::protocol::ProtocolParameters}; use serde::{Deserialize, Serialize}; use crate::api::responses::impl_success_response; @@ -13,14 +13,14 @@ pub struct InfoResponse { pub name: String, pub version: String, pub status: iota::StatusResponse, - pub protocol: ProtocolParametersDto, + pub protocol: ProtocolParameters, pub base_token: iota::BaseTokenResponse, } impl_success_response!(InfoResponse); /// A wrapper struct that allows us to implement [`IntoResponse`](axum::response::IntoResponse) for the foreign -/// responses from [`iota_types`](iota_types::api::core::response). +/// responses from [`iota_types`](iota_sdk::types::api::core::response). #[derive(Clone, Debug, Serialize, derive_more::From)] pub struct IotaResponse(T); @@ -31,7 +31,7 @@ impl axum::response::IntoResponse for IotaResponse { } /// A wrapper struct that allows us to implement [`IntoResponse`](axum::response::IntoResponse) for the foreign -/// raw responses from [`iota_types`](iota_types::api::core::response). +/// raw responses from [`iota_types`](iota_sdk::types::api::core::response). #[derive(Clone, Debug, Serialize, Deserialize)] #[serde(untagged)] pub enum IotaRawResponse { diff --git a/src/bin/inx-chronicle/api/core/routes.rs b/src/bin/inx-chronicle/api/core/routes.rs index e694c0ab7..bc5166e28 100644 --- a/src/bin/inx-chronicle/api/core/routes.rs +++ b/src/bin/inx-chronicle/api/core/routes.rs @@ -27,19 +27,16 @@ use chronicle::{ }, }; use futures::TryStreamExt; -use iota_types::{ - api::core::{ - dto::ReceiptDto, - response::{ - self as iota, BaseTokenResponse, BlockMetadataResponse, ConfirmedMilestoneResponse, - LatestMilestoneResponse, OutputWithMetadataResponse, ReceiptsResponse, StatusResponse, TreasuryResponse, - UtxoChangesResponse, - }, +use iota_sdk::types::{ + api::core::response::{ + self as iota, BaseTokenResponse, BlockMetadataResponse, ConfirmedMilestoneResponse, LatestMilestoneResponse, + OutputWithMetadataResponse, ReceiptResponse, ReceiptsResponse, StatusResponse, TreasuryResponse, + UtxoChangesResponse, }, block::{ - output::dto::{OutputMetadataDto, RentStructureDto}, + output::{OutputMetadata, RentStructure}, payload::{dto::MilestonePayloadDto, milestone::option::dto::MilestoneOptionDto}, - protocol::dto::ProtocolParametersDto, + protocol::ProtocolParameters, BlockDto, }, }; @@ -129,14 +126,12 @@ pub async fn info(database: Extension) -> ApiResult { index: newest_milestone.milestone_index.0, timestamp: Some(newest_milestone.milestone_timestamp.0), milestone_id: Some( - iota_types::block::payload::milestone::MilestoneId::from( - database - .collection::() - .get_milestone_id(newest_milestone.milestone_index) - .await? - .ok_or(CorruptStateError::Milestone)?, - ) - .to_string(), + database + .collection::() + .get_milestone_id(newest_milestone.milestone_index) + .await? + .ok_or(CorruptStateError::Milestone)? + .into(), ), }; @@ -144,7 +139,7 @@ pub async fn info(database: Extension) -> ApiResult { let confirmed_milestone = ConfirmedMilestoneResponse { index: latest_milestone.index, timestamp: latest_milestone.timestamp, - milestone_id: latest_milestone.milestone_id.clone(), + milestone_id: latest_milestone.milestone_id, }; let base_token = database @@ -164,19 +159,18 @@ pub async fn info(database: Extension) -> ApiResult { confirmed_milestone, pruning_index: oldest_milestone.milestone_index.0 - 1, }, - protocol: ProtocolParametersDto { - protocol_version: protocol.version, - network_name: protocol.network_name, - below_max_depth: protocol.below_max_depth, - bech32_hrp: protocol.bech32_hrp, - min_pow_score: protocol.min_pow_score, - rent_structure: RentStructureDto { - v_byte_cost: protocol.rent_structure.v_byte_cost, - v_byte_factor_data: protocol.rent_structure.v_byte_factor_data, - v_byte_factor_key: protocol.rent_structure.v_byte_factor_key, - }, - token_supply: protocol.token_supply.to_string(), - }, + protocol: ProtocolParameters::new( + protocol.version, + protocol.network_name, + protocol.bech32_hrp, + protocol.min_pow_score, + protocol.below_max_depth, + RentStructure::default() + .with_byte_cost(protocol.rent_structure.v_byte_cost) + .with_byte_factor_data(protocol.rent_structure.v_byte_factor_data) + .with_byte_factor_key(protocol.rent_structure.v_byte_factor_key), + protocol.token_supply, + )?, base_token: BaseTokenResponse { name: base_token.name, ticker_symbol: base_token.ticker_symbol, @@ -211,13 +205,13 @@ async fn block( .await? .ok_or(MissingError::NoResults)?; - Ok(IotaRawResponse::Json(block.into())) + Ok(IotaRawResponse::Json(block.try_into()?)) } fn create_block_metadata_response(block_id: BlockId, metadata: BlockMetadata) -> iota::BlockMetadataResponse { iota::BlockMetadataResponse { - block_id: block_id.to_hex(), - parents: metadata.parents.iter().map(BlockId::to_hex).collect(), + block_id: block_id.into(), + parents: metadata.parents.into_vec().into_iter().map(Into::into).collect(), is_solid: metadata.is_solid, referenced_by_milestone_index: Some(*metadata.referenced_by_milestone_index), milestone_index: Some(*metadata.milestone_index), @@ -243,28 +237,30 @@ async fn block_metadata( Ok(create_block_metadata_response(block_id, metadata).into()) } -fn create_output_metadata_response(metadata: OutputMetadataResult, ledger_index: MilestoneIndex) -> OutputMetadataDto { - OutputMetadataDto { - block_id: metadata.block_id.to_hex(), - transaction_id: metadata.output_id.transaction_id.to_hex(), - output_index: metadata.output_id.index, - is_spent: metadata.spent_metadata.is_some(), - milestone_index_spent: metadata +fn create_output_metadata_response( + metadata: OutputMetadataResult, + ledger_index: MilestoneIndex, +) -> ApiResult { + Ok(OutputMetadata::new( + metadata.block_id.into(), + metadata.output_id.try_into()?, + metadata.spent_metadata.is_some(), + metadata .spent_metadata .as_ref() .map(|spent_md| *spent_md.spent.milestone_index), - milestone_timestamp_spent: metadata + metadata .spent_metadata .as_ref() .map(|spent_md| *spent_md.spent.milestone_timestamp), - transaction_id_spent: metadata + metadata .spent_metadata .as_ref() - .map(|spent_md| spent_md.transaction_id.to_hex()), - milestone_index_booked: *metadata.booked.milestone_index, - milestone_timestamp_booked: *metadata.booked.milestone_timestamp, - ledger_index: ledger_index.0, - } + .map(|spent_md| spent_md.transaction_id.into()), + *metadata.booked.milestone_index, + *metadata.booked.milestone_timestamp, + *ledger_index, + )) } async fn output( @@ -296,18 +292,18 @@ async fn output( return Ok(IotaRawResponse::Raw(output.raw(ctx)?)); } - let metadata = create_output_metadata_response(metadata, ledger_index); + let metadata = create_output_metadata_response(metadata, ledger_index)?; Ok(IotaRawResponse::Json(OutputWithMetadataResponse { metadata, - output: output.into(), + output: output.try_into()?, })) } async fn output_metadata( database: Extension, Path(output_id): Path, -) -> ApiResult> { +) -> ApiResult> { let ledger_index = database .collection::() .get_ledger_index() @@ -320,7 +316,7 @@ async fn output_metadata( .await? .ok_or(MissingError::NoResults)?; - Ok(create_output_metadata_response(metadata, ledger_index).into()) + Ok(create_output_metadata_response(metadata, ledger_index)?.into()) } async fn included_block( @@ -347,7 +343,7 @@ async fn included_block( .ok_or(MissingError::NoResults)? .block; - Ok(IotaRawResponse::Json(block.into())) + Ok(IotaRawResponse::Json(block.try_into()?)) } async fn included_block_metadata( @@ -372,7 +368,7 @@ async fn receipts(database: Extension) -> ApiResult) -> ApiResult, _>>()?; + let consumed_outputs = consumed_outputs + .into_iter() + .map(TryInto::try_into) + .collect::, _>>()?; Ok(iota::UtxoChangesResponse { index: *milestone_index, diff --git a/src/bin/inx-chronicle/api/error.rs b/src/bin/inx-chronicle/api/error.rs index 84c9ff290..091fb5d71 100644 --- a/src/bin/inx-chronicle/api/error.rs +++ b/src/bin/inx-chronicle/api/error.rs @@ -65,7 +65,7 @@ impl_internal_error!( axum::extract::rejection::ExtensionRejection, auth_helper::jwt::Error, argon2::Error, - iota_types::block::Error + iota_sdk::types::block::Error ); impl IntoResponse for ApiError { @@ -167,7 +167,7 @@ pub enum RequestError { BadTimeRange, #[error("invalid IOTA Stardust data: {0}")] - IotaStardust(#[from] iota_types::block::Error), + IotaStardust(#[from] iota_sdk::types::block::Error), #[error("invalid bool value provided: {0}")] Bool(#[from] ParseBoolError), #[error("invalid U256 value provided: {0}")] diff --git a/src/bin/inx-chronicle/api/explorer/routes.rs b/src/bin/inx-chronicle/api/explorer/routes.rs index fc83664f3..76eb721af 100644 --- a/src/bin/inx-chronicle/api/explorer/routes.rs +++ b/src/bin/inx-chronicle/api/explorer/routes.rs @@ -19,6 +19,7 @@ use chronicle::{ }, }; use futures::{StreamExt, TryStreamExt}; +use iota_sdk::types::block::address::ToBech32Ext; use super::{ extractors::{ @@ -267,10 +268,10 @@ async fn blocks_by_milestone_index( .map_ok(|rec| BlockPayloadTypeDto { block_id: rec.block_id.to_hex(), payload_kind: rec.payload_kind.map(|kind| match kind.as_str() { - TransactionPayload::KIND => iota_types::block::payload::TransactionPayload::KIND, - MilestonePayload::KIND => iota_types::block::payload::MilestonePayload::KIND, - TreasuryTransactionPayload::KIND => iota_types::block::payload::TreasuryTransactionPayload::KIND, - TaggedDataPayload::KIND => iota_types::block::payload::TaggedDataPayload::KIND, + TransactionPayload::KIND => iota_sdk::types::block::payload::TransactionPayload::KIND, + MilestonePayload::KIND => iota_sdk::types::block::payload::MilestonePayload::KIND, + TreasuryTransactionPayload::KIND => iota_sdk::types::block::payload::TreasuryTransactionPayload::KIND, + TaggedDataPayload::KIND => iota_sdk::types::block::payload::TaggedDataPayload::KIND, _ => panic!("Unknown payload type."), }), }) @@ -334,14 +335,17 @@ async fn richest_addresses_ledger_analytics( .await? .ok_or(CorruptStateError::ProtocolParams)? .parameters - .bech32_hrp; + .bech32_hrp + .parse()?; Ok(RichestAddressesResponse { top: res .top .into_iter() .map(|stat| AddressStatDto { - address: iota_types::block::address::Address::from(stat.address).to_bech32(hrp.clone()), + address: iota_sdk::types::block::address::Address::from(stat.address) + .to_bech32(hrp) + .to_string(), balance: stat.balance, }) .collect(), diff --git a/src/bin/inx-chronicle/api/poi/error.rs b/src/bin/inx-chronicle/api/poi/error.rs index 13e3d34fb..abed92637 100644 --- a/src/bin/inx-chronicle/api/poi/error.rs +++ b/src/bin/inx-chronicle/api/poi/error.rs @@ -1,7 +1,7 @@ // Copyright 2022 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -use iota_types::block::payload::milestone::MilestoneValidationError; +use iota_sdk::types::block::payload::milestone::MilestoneValidationError; use thiserror::Error; #[derive(Error, Debug)] diff --git a/src/bin/inx-chronicle/api/poi/merkle_proof.rs b/src/bin/inx-chronicle/api/poi/merkle_proof.rs index d3cfe5289..330e34fc5 100644 --- a/src/bin/inx-chronicle/api/poi/merkle_proof.rs +++ b/src/bin/inx-chronicle/api/poi/merkle_proof.rs @@ -187,7 +187,7 @@ impl TryFrom for Hashable { type Error = prefix_hex::Error; fn try_from(hashed: HashableDto) -> Result { - use iota_types::block::payload::milestone::MerkleRoot; + use iota_sdk::types::block::payload::milestone::MerkleRoot; Ok(match hashed { HashableDto::Node { hash } => Hashable::Node(prefix_hex::decode::<[u8; MerkleRoot::LENGTH]>(&hash)?.into()), HashableDto::Path(path) => Hashable::Path(Box::new(MerkleAuditPath::try_from(*path)?)), diff --git a/src/bin/inx-chronicle/api/poi/responses.rs b/src/bin/inx-chronicle/api/poi/responses.rs index 7b65721eb..12afb8d2b 100644 --- a/src/bin/inx-chronicle/api/poi/responses.rs +++ b/src/bin/inx-chronicle/api/poi/responses.rs @@ -1,7 +1,7 @@ // Copyright 2022 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -use iota_types::block::{payload::dto::MilestonePayloadDto, BlockDto}; +use iota_sdk::types::block::{payload::dto::MilestonePayloadDto, BlockDto}; use serde::{Deserialize, Serialize}; use super::merkle_proof::MerkleAuditPathDto; diff --git a/src/bin/inx-chronicle/api/poi/routes.rs b/src/bin/inx-chronicle/api/poi/routes.rs index 68c1bf1c0..f7dbf9e04 100644 --- a/src/bin/inx-chronicle/api/poi/routes.rs +++ b/src/bin/inx-chronicle/api/poi/routes.rs @@ -15,6 +15,7 @@ use chronicle::{ }, model::{metadata::LedgerInclusionState, node::MilestoneKeyRange, tangle::MilestoneIndex, BlockId}, }; +use iota_sdk::types::TryFromDto; use super::{ error as poi, @@ -99,7 +100,7 @@ async fn create_proof_for_referenced_blocks( Ok(CreateProofResponse { milestone: milestone_payload.into(), - block: block.into(), + block: block.try_into()?, audit_path: merkle_audit_path.into(), }) } @@ -113,10 +114,10 @@ async fn validate_proof_for_referenced_blocks( }): Json, ) -> ApiResult { // Extract block, milestone, and audit path. - let block = iota_types::block::Block::try_from_dto_unverified(&block) + let block = iota_sdk::types::block::Block::try_from_dto(block) .map_err(|_| RequestError::PoI(poi::RequestError::MalformedJsonBlock))?; let block_id = block.id().into(); - let milestone = iota_types::block::payload::milestone::MilestonePayload::try_from_dto_unverified(&milestone) + let milestone = iota_sdk::types::block::payload::milestone::MilestonePayload::try_from_dto(milestone) .map_err(|_| RequestError::PoI(poi::RequestError::MalformedJsonMilestone))?; let milestone_index = milestone.essence().index(); let proof = MerkleAuditPath::try_from(merkle_path) @@ -204,7 +205,7 @@ async fn create_proof_for_applied_blocks( Ok(CreateProofResponse { milestone: milestone.into(), - block: block.into(), + block: block.try_into()?, audit_path: merkle_audit_path.into(), }) } @@ -218,10 +219,10 @@ async fn validate_proof_for_applied_blocks( }): Json, ) -> ApiResult { // Extract block, milestone, and audit path. - let block = iota_types::block::Block::try_from_dto_unverified(&block) + let block = iota_sdk::types::block::Block::try_from_dto(block) .map_err(|_| RequestError::PoI(poi::RequestError::MalformedJsonBlock))?; let block_id = block.id().into(); - let milestone = iota_types::block::payload::milestone::MilestonePayload::try_from_dto_unverified(&milestone) + let milestone = iota_sdk::types::block::payload::milestone::MilestonePayload::try_from_dto(milestone) .map_err(|_| RequestError::PoI(poi::RequestError::MalformedJsonMilestone))?; let milestone_index = milestone.essence().index(); let audit_path = MerkleAuditPath::try_from(audit_path) diff --git a/src/bin/inx-chronicle/api/secret_key.rs b/src/bin/inx-chronicle/api/secret_key.rs index 573756362..d692fcd4a 100644 --- a/src/bin/inx-chronicle/api/secret_key.rs +++ b/src/bin/inx-chronicle/api/secret_key.rs @@ -1,7 +1,8 @@ // Copyright 2022 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -use ed25519::pkcs8::{DecodePrivateKey, KeypairBytes}; +use crypto::signatures::ed25519::SecretKey as CryptoKey; +use ed25519_zebra::ed25519::{pkcs8::DecodePrivateKey, KeypairBytes}; use thiserror::Error; use zeroize::Zeroize; @@ -9,20 +10,18 @@ use zeroize::Zeroize; pub enum SecretKeyError { #[error("failed to read file: {0}")] FileRead(#[from] std::io::Error), - #[error("failed to decode key: {0}")] - Decode(ed25519_dalek::SignatureError), #[error("failed to read key bytes")] Read, } /// An Ed25519 secret key. -#[derive(Clone, Zeroize)] -pub struct SecretKey(ed25519_dalek::SecretKey); +#[derive(Clone)] +pub struct SecretKey(CryptoKey); /// View the bytes of the secret key. impl AsRef<[u8]> for SecretKey { fn as_ref(&self) -> &[u8] { - &self.0 + self.0.as_slice() } } @@ -42,14 +41,16 @@ impl SecretKey { } /// Create an Ed25519 secret key from a 32 byte array. - pub fn from_bytes(sk_bytes: ed25519_dalek::SecretKey) -> Self { - Self(sk_bytes) + pub fn from_bytes(mut sk_bytes: [u8; CryptoKey::LENGTH]) -> Self { + let key = CryptoKey::from_bytes(&sk_bytes); + sk_bytes.zeroize(); + Self(key) } /// Create an Ed25519 secret key from a PEM file. pub fn from_file(path: &str) -> Result { let bytes = KeypairBytes::from_pkcs8_pem(&std::fs::read_to_string(std::path::Path::new(path))?) .map_err(|_| SecretKeyError::Read)?; - Ok(Self(bytes.secret_key)) + Ok(Self::from_bytes(bytes.secret_key)) } } diff --git a/src/db/mongodb/collections/block.rs b/src/db/mongodb/collections/block.rs index 3a67f7c10..09646ec35 100644 --- a/src/db/mongodb/collections/block.rs +++ b/src/db/mongodb/collections/block.rs @@ -158,7 +158,7 @@ impl BlockCollection { Ok(self .get_block_raw(block_id) .await? - .map(|raw| iota_types::block::Block::unpack_unverified(raw).unwrap().into())) + .map(|raw| iota_sdk::types::block::Block::unpack_unverified(raw).unwrap().into())) } /// Get the raw bytes of a [`Block`] by its [`BlockId`]. @@ -271,7 +271,7 @@ impl BlockCollection { .map_ok(|r| { ( r.block_id, - iota_types::block::Block::unpack_unverified(r.raw.clone()) + iota_sdk::types::block::Block::unpack_unverified(r.raw.clone()) .unwrap() .into(), r.raw, @@ -327,7 +327,7 @@ impl BlockCollection { transaction_id: &TransactionId, ) -> Result, Error> { Ok(self.get_block_raw_for_transaction(transaction_id).await?.map(|raw| { - let block = iota_types::block::Block::unpack_unverified(raw).unwrap(); + let block = iota_sdk::types::block::Block::unpack_unverified(raw).unwrap(); IncludedBlockResult { block_id: block.id().into(), block: block.into(), @@ -394,7 +394,7 @@ impl BlockCollection { None, ) .await? - .map_ok(|RawResult { raw }| iota_types::block::Block::unpack_unverified(raw).unwrap().into()) + .map_ok(|RawResult { raw }| iota_sdk::types::block::Block::unpack_unverified(raw).unwrap().into()) .try_next() .await } diff --git a/src/db/mongodb/collections/outputs/indexer/alias.rs b/src/db/mongodb/collections/outputs/indexer/alias.rs index 5a89f432f..c66a6814a 100644 --- a/src/db/mongodb/collections/outputs/indexer/alias.rs +++ b/src/db/mongodb/collections/outputs/indexer/alias.rs @@ -7,7 +7,7 @@ use primitive_types::U256; use super::queries::{AppendQuery, CreatedQuery, GovernorQuery, IssuerQuery, NativeTokensQuery, SenderQuery}; use crate::{ db::mongodb::collections::outputs::indexer::queries::AddressQuery, - model::{tangle::MilestoneTimestamp, utxo::Address}, + model::payload::{milestone::MilestoneTimestamp, transaction::output::Address}, }; #[derive(Clone, Debug, Default, PartialEq, Eq)] diff --git a/src/inx/block.rs b/src/inx/block.rs index 22a8a85da..ebc3fc690 100644 --- a/src/inx/block.rs +++ b/src/inx/block.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use inx::proto; -use iota_types::block as iota; +use iota_sdk::types::block as iota; use super::{InxError, RawMessage}; use crate::{ diff --git a/src/inx/ledger.rs b/src/inx/ledger.rs index a73d8f2e2..737ddeec6 100644 --- a/src/inx/ledger.rs +++ b/src/inx/ledger.rs @@ -1,7 +1,7 @@ // Copyright 2022 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -use iota_types::block as iota; +use iota_sdk::types::block as iota; use packable::PackableExt; use super::InxError; diff --git a/src/inx/milestone.rs b/src/inx/milestone.rs index 61c963756..34c2e3dd5 100644 --- a/src/inx/milestone.rs +++ b/src/inx/milestone.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use inx::proto; -use iota_types::block as iota; +use iota_sdk::types::block as iota; use super::{raw::RawMessage, InxError, RawProtocolParametersMessage}; use crate::{ diff --git a/src/inx/node/config.rs b/src/inx/node/config.rs index e680c6bf6..5ea82c6a7 100644 --- a/src/inx/node/config.rs +++ b/src/inx/node/config.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use inx::proto; -use iota_types::block as iota; +use iota_sdk::types::block as iota; use crate::{ inx::InxError, diff --git a/src/inx/protocol.rs b/src/inx/protocol.rs index 8485a9c98..660a40cae 100644 --- a/src/inx/protocol.rs +++ b/src/inx/protocol.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 use inx::proto; -use iota_types::block as iota; +use iota_sdk::types::block as iota; use super::raw::RawMessage; diff --git a/src/inx/raw.rs b/src/inx/raw.rs index d400c1156..ebb5d384b 100644 --- a/src/inx/raw.rs +++ b/src/inx/raw.rs @@ -23,7 +23,7 @@ impl RawMessage { } /// Unpack the raw data into a type `T` using - /// [`ProtocolParameters`](iota_types::block::protocol::ProtocolParameters) to verify the bytes. + /// [`ProtocolParameters`](iota_sdk::types::block::protocol::ProtocolParameters) to verify the bytes. pub fn inner(self, visitor: &T::UnpackVisitor) -> Result { let unpacked = T::unpack_verified(self.data, visitor).map_err(|e| InxError::InvalidRawBytes(format!("{e:?}")))?; @@ -47,58 +47,58 @@ impl From> for RawMessage { } } -impl From for RawMessage { +impl From for RawMessage { fn from(value: proto::RawOutput) -> Self { value.data.into() } } -impl From> for proto::RawOutput { - fn from(value: RawMessage) -> Self { +impl From> for proto::RawOutput { + fn from(value: RawMessage) -> Self { Self { data: value.data } } } -impl From for RawMessage { +impl From for RawMessage { fn from(value: proto::RawBlock) -> Self { value.data.into() } } -impl From> for proto::RawBlock { - fn from(value: RawMessage) -> Self { +impl From> for proto::RawBlock { + fn from(value: RawMessage) -> Self { Self { data: value.data } } } -impl From for RawMessage { +impl From for RawMessage { fn from(value: proto::RawMilestone) -> Self { value.data.into() } } -impl From> for proto::RawMilestone { - fn from(value: RawMessage) -> Self { +impl From> for proto::RawMilestone { + fn from(value: RawMessage) -> Self { Self { data: value.data } } } #[cfg(test)] mod test { - use iota_types::block::{payload::Payload, rand::output::rand_output}; + use iota_sdk::types::block::{payload::Payload, rand::output::rand_output}; use super::*; #[test] fn raw_output() { - let protocol_parameters = iota_types::block::protocol::protocol_parameters(); + let protocol_parameters = iota_sdk::types::block::protocol::protocol_parameters(); let output = rand_output(protocol_parameters.token_supply()); let proto = proto::RawOutput { data: output.pack_to_vec(), }; - let raw: RawMessage = proto.into(); + let raw: RawMessage = proto.into(); assert_eq!(output, raw.clone().inner_unverified().unwrap()); assert_eq!(output, raw.inner(&protocol_parameters).unwrap()); } diff --git a/src/model/block/metadata/conflict_reason.rs b/src/model/block/metadata/conflict_reason.rs index 8def8afb4..fad956f30 100644 --- a/src/model/block/metadata/conflict_reason.rs +++ b/src/model/block/metadata/conflict_reason.rs @@ -1,7 +1,7 @@ // Copyright 2022 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -use iota_types::block::semantic as iota; +use iota_sdk::types::block::semantic as iota; use serde::{Deserialize, Serialize}; #[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)] diff --git a/src/model/block/metadata/inclusion_state.rs b/src/model/block/metadata/inclusion_state.rs index 6b37068e5..24751bf6d 100644 --- a/src/model/block/metadata/inclusion_state.rs +++ b/src/model/block/metadata/inclusion_state.rs @@ -1,7 +1,7 @@ // Copyright 2022 IOTA Stiftung // SPDX-License-Identifier: Apache-2.0 -use iota_types::api::core::dto as iota; +use iota_sdk::types::api::core::response as iota; use mongodb::bson::Bson; use serde::{Deserialize, Serialize}; @@ -24,17 +24,17 @@ impl From for Bson { } } -impl From for LedgerInclusionState { - fn from(value: iota::LedgerInclusionStateDto) -> Self { +impl From for LedgerInclusionState { + fn from(value: iota::LedgerInclusionState) -> Self { match value { - iota::LedgerInclusionStateDto::Conflicting => Self::Conflicting, - iota::LedgerInclusionStateDto::Included => Self::Included, - iota::LedgerInclusionStateDto::NoTransaction => Self::NoTransaction, + iota::LedgerInclusionState::Conflicting => Self::Conflicting, + iota::LedgerInclusionState::Included => Self::Included, + iota::LedgerInclusionState::NoTransaction => Self::NoTransaction, } } } -impl From for iota::LedgerInclusionStateDto { +impl From for iota::LedgerInclusionState { fn from(value: LedgerInclusionState) -> Self { match value { LedgerInclusionState::Conflicting => Self::Conflicting, diff --git a/src/model/block/mod.rs b/src/model/block/mod.rs index 59cf85554..b3c094837 100644 --- a/src/model/block/mod.rs +++ b/src/model/block/mod.rs @@ -6,7 +6,7 @@ use std::str::FromStr; use iota::protocol::ProtocolParameters; -use iota_types::block as iota; +use iota_sdk::types::block as iota; use mongodb::bson::{spec::BinarySubtype, Binary, Bson}; use serde::{Deserialize, Serialize}; @@ -44,7 +44,7 @@ impl From for iota::BlockId { } impl FromStr for BlockId { - type Err = iota_types::block::Error; + type Err = iota_sdk::types::block::Error; fn from_str(s: &str) -> Result { Ok(iota::BlockId::from_str(s)?.into()) @@ -94,22 +94,23 @@ impl From for Block { } impl TryFromWithContext for iota::Block { - type Error = iota_types::block::Error; + type Error = iota_sdk::types::block::Error; fn try_from_with_context(ctx: &ProtocolParameters, value: Block) -> Result { - let mut builder = iota::BlockBuilder::new(iota::parent::Parents::new( - value.parents.into_vec().into_iter().map(Into::into).collect::>(), + let mut builder = iota::BlockBuilder::new(iota::parent::Parents::from_vec( + value.parents.into_vec().into_iter().map(Into::into).collect(), )?) .with_nonce(value.nonce); if let Some(payload) = value.payload { - builder = builder.with_payload(payload.try_into_with_context(ctx)?) + let payload: iota_sdk::types::block::payload::Payload = payload.try_into_with_context(ctx)?; + builder = builder.with_payload(payload); } builder.finish() } } impl TryFromWithContext for iota::BlockDto { - type Error = iota_types::block::Error; + type Error = iota_sdk::types::block::Error; fn try_from_with_context(ctx: &ProtocolParameters, value: Block) -> Result { let stardust = iota::Block::try_from_with_context(ctx, value)?; @@ -117,14 +118,16 @@ impl TryFromWithContext for iota::BlockDto { } } -impl From for iota::BlockDto { - fn from(value: Block) -> Self { - Self { +impl TryFrom for iota::BlockDto { + type Error = iota_sdk::types::block::Error; + + fn try_from(value: Block) -> Result { + Ok(Self { protocol_version: value.protocol_version, parents: value.parents.to_vec().iter().map(BlockId::to_hex).collect(), - payload: value.payload.map(Into::into), + payload: value.payload.map(TryInto::try_into).transpose()?, nonce: value.nonce.to_string(), - } + }) } } @@ -156,7 +159,7 @@ mod rand { impl Block { /// Generates a random [`Block`]. - pub fn rand(ctx: &iota_types::block::protocol::ProtocolParameters) -> Self { + pub fn rand(ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Self { Self { protocol_version: rand_number(), parents: BlockId::rand_parents(), @@ -166,7 +169,7 @@ mod rand { } /// Generates a random [`Block`] with a [`TransactionPayload`](crate::model::payload::TransactionPayload). - pub fn rand_transaction(ctx: &iota_types::block::protocol::ProtocolParameters) -> Self { + pub fn rand_transaction(ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Self { Self { protocol_version: rand_number(), parents: BlockId::rand_parents(), @@ -176,7 +179,7 @@ mod rand { } /// Generates a random [`Block`] with a [`MilestonePayload`](crate::model::payload::MilestonePayload). - pub fn rand_milestone(ctx: &iota_types::block::protocol::ProtocolParameters) -> Self { + pub fn rand_milestone(ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Self { Self { protocol_version: rand_number(), parents: BlockId::rand_parents(), @@ -197,7 +200,7 @@ mod rand { /// Generates a random [`Block`] with a /// [`TreasuryTransactionPayload`](crate::model::payload::TreasuryTransactionPayload). - pub fn rand_treasury_transaction(ctx: &iota_types::block::protocol::ProtocolParameters) -> Self { + pub fn rand_treasury_transaction(ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Self { Self { protocol_version: rand_number(), parents: BlockId::rand_parents(), @@ -244,7 +247,7 @@ mod test { #[test] fn test_transaction_block_bson() { - let ctx = iota_types::block::protocol::protocol_parameters(); + let ctx = iota_sdk::types::block::protocol::protocol_parameters(); let block = Block::rand_transaction(&ctx); let mut bson = to_bson(&block).unwrap(); // Need to re-add outputs as they are not serialized @@ -267,9 +270,9 @@ mod test { #[test] fn test_milestone_block_bson() { - let ctx = iota_types::block::protocol::protocol_parameters(); + let ctx = iota_sdk::types::block::protocol::protocol_parameters(); let block = Block::rand_milestone(&ctx); - let ctx = iota_types::block::protocol::protocol_parameters(); + let ctx = iota_sdk::types::block::protocol::protocol_parameters(); iota::Block::try_from_with_context(&ctx, block.clone()).unwrap(); let bson = to_bson(&block).unwrap(); assert_eq!(block, from_bson::(bson).unwrap()); @@ -278,7 +281,7 @@ mod test { #[test] fn test_tagged_data_block_bson() { let block = Block::rand_tagged_data(); - let ctx = iota_types::block::protocol::protocol_parameters(); + let ctx = iota_sdk::types::block::protocol::protocol_parameters(); iota::Block::try_from_with_context(&ctx, block.clone()).unwrap(); let bson = to_bson(&block).unwrap(); assert_eq!(block, from_bson::(bson).unwrap()); @@ -286,7 +289,7 @@ mod test { #[test] fn test_treasury_transaction_block_bson() { - let ctx = iota_types::block::protocol::protocol_parameters(); + let ctx = iota_sdk::types::block::protocol::protocol_parameters(); let block = Block::rand_treasury_transaction(&ctx); let bson = to_bson(&block).unwrap(); assert_eq!(block, from_bson::(bson).unwrap()); @@ -295,7 +298,7 @@ mod test { #[test] fn test_no_payload_block_bson() { let block = Block::rand_no_payload(); - let ctx = iota_types::block::protocol::protocol_parameters(); + let ctx = iota_sdk::types::block::protocol::protocol_parameters(); iota::Block::try_from_with_context(&ctx, block.clone()).unwrap(); let bson = to_bson(&block).unwrap(); assert_eq!(block, from_bson::(bson).unwrap()); diff --git a/src/model/block/payload/milestone/milestone_id.rs b/src/model/block/payload/milestone/milestone_id.rs index 0ec2c1dbc..d640ff2f7 100644 --- a/src/model/block/payload/milestone/milestone_id.rs +++ b/src/model/block/payload/milestone/milestone_id.rs @@ -3,7 +3,7 @@ use std::str::FromStr; -use iota_types::block::payload::milestone as iota; +use iota_sdk::types::block::payload::milestone as iota; use mongodb::bson::{spec::BinarySubtype, Binary, Bson}; use serde::{Deserialize, Serialize}; @@ -37,7 +37,7 @@ impl From for iota::MilestoneId { } impl FromStr for MilestoneId { - type Err = iota_types::block::Error; + type Err = iota_sdk::types::block::Error; fn from_str(s: &str) -> Result { Ok(iota::MilestoneId::from_str(s)?.into()) @@ -56,7 +56,7 @@ impl From for Bson { #[cfg(feature = "rand")] mod rand { - use iota_types::block::rand::milestone::rand_milestone_id; + use iota_sdk::types::block::rand::milestone::rand_milestone_id; use super::*; diff --git a/src/model/block/payload/milestone/milestone_index.rs b/src/model/block/payload/milestone/milestone_index.rs index 981467022..2c90965f4 100644 --- a/src/model/block/payload/milestone/milestone_index.rs +++ b/src/model/block/payload/milestone/milestone_index.rs @@ -4,7 +4,7 @@ use std::{fmt, num::ParseIntError, ops, str::FromStr}; use derive_more::{Add, Deref, DerefMut, Sub}; -use iota_types::block::payload::milestone as iota; +use iota_sdk::types::block::payload::milestone as iota; use mongodb::bson::{doc, Bson}; use serde::{Deserialize, Serialize}; diff --git a/src/model/block/payload/milestone/mod.rs b/src/model/block/payload/milestone/mod.rs index 67e5fa1f4..27844e39f 100644 --- a/src/model/block/payload/milestone/mod.rs +++ b/src/model/block/payload/milestone/mod.rs @@ -9,7 +9,7 @@ mod milestone_timestamp; use std::borrow::Borrow; -use iota_types::block::payload::milestone as iota; +use iota_sdk::types::block::payload::milestone as iota; use serde::{Deserialize, Serialize}; pub use self::{milestone_id::MilestoneId, milestone_index::MilestoneIndex, milestone_timestamp::MilestoneTimestamp}; @@ -57,10 +57,10 @@ impl> From for MilestonePayload { } impl TryFromWithContext for iota::MilestonePayload { - type Error = iota_types::block::Error; + type Error = iota_sdk::types::block::Error; fn try_from_with_context( - ctx: &iota_types::block::protocol::ProtocolParameters, + ctx: &iota_sdk::types::block::protocol::ProtocolParameters, value: MilestonePayload, ) -> Result { iota::MilestonePayload::new( @@ -69,8 +69,8 @@ impl TryFromWithContext for iota::MilestonePayload { .signatures .into_vec() .into_iter() - .map(Into::into) - .collect::>(), + .map(TryInto::try_into) + .collect::, _>>()?, ) } } @@ -93,7 +93,7 @@ impl From for iota::dto::MilestonePayloadDto { inclusion_merkle_root: prefix_hex::encode(value.essence.inclusion_merkle_root), applied_merkle_root: prefix_hex::encode(value.essence.applied_merkle_root), options: value.essence.options.into_vec().into_iter().map(Into::into).collect(), - metadata: prefix_hex::encode(value.essence.metadata), + metadata: value.essence.metadata.into_boxed_slice(), signatures: value.signatures.into_vec().into_iter().map(Into::into).collect(), } } @@ -147,10 +147,10 @@ impl> From for MilestoneEssence { } impl TryFromWithContext for iota::MilestoneEssence { - type Error = iota_types::block::Error; + type Error = iota_sdk::types::block::Error; fn try_from_with_context( - ctx: &iota_types::block::protocol::ProtocolParameters, + ctx: &iota_sdk::types::block::protocol::ProtocolParameters, value: MilestoneEssence, ) -> Result { iota::MilestoneEssence::new( @@ -158,19 +158,19 @@ impl TryFromWithContext for iota::MilestoneEssence { value.timestamp.0, value.protocol_version, value.previous_milestone_id.into(), - iota_types::block::parent::Parents::new( - value.parents.into_vec().into_iter().map(Into::into).collect::>(), + iota_sdk::types::block::parent::Parents::from_vec( + value.parents.into_vec().into_iter().map(Into::into).collect(), )?, - iota_types::block::payload::milestone::MerkleRoot::from(value.inclusion_merkle_root), - iota_types::block::payload::milestone::MerkleRoot::from(value.applied_merkle_root), + iota_sdk::types::block::payload::milestone::MerkleRoot::from(value.inclusion_merkle_root), + iota_sdk::types::block::payload::milestone::MerkleRoot::from(value.applied_merkle_root), value.metadata, - iota_types::block::payload::MilestoneOptions::new( + iota_sdk::types::block::payload::MilestoneOptions::from_vec( value .options .into_vec() .into_iter() .map(|x| x.try_into_with_context(ctx)) - .collect::, _>>()?, + .collect::>()?, )?, ) } @@ -221,10 +221,10 @@ impl> From for MilestoneOption { } impl TryFromWithContext for iota::MilestoneOption { - type Error = iota_types::block::Error; + type Error = iota_sdk::types::block::Error; fn try_from_with_context( - ctx: &iota_types::block::protocol::ProtocolParameters, + ctx: &iota_sdk::types::block::protocol::ProtocolParameters, value: MilestoneOption, ) -> Result { Ok(match value { @@ -269,7 +269,7 @@ impl From for iota::option::dto::MilestoneOptionDto { kind: iota::option::ReceiptMilestoneOption::KIND, migrated_at: migrated_at.0, funds: funds.into_vec().into_iter().map(Into::into).collect(), - transaction: iota_types::block::payload::dto::PayloadDto::TreasuryTransaction(Box::new( + transaction: iota_sdk::types::block::payload::dto::PayloadDto::TreasuryTransaction(Box::new( transaction.into(), )), last, @@ -282,7 +282,7 @@ impl From for iota::option::dto::MilestoneOptionDto { kind: iota::option::ParametersMilestoneOption::KIND, target_milestone_index: target_milestone_index.0, protocol_version, - binary_parameters: prefix_hex::encode(binary_parameters), + binary_parameters, }), } } @@ -318,10 +318,10 @@ impl> From for MigratedFundsEntry } impl TryFromWithContext for iota::option::MigratedFundsEntry { - type Error = iota_types::block::Error; + type Error = iota_sdk::types::block::Error; fn try_from_with_context( - ctx: &iota_types::block::protocol::ProtocolParameters, + ctx: &iota_sdk::types::block::protocol::ProtocolParameters, value: MigratedFundsEntry, ) -> Result { Self::new( @@ -345,7 +345,7 @@ impl From for iota::option::dto::MigratedFundsEntryDto { #[cfg(feature = "rand")] mod rand { - use iota_types::block::rand::{ + use iota_sdk::types::block::rand::{ bytes::rand_bytes, milestone::rand_merkle_root, milestone_option::rand_receipt_milestone_option, number::rand_number, payload::rand_milestone_payload, receipt::rand_migrated_funds_entry, }; @@ -354,14 +354,14 @@ mod rand { impl MilestonePayload { /// Generates a random [`MilestonePayload`]. - pub fn rand(ctx: &iota_types::block::protocol::ProtocolParameters) -> Self { + pub fn rand(ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Self { rand_milestone_payload(ctx.protocol_version()).into() } } impl MilestoneEssence { /// Generates a random [`MilestoneEssence`]. - pub fn rand(ctx: &iota_types::block::protocol::ProtocolParameters) -> Self { + pub fn rand(ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Self { Self { index: rand_number::().into(), timestamp: rand_number::().into(), @@ -378,7 +378,7 @@ mod rand { impl MilestoneOption { /// Generates a random receipt [`MilestoneOption`]. - pub fn rand_receipt(ctx: &iota_types::block::protocol::ProtocolParameters) -> Self { + pub fn rand_receipt(ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Self { iota::MilestoneOption::from(rand_receipt_milestone_option(ctx.token_supply())).into() } @@ -394,7 +394,7 @@ mod rand { impl MigratedFundsEntry { /// Generates a random [`MigratedFundsEntry`]. - pub fn rand(ctx: &iota_types::block::protocol::ProtocolParameters) -> Self { + pub fn rand(ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Self { rand_migrated_funds_entry(ctx.token_supply()).into() } } @@ -416,7 +416,7 @@ mod test { #[test] fn test_milestone_payload_bson() { - let ctx = iota_types::block::protocol::protocol_parameters(); + let ctx = iota_sdk::types::block::protocol::protocol_parameters(); let payload = MilestonePayload::rand(&ctx); iota::MilestonePayload::try_from_with_context(&ctx, payload.clone()).unwrap(); let bson = to_bson(&payload).unwrap(); diff --git a/src/model/block/payload/mod.rs b/src/model/block/payload/mod.rs index 6e630b80e..9134c015f 100644 --- a/src/model/block/payload/mod.rs +++ b/src/model/block/payload/mod.rs @@ -5,7 +5,7 @@ use std::borrow::Borrow; -use iota_types::block::payload as iota; +use iota_sdk::types::block::payload as iota; use serde::{Deserialize, Serialize}; pub mod milestone; @@ -47,10 +47,10 @@ impl> From for Payload { } impl TryFromWithContext for iota::Payload { - type Error = iota_types::block::Error; + type Error = iota_sdk::types::block::Error; fn try_from_with_context( - ctx: &iota_types::block::protocol::ProtocolParameters, + ctx: &iota_sdk::types::block::protocol::ProtocolParameters, value: Payload, ) -> Result { Ok(match value { @@ -64,26 +64,28 @@ impl TryFromWithContext for iota::Payload { } } -impl From for iota::dto::PayloadDto { - fn from(value: Payload) -> Self { - match value { - Payload::Transaction(p) => Self::Transaction(Box::new((*p).into())), +impl TryFrom for iota::dto::PayloadDto { + type Error = iota_sdk::types::block::Error; + + fn try_from(value: Payload) -> Result { + Ok(match value { + Payload::Transaction(p) => Self::Transaction(Box::new((*p).try_into()?)), Payload::Milestone(p) => Self::Milestone(Box::new((*p).into())), Payload::TreasuryTransaction(p) => Self::TreasuryTransaction(Box::new((*p).into())), Payload::TaggedData(p) => Self::TaggedData(Box::new((*p).into())), - } + }) } } #[cfg(feature = "rand")] mod rand { - use iota_types::block::rand::number::rand_number_range; + use iota_sdk::types::block::rand::number::rand_number_range; use super::*; impl Payload { /// Generates a random [`Payload`]. - pub fn rand(ctx: &iota_types::block::protocol::ProtocolParameters) -> Self { + pub fn rand(ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Self { match rand_number_range(0..4) { 0 => Self::rand_transaction(ctx), 1 => Self::rand_milestone(ctx), @@ -94,7 +96,7 @@ mod rand { } /// Generates a random, optional [`Payload`]. - pub fn rand_opt(ctx: &iota_types::block::protocol::ProtocolParameters) -> Option { + pub fn rand_opt(ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Option { match rand_number_range(0..5) { 0 => Self::rand_transaction(ctx).into(), 1 => Self::rand_milestone(ctx).into(), @@ -106,12 +108,12 @@ mod rand { } /// Generates a random transaction [`Payload`]. - pub fn rand_transaction(ctx: &iota_types::block::protocol::ProtocolParameters) -> Self { + pub fn rand_transaction(ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Self { Self::Transaction(Box::new(TransactionPayload::rand(ctx))) } /// Generates a random milestone [`Payload`]. - pub fn rand_milestone(ctx: &iota_types::block::protocol::ProtocolParameters) -> Self { + pub fn rand_milestone(ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Self { Self::Milestone(Box::new(MilestonePayload::rand(ctx))) } @@ -121,7 +123,7 @@ mod rand { } /// Generates a random treasury transaction [`Payload`]. - pub fn rand_treasury_transaction(ctx: &iota_types::block::protocol::ProtocolParameters) -> Self { + pub fn rand_treasury_transaction(ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Self { Self::TreasuryTransaction(Box::new(TreasuryTransactionPayload::rand(ctx))) } } @@ -135,7 +137,7 @@ mod test { #[test] fn test_transaction_payload_bson() { - let ctx = iota_types::block::protocol::protocol_parameters(); + let ctx = iota_sdk::types::block::protocol::protocol_parameters(); let payload = Payload::rand_transaction(&ctx); let mut bson = to_bson(&payload).unwrap(); // Need to re-add outputs as they are not serialized @@ -156,7 +158,7 @@ mod test { #[test] fn test_milestone_payload_bson() { - let ctx = iota_types::block::protocol::protocol_parameters(); + let ctx = iota_sdk::types::block::protocol::protocol_parameters(); let payload = Payload::rand_milestone(&ctx); iota::Payload::try_from_with_context(&ctx, payload.clone()).unwrap(); let bson = to_bson(&payload).unwrap(); @@ -169,7 +171,7 @@ mod test { #[test] fn test_treasury_transaction_payload_bson() { - let ctx = iota_types::block::protocol::protocol_parameters(); + let ctx = iota_sdk::types::block::protocol::protocol_parameters(); let payload = Payload::rand_treasury_transaction(&ctx); iota::Payload::try_from_with_context(&ctx, payload.clone()).unwrap(); let bson = to_bson(&payload).unwrap(); @@ -182,7 +184,7 @@ mod test { #[test] fn test_tagged_data_payload_bson() { - let ctx = iota_types::block::protocol::protocol_parameters(); + let ctx = iota_sdk::types::block::protocol::protocol_parameters(); let payload = Payload::rand_tagged_data(); iota::Payload::try_from_with_context(&ctx, payload.clone()).unwrap(); let bson = to_bson(&payload).unwrap(); diff --git a/src/model/block/payload/tagged_data.rs b/src/model/block/payload/tagged_data.rs index ced6e689a..7ae04c681 100644 --- a/src/model/block/payload/tagged_data.rs +++ b/src/model/block/payload/tagged_data.rs @@ -5,7 +5,7 @@ use std::borrow::Borrow; -use iota_types::block::payload::tagged_data as iota; +use iota_sdk::types::block::payload::tagged_data as iota; use serde::{Deserialize, Serialize}; /// Represents the tagged data payload for data blocks. @@ -32,10 +32,10 @@ impl> From for TaggedDataPayload { } impl TryFrom for iota::TaggedDataPayload { - type Error = iota_types::block::Error; + type Error = iota_sdk::types::block::Error; fn try_from(value: TaggedDataPayload) -> Result { - iota::TaggedDataPayload::new(value.tag.into(), value.data.into()) + iota::TaggedDataPayload::new(value.tag, value.data) } } @@ -43,15 +43,15 @@ impl From for iota::dto::TaggedDataPayloadDto { fn from(value: TaggedDataPayload) -> Self { Self { kind: iota::TaggedDataPayload::KIND, - tag: prefix_hex::encode(value.tag), - data: prefix_hex::encode(value.data), + tag: value.tag, + data: value.data, } } } #[cfg(feature = "rand")] mod rand { - use iota_types::block::rand::payload::rand_tagged_data_payload; + use iota_sdk::types::block::rand::payload::rand_tagged_data_payload; use super::*; diff --git a/src/model/block/payload/transaction/input.rs b/src/model/block/payload/transaction/input.rs index 584a67a6c..e8ce4a3c8 100644 --- a/src/model/block/payload/transaction/input.rs +++ b/src/model/block/payload/transaction/input.rs @@ -3,7 +3,7 @@ //! Module containing the [`Input`] type. -use iota_types::block::input as iota; +use iota_sdk::types::block::input as iota; use serde::{Deserialize, Serialize}; use super::output::OutputId; @@ -34,7 +34,7 @@ impl From<&iota::Input> for Input { } impl TryFrom for iota::Input { - type Error = iota_types::block::Error; + type Error = iota_sdk::types::block::Error; fn try_from(value: Input) -> Result { Ok(match value { @@ -63,7 +63,7 @@ impl From for iota::dto::InputDto { #[cfg(feature = "rand")] mod rand { - use iota_types::block::rand::{ + use iota_sdk::types::block::rand::{ input::{rand_treasury_input, rand_utxo_input}, number::rand_number_range, }; diff --git a/src/model/block/payload/transaction/mod.rs b/src/model/block/payload/transaction/mod.rs index ae273d7f8..fe43a402c 100644 --- a/src/model/block/payload/transaction/mod.rs +++ b/src/model/block/payload/transaction/mod.rs @@ -5,7 +5,7 @@ use std::{borrow::Borrow, str::FromStr}; -use iota_types::block::{output::InputsCommitment, payload::transaction as iota}; +use iota_sdk::types::block::{output::InputsCommitment, payload::transaction as iota}; use mongodb::bson::{spec::BinarySubtype, Binary, Bson}; use serde::{Deserialize, Serialize}; @@ -44,7 +44,7 @@ impl From for iota::TransactionId { } impl FromStr for TransactionId { - type Err = iota_types::block::Error; + type Err = iota_sdk::types::block::Error; fn from_str(s: &str) -> Result { Ok(iota::TransactionId::from_str(s)?.into()) @@ -89,15 +89,15 @@ impl> From for TransactionPayload { } impl TryFromWithContext for iota::TransactionPayload { - type Error = iota_types::block::Error; + type Error = iota_sdk::types::block::Error; fn try_from_with_context( - ctx: &iota_types::block::protocol::ProtocolParameters, + ctx: &iota_sdk::types::block::protocol::ProtocolParameters, value: TransactionPayload, ) -> Result { iota::TransactionPayload::new( value.essence.try_into_with_context(ctx)?, - iota_types::block::unlock::Unlocks::new( + iota_sdk::types::block::unlock::Unlocks::new( value .unlocks .into_vec() @@ -109,13 +109,15 @@ impl TryFromWithContext for iota::TransactionPayload { } } -impl From for iota::dto::TransactionPayloadDto { - fn from(value: TransactionPayload) -> Self { - Self { +impl TryFrom for iota::dto::TransactionPayloadDto { + type Error = iota_sdk::types::block::Error; + + fn try_from(value: TransactionPayload) -> Result { + Ok(Self { kind: iota::TransactionPayload::KIND, - essence: value.essence.into(), + essence: value.essence.try_into()?, unlocks: value.unlocks.into_vec().into_iter().map(Into::into).collect(), - } + }) } } @@ -163,10 +165,10 @@ impl> From for TransactionEssence { } impl TryFromWithContext for iota::TransactionEssence { - type Error = iota_types::block::Error; + type Error = iota_sdk::types::block::Error; fn try_from_with_context( - ctx: &iota_types::block::protocol::ProtocolParameters, + ctx: &iota_sdk::types::block::protocol::ProtocolParameters, value: TransactionEssence, ) -> Result { Ok(match value { @@ -179,7 +181,7 @@ impl TryFromWithContext for iota::TransactionEssence { } => { let mut builder = iota::RegularTransactionEssence::builder( ctx.network_id(), - iota_types::block::output::InputsCommitment::from(inputs_commitment), + iota_sdk::types::block::output::InputsCommitment::from(inputs_commitment), ) .with_inputs( inputs @@ -196,17 +198,20 @@ impl TryFromWithContext for iota::TransactionEssence { .collect::, _>>()?, ); if let Some(payload) = payload { - builder = builder.with_payload(payload.try_into_with_context(ctx)?); + let payload: iota_sdk::types::block::payload::Payload = payload.try_into_with_context(ctx)?; + builder = builder.with_payload(payload); } - iota::TransactionEssence::Regular(builder.finish(ctx)?) + iota::TransactionEssence::Regular(builder.finish()?) } }) } } -impl From for iota::dto::TransactionEssenceDto { - fn from(value: TransactionEssence) -> Self { - match value { +impl TryFrom for iota::dto::TransactionEssenceDto { + type Error = iota_sdk::types::block::Error; + + fn try_from(value: TransactionEssence) -> Result { + Ok(match value { TransactionEssence::Regular { network_id, inputs, @@ -218,16 +223,20 @@ impl From for iota::dto::TransactionEssenceDto { network_id: network_id.to_string(), inputs: inputs.into_vec().into_iter().map(Into::into).collect(), inputs_commitment: prefix_hex::encode(inputs_commitment), - outputs: outputs.into_vec().into_iter().map(Into::into).collect(), - payload: payload.map(Into::into), + outputs: outputs + .into_vec() + .into_iter() + .map(TryInto::try_into) + .collect::, _>>()?, + payload: payload.map(TryInto::try_into).transpose()?, }), - } + }) } } #[cfg(feature = "rand")] mod rand { - use iota_types::block::rand::{ + use iota_sdk::types::block::rand::{ bytes::rand_bytes_array, number::{rand_number, rand_number_range}, output::rand_inputs_commitment, @@ -244,7 +253,7 @@ mod rand { impl TransactionEssence { /// Generates a random [`TransactionEssence`]. - pub fn rand(ctx: &iota_types::block::protocol::ProtocolParameters) -> Self { + pub fn rand(ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Self { Self::Regular { network_id: rand_number(), inputs: std::iter::repeat_with(Input::rand) @@ -265,7 +274,7 @@ mod rand { impl TransactionPayload { /// Generates a random [`TransactionPayload`]. - pub fn rand(ctx: &iota_types::block::protocol::ProtocolParameters) -> Self { + pub fn rand(ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Self { Self { transaction_id: TransactionId::rand(), essence: TransactionEssence::rand(ctx), @@ -293,7 +302,7 @@ mod test { #[test] fn test_transaction_payload_bson() { - let ctx = iota_types::block::protocol::protocol_parameters(); + let ctx = iota_sdk::types::block::protocol::protocol_parameters(); let payload = TransactionPayload::rand(&ctx); let mut bson = to_bson(&payload).unwrap(); // Need to re-add outputs as they are not serialized diff --git a/src/model/block/payload/transaction/output/address/alias.rs b/src/model/block/payload/transaction/output/address/alias.rs index 45f8f7c80..94320bab7 100644 --- a/src/model/block/payload/transaction/output/address/alias.rs +++ b/src/model/block/payload/transaction/output/address/alias.rs @@ -3,7 +3,7 @@ use std::str::FromStr; -use iota_types::block::address as iota; +use iota_sdk::types::block::address as iota; use mongodb::bson::Bson; use serde::{Deserialize, Serialize}; @@ -33,7 +33,7 @@ impl From for iota::dto::AliasAddressDto { } impl FromStr for AliasAddress { - type Err = iota_types::block::Error; + type Err = iota_sdk::types::block::Error; fn from_str(s: &str) -> Result { Ok(iota::AliasAddress::from_str(s)?.into()) @@ -49,7 +49,7 @@ impl From for Bson { #[cfg(feature = "rand")] mod rand { - use iota_types::block::rand::address::rand_alias_address; + use iota_sdk::types::block::rand::address::rand_alias_address; use super::*; diff --git a/src/model/block/payload/transaction/output/address/ed25519.rs b/src/model/block/payload/transaction/output/address/ed25519.rs index c0d641d21..f150ae176 100644 --- a/src/model/block/payload/transaction/output/address/ed25519.rs +++ b/src/model/block/payload/transaction/output/address/ed25519.rs @@ -3,7 +3,7 @@ use std::str::FromStr; -use iota_types::block::address as iota; +use iota_sdk::types::block::address as iota; use mongodb::bson::{spec::BinarySubtype, Binary, Bson}; use serde::{Deserialize, Serialize}; @@ -37,7 +37,7 @@ impl From for iota::dto::Ed25519AddressDto { } impl FromStr for Ed25519Address { - type Err = iota_types::block::Error; + type Err = iota_sdk::types::block::Error; fn from_str(s: &str) -> Result { Ok(iota::Ed25519Address::from_str(s)?.into()) @@ -56,7 +56,7 @@ impl From for Bson { #[cfg(feature = "rand")] mod rand { - use iota_types::block::rand::address::rand_ed25519_address; + use iota_sdk::types::block::rand::address::rand_ed25519_address; use super::*; diff --git a/src/model/block/payload/transaction/output/address/mod.rs b/src/model/block/payload/transaction/output/address/mod.rs index e1cbfb68d..7df073896 100644 --- a/src/model/block/payload/transaction/output/address/mod.rs +++ b/src/model/block/payload/transaction/output/address/mod.rs @@ -5,7 +5,7 @@ use std::str::FromStr; -use iota_types::block::address as iota; +use iota_sdk::types::block::address as iota; use mongodb::bson::{doc, Bson}; use serde::{Deserialize, Serialize}; @@ -68,10 +68,10 @@ impl From
for iota::dto::AddressDto { } impl FromStr for Address { - type Err = iota_types::block::Error; + type Err = iota_sdk::types::block::Error; fn from_str(s: &str) -> Result { - Ok(iota::Address::try_from_bech32(s)?.1.into()) + Ok(iota::Address::try_from_bech32(s)?.into()) } } diff --git a/src/model/block/payload/transaction/output/address/nft.rs b/src/model/block/payload/transaction/output/address/nft.rs index 158bb4914..4ad18c32c 100644 --- a/src/model/block/payload/transaction/output/address/nft.rs +++ b/src/model/block/payload/transaction/output/address/nft.rs @@ -3,7 +3,7 @@ use std::str::FromStr; -use iota_types::block::address as iota; +use iota_sdk::types::block::address as iota; use mongodb::bson::Bson; use serde::{Deserialize, Serialize}; @@ -33,7 +33,7 @@ impl From for iota::dto::NftAddressDto { } impl FromStr for NftAddress { - type Err = iota_types::block::Error; + type Err = iota_sdk::types::block::Error; fn from_str(s: &str) -> Result { Ok(iota::NftAddress::from_str(s)?.into()) @@ -49,7 +49,7 @@ impl From for Bson { #[cfg(feature = "rand")] mod rand { - use iota_types::block::rand::address::rand_nft_address; + use iota_sdk::types::block::rand::address::rand_nft_address; use super::*; diff --git a/src/model/block/payload/transaction/output/alias.rs b/src/model/block/payload/transaction/output/alias.rs index 54790616e..b06662e64 100644 --- a/src/model/block/payload/transaction/output/alias.rs +++ b/src/model/block/payload/transaction/output/alias.rs @@ -5,7 +5,7 @@ use std::{borrow::Borrow, str::FromStr}; -use iota_types::block::output as iota; +use iota_sdk::types::block::output as iota; use mongodb::bson::{spec::BinarySubtype, Binary, Bson}; use serde::{Deserialize, Serialize}; @@ -15,7 +15,7 @@ use super::{ unlock_condition::{GovernorAddressUnlockCondition, StateControllerAddressUnlockCondition}, OutputId, TokenAmount, }; -use crate::model::{bytify, TryFromWithContext}; +use crate::model::bytify; /// Uniquely identifies an Alias. #[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Hash)] @@ -26,7 +26,7 @@ impl AliasId { const LENGTH: usize = iota::AliasId::LENGTH; /// The [`AliasId`] is derived from the [`OutputId`](super::OutputId) that created the alias. - pub fn from_output_id_str(s: &str) -> Result { + pub fn from_output_id_str(s: &str) -> Result { Ok(iota::AliasId::from(&iota::OutputId::from_str(s)?).into()) } @@ -48,12 +48,6 @@ impl From for iota::AliasId { } } -impl From for iota::dto::AliasIdDto { - fn from(value: AliasId) -> Self { - Into::into(&iota::AliasId::from(value)) - } -} - impl From for AliasId { fn from(value: OutputId) -> Self { Self(value.hash()) @@ -61,7 +55,7 @@ impl From for AliasId { } impl FromStr for AliasId { - type Err = iota_types::block::Error; + type Err = iota_sdk::types::block::Error; fn from_str(s: &str) -> Result { Ok(iota::AliasId::from_str(s)?.into()) @@ -135,28 +129,22 @@ impl> From for AliasOutput { } } -impl TryFromWithContext for iota::AliasOutput { - type Error = iota_types::block::Error; +impl TryFrom for iota::AliasOutput { + type Error = iota_sdk::types::block::Error; - fn try_from_with_context( - ctx: &iota_types::block::protocol::ProtocolParameters, - value: AliasOutput, - ) -> Result { + fn try_from(value: AliasOutput) -> Result { // The order of the conditions is important here because unlock conditions have to be sorted by type. let unlock_conditions = [ - Some( + iota::unlock_condition::UnlockCondition::from( iota::unlock_condition::StateControllerAddressUnlockCondition::from( value.state_controller_address_unlock_condition, - ) - .into(), - ), - Some( - iota::unlock_condition::GovernorAddressUnlockCondition::from(value.governor_address_unlock_condition) - .into(), + ), ), + iota::unlock_condition::GovernorAddressUnlockCondition::from(value.governor_address_unlock_condition) + .into(), ]; - Self::build_with_amount(value.amount.0, value.alias_id.into())? + Self::build_with_amount(value.amount.0, value.alias_id.into()) .with_native_tokens( value .native_tokens @@ -166,16 +154,16 @@ impl TryFromWithContext for iota::AliasOutput { .collect::, _>>()?, ) .with_state_index(value.state_index) - .with_state_metadata(value.state_metadata.into()) + .with_state_metadata(value.state_metadata) .with_foundry_counter(value.foundry_counter) - .with_unlock_conditions(unlock_conditions.into_iter().flatten()) + .with_unlock_conditions(unlock_conditions) .with_features( value .features .into_vec() .into_iter() .map(TryInto::try_into) - .collect::, _>>()?, + .collect::, _>>()?, ) .with_immutable_features( value @@ -183,14 +171,16 @@ impl TryFromWithContext for iota::AliasOutput { .into_vec() .into_iter() .map(TryInto::try_into) - .collect::, _>>()?, + .collect::, _>>()?, ) - .finish(ctx.token_supply()) + .finish() } } -impl From for iota::dto::AliasOutputDto { - fn from(value: AliasOutput) -> Self { +impl TryFrom for iota::dto::AliasOutputDto { + type Error = iota_sdk::types::block::Error; + + fn try_from(value: AliasOutput) -> Result { let unlock_conditions = vec![ iota::unlock_condition::dto::UnlockConditionDto::StateControllerAddress( value.state_controller_address_unlock_condition.into(), @@ -199,13 +189,18 @@ impl From for iota::dto::AliasOutputDto { value.governor_address_unlock_condition.into(), ), ]; - Self { + Ok(Self { kind: iota::AliasOutput::KIND, amount: value.amount.0.to_string(), - native_tokens: value.native_tokens.into_vec().into_iter().map(Into::into).collect(), + native_tokens: value + .native_tokens + .into_vec() + .into_iter() + .map(TryInto::try_into) + .collect::, _>>()?, alias_id: value.alias_id.into(), state_index: value.state_index, - state_metadata: prefix_hex::encode(value.state_metadata), + state_metadata: value.state_metadata, foundry_counter: value.foundry_counter, unlock_conditions, features: value.features.into_vec().into_iter().map(Into::into).collect(), @@ -215,13 +210,13 @@ impl From for iota::dto::AliasOutputDto { .into_iter() .map(Into::into) .collect(), - } + }) } } #[cfg(feature = "rand")] mod rand { - use iota_types::block::rand::output::{rand_alias_id, rand_alias_output}; + use iota_sdk::types::block::rand::output::{rand_alias_id, rand_alias_output}; use super::*; @@ -234,7 +229,7 @@ mod rand { impl AliasOutput { /// Generates a random [`AliasOutput`]. - pub fn rand(ctx: &iota_types::block::protocol::ProtocolParameters) -> Self { + pub fn rand(ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Self { rand_alias_output(ctx.token_supply()).into() } } @@ -256,9 +251,9 @@ mod test { #[test] fn test_alias_output_bson() { - let ctx = iota_types::block::protocol::protocol_parameters(); + let ctx = iota_sdk::types::block::protocol::protocol_parameters(); let output = AliasOutput::rand(&ctx); - iota::AliasOutput::try_from_with_context(&ctx, output.clone()).unwrap(); + iota::AliasOutput::try_from(output.clone()).unwrap(); let bson = to_bson(&output).unwrap(); assert_eq!(output, from_bson::(bson).unwrap()); } diff --git a/src/model/block/payload/transaction/output/basic.rs b/src/model/block/payload/transaction/output/basic.rs index 8e7f9016b..55c21816c 100644 --- a/src/model/block/payload/transaction/output/basic.rs +++ b/src/model/block/payload/transaction/output/basic.rs @@ -5,7 +5,7 @@ use std::borrow::Borrow; -use iota_types::block::output as iota; +use iota_sdk::types::block::output as iota; use serde::{Deserialize, Serialize}; use super::{ @@ -60,15 +60,17 @@ impl> From for BasicOutput { } impl TryFromWithContext for iota::BasicOutput { - type Error = iota_types::block::Error; + type Error = iota_sdk::types::block::Error; fn try_from_with_context( - ctx: &iota_types::block::protocol::ProtocolParameters, + ctx: &iota_sdk::types::block::protocol::ProtocolParameters, value: BasicOutput, ) -> Result { // The order of the conditions is imporant here because unlock conditions have to be sorted by type. let unlock_conditions = [ - Some(iota::unlock_condition::AddressUnlockCondition::from(value.address_unlock_condition).into()), + Some(iota::unlock_condition::UnlockCondition::from( + iota::unlock_condition::AddressUnlockCondition::from(value.address_unlock_condition), + )), value .storage_deposit_return_unlock_condition .map(|x| iota::unlock_condition::StorageDepositReturnUnlockCondition::try_from_with_context(ctx, x)) @@ -86,7 +88,7 @@ impl TryFromWithContext for iota::BasicOutput { .map(Into::into), ]; - Self::build_with_amount(value.amount.0)? + Self::build_with_amount(value.amount.0) .with_native_tokens( value .native_tokens @@ -101,15 +103,17 @@ impl TryFromWithContext for iota::BasicOutput { .features .into_vec() .into_iter() - .map(TryInto::try_into) + .map(iota::feature::Feature::try_from) .collect::, _>>()?, ) - .finish(ctx.token_supply()) + .finish() } } -impl From for iota::dto::BasicOutputDto { - fn from(value: BasicOutput) -> Self { +impl TryFrom for iota::dto::BasicOutputDto { + type Error = iota_sdk::types::block::Error; + + fn try_from(value: BasicOutput) -> Result { let mut unlock_conditions = vec![iota::unlock_condition::dto::UnlockConditionDto::Address( value.address_unlock_condition.into(), )]; @@ -124,25 +128,30 @@ impl From for iota::dto::BasicOutputDto { if let Some(uc) = value.expiration_unlock_condition { unlock_conditions.push(iota::unlock_condition::dto::UnlockConditionDto::Expiration(uc.into())); } - Self { + Ok(Self { kind: iota::BasicOutput::KIND, amount: value.amount.0.to_string(), - native_tokens: value.native_tokens.into_vec().into_iter().map(Into::into).collect(), + native_tokens: value + .native_tokens + .into_vec() + .into_iter() + .map(TryInto::try_into) + .collect::, _>>()?, unlock_conditions, features: value.features.into_vec().into_iter().map(Into::into).collect(), - } + }) } } #[cfg(feature = "rand")] mod rand { - use iota_types::block::rand::output::rand_basic_output; + use iota_sdk::types::block::rand::output::rand_basic_output; use super::*; impl BasicOutput { /// Generates a random [`BasicOutput`]. - pub fn rand(ctx: &iota_types::block::protocol::ProtocolParameters) -> Self { + pub fn rand(ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Self { rand_basic_output(ctx.token_supply()).into() } } @@ -156,7 +165,7 @@ mod test { #[test] fn test_basic_output_bson() { - let ctx = iota_types::block::protocol::protocol_parameters(); + let ctx = iota_sdk::types::block::protocol::protocol_parameters(); let output = BasicOutput::rand(&ctx); iota::BasicOutput::try_from_with_context(&ctx, output.clone()).unwrap(); let bson = to_bson(&output).unwrap(); diff --git a/src/model/block/payload/transaction/output/feature.rs b/src/model/block/payload/transaction/output/feature.rs index 344ecae56..cdf5929c1 100644 --- a/src/model/block/payload/transaction/output/feature.rs +++ b/src/model/block/payload/transaction/output/feature.rs @@ -5,7 +5,7 @@ use std::borrow::Borrow; -use iota_types::block::output::feature as iota; +use iota_sdk::types::block::output::feature as iota; use serde::{Deserialize, Serialize}; use crate::model::utxo::Address; @@ -58,14 +58,14 @@ impl> From for Feature { } impl TryFrom for iota::Feature { - type Error = iota_types::block::Error; + type Error = iota_sdk::types::block::Error; fn try_from(value: Feature) -> Result { Ok(match value { - Feature::Sender { address } => iota::Feature::Sender(iota::SenderFeature::new(address.into())), - Feature::Issuer { address } => iota::Feature::Issuer(iota::IssuerFeature::new(address.into())), - Feature::Metadata { data } => iota::Feature::Metadata(iota::MetadataFeature::new(data.into())?), - Feature::Tag { data } => iota::Feature::Tag(iota::TagFeature::new(data.into())?), + Feature::Sender { address } => iota::Feature::Sender(iota::SenderFeature::new(address)), + Feature::Issuer { address } => iota::Feature::Issuer(iota::IssuerFeature::new(address)), + Feature::Metadata { data } => iota::Feature::Metadata(iota::MetadataFeature::new(data)?), + Feature::Tag { data } => iota::Feature::Tag(iota::TagFeature::new(data)?), }) } } @@ -83,11 +83,11 @@ impl From for iota::dto::FeatureDto { }), Feature::Metadata { data } => Self::Metadata(iota::dto::MetadataFeatureDto { kind: iota::MetadataFeature::KIND, - data: prefix_hex::encode(data), + data, }), - Feature::Tag { data } => Self::Tag(iota::dto::TagFeatureDto { + Feature::Tag { data: tag } => Self::Tag(iota::dto::TagFeatureDto { kind: iota::TagFeature::KIND, - tag: prefix_hex::encode(data), + tag, }), } } @@ -95,7 +95,7 @@ impl From for iota::dto::FeatureDto { #[cfg(feature = "rand")] mod rand { - use iota_types::block::{ + use iota_sdk::types::block::{ output::feature::FeatureFlags, rand::output::feature::{ rand_allowed_features, rand_issuer_feature, rand_metadata_feature, rand_sender_feature, rand_tag_feature, diff --git a/src/model/block/payload/transaction/output/foundry.rs b/src/model/block/payload/transaction/output/foundry.rs index f84aa735b..0621432bb 100644 --- a/src/model/block/payload/transaction/output/foundry.rs +++ b/src/model/block/payload/transaction/output/foundry.rs @@ -5,12 +5,12 @@ use std::{borrow::Borrow, str::FromStr}; -use iota_types::block::output as iota; +use iota_sdk::types::block::output as iota; use mongodb::bson::{spec::BinarySubtype, Binary, Bson}; use serde::{Deserialize, Serialize}; use super::{unlock_condition::ImmutableAliasAddressUnlockCondition, Feature, NativeToken, TokenAmount, TokenScheme}; -use crate::model::{bytify, stringify, TryFromWithContext}; +use crate::model::{bytify, stringify}; /// The id of a foundry. #[derive(Copy, Clone, Debug, PartialEq, Eq, Serialize, Deserialize, Hash)] @@ -41,7 +41,7 @@ impl From for iota::FoundryId { } impl FromStr for FoundryId { - type Err = iota_types::block::Error; + type Err = iota_sdk::types::block::Error; fn from_str(s: &str) -> Result { Ok(iota::FoundryId::from_str(s)?.into()) @@ -106,19 +106,16 @@ impl> From for FoundryOutput { } } -impl TryFromWithContext for iota::FoundryOutput { - type Error = iota_types::block::Error; +impl TryFrom for iota::FoundryOutput { + type Error = iota_sdk::types::block::Error; - fn try_from_with_context( - ctx: &iota_types::block::protocol::ProtocolParameters, - value: FoundryOutput, - ) -> Result { + fn try_from(value: FoundryOutput) -> Result { let u: iota::UnlockCondition = iota::unlock_condition::ImmutableAliasAddressUnlockCondition::try_from( value.immutable_alias_address_unlock_condition, )? .into(); - Self::build_with_amount(value.amount.0, value.serial_number, value.token_scheme.try_into()?)? + Self::build_with_amount(value.amount.0, value.serial_number, value.token_scheme.try_into()?) .with_native_tokens( value .native_tokens @@ -133,7 +130,7 @@ impl TryFromWithContext for iota::FoundryOutput { .features .into_vec() .into_iter() - .map(TryInto::try_into) + .map(iota::feature::Feature::try_from) .collect::, _>>()?, ) .with_immutable_features( @@ -141,22 +138,29 @@ impl TryFromWithContext for iota::FoundryOutput { .immutable_features .into_vec() .into_iter() - .map(TryInto::try_into) + .map(iota::feature::Feature::try_from) .collect::, _>>()?, ) - .finish(ctx.token_supply()) + .finish() } } -impl From for iota::dto::FoundryOutputDto { - fn from(value: FoundryOutput) -> Self { +impl TryFrom for iota::dto::FoundryOutputDto { + type Error = iota_sdk::types::block::Error; + + fn try_from(value: FoundryOutput) -> Result { let unlock_conditions = vec![iota::unlock_condition::dto::UnlockConditionDto::ImmutableAliasAddress( value.immutable_alias_address_unlock_condition.into(), )]; - Self { + Ok(Self { kind: iota::FoundryOutput::KIND, amount: value.amount.0.to_string(), - native_tokens: value.native_tokens.into_vec().into_iter().map(Into::into).collect(), + native_tokens: value + .native_tokens + .into_vec() + .into_iter() + .map(TryInto::try_into) + .collect::, _>>()?, serial_number: value.serial_number, token_scheme: value.token_scheme.into(), unlock_conditions, @@ -167,13 +171,13 @@ impl From for iota::dto::FoundryOutputDto { .into_iter() .map(Into::into) .collect(), - } + }) } } #[cfg(feature = "rand")] mod rand { - use iota_types::block::rand::{bytes::rand_bytes_array, output::rand_foundry_output}; + use iota_sdk::types::block::rand::{bytes::rand_bytes_array, output::rand_foundry_output}; use super::*; @@ -186,7 +190,7 @@ mod rand { impl FoundryOutput { /// Generates a random [`FoundryOutput`]. - pub fn rand(ctx: &iota_types::block::protocol::ProtocolParameters) -> Self { + pub fn rand(ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Self { rand_foundry_output(ctx.token_supply()).into() } } @@ -200,9 +204,9 @@ mod test { #[test] fn test_foundry_output_bson() { - let ctx = iota_types::block::protocol::protocol_parameters(); + let ctx = iota_sdk::types::block::protocol::protocol_parameters(); let output = FoundryOutput::rand(&ctx); - iota::FoundryOutput::try_from_with_context(&ctx, output.clone()).unwrap(); + iota::FoundryOutput::try_from(output.clone()).unwrap(); let bson = to_bson(&output).unwrap(); assert_eq!(output, from_bson::(bson).unwrap()); } diff --git a/src/model/block/payload/transaction/output/ledger.rs b/src/model/block/payload/transaction/output/ledger.rs index e3a816b66..3a1db0486 100644 --- a/src/model/block/payload/transaction/output/ledger.rs +++ b/src/model/block/payload/transaction/output/ledger.rs @@ -67,16 +67,15 @@ pub struct RentStructureBytes { impl RentStructureBytes { #[allow(missing_docs)] - pub fn compute(output: &iota_types::block::output::Output) -> Self { - use iota_types::block::output::{Rent, RentStructureBuilder}; + pub fn compute(output: &iota_sdk::types::block::output::Output) -> Self { + use iota_sdk::types::block::output::{Rent, RentStructure}; let rent_cost = |byte_cost, data_factor, key_factor| { output.rent_cost( - &RentStructureBuilder::new() - .byte_cost(byte_cost) - .byte_factor_data(data_factor) - .byte_factor_key(key_factor) - .finish(), + &RentStructure::default() + .with_byte_cost(byte_cost) + .with_byte_factor_data(data_factor) + .with_byte_factor_key(key_factor), ) }; @@ -99,7 +98,7 @@ mod inx { fn try_from(value: ::inx::proto::LedgerOutput) -> Result { let data = maybe_missing!(value.output).data; - let bee_output = iota_types::block::output::Output::unpack_unverified(data) + let bee_output = iota_sdk::types::block::output::Output::unpack_unverified(data) .map_err(|e| InxError::InvalidRawBytes(format!("{e:?}")))?; Ok(Self { @@ -139,7 +138,7 @@ mod inx { mod test { #[cfg(feature = "rand")] impl super::RentStructureBytes { - fn rent_cost(&self, config: &iota_types::block::output::RentStructure) -> u64 { + fn rent_cost(&self, config: &iota_sdk::types::block::output::RentStructure) -> u64 { (self.num_data_bytes * config.byte_factor_data() as u64 + self.num_key_bytes * config.byte_factor_key() as u64) * config.byte_cost() as u64 @@ -149,11 +148,11 @@ mod test { #[cfg(feature = "rand")] #[test] fn test_compute_rent_structure() { - use iota_types::block::{output::Rent, rand::output}; + use iota_sdk::types::block::{output::Rent, rand::output}; use super::RentStructureBytes; - let protocol_params = iota_types::block::protocol::protocol_parameters(); + let protocol_params = iota_sdk::types::block::protocol::protocol_parameters(); let outputs = [ output::rand_basic_output(protocol_params.token_supply()).into(), diff --git a/src/model/block/payload/transaction/output/mod.rs b/src/model/block/payload/transaction/output/mod.rs index 71f62a671..d5dbaa0f0 100644 --- a/src/model/block/payload/transaction/output/mod.rs +++ b/src/model/block/payload/transaction/output/mod.rs @@ -18,7 +18,7 @@ pub mod unlock_condition; use std::{borrow::Borrow, str::FromStr}; use crypto::hashes::{blake2b::Blake2b256, Digest}; -use iota_types::block::output as iota; +use iota_sdk::types::block::output as iota; use mongodb::bson::{doc, Bson}; use packable::PackableExt; use serde::{Deserialize, Serialize}; @@ -101,7 +101,7 @@ impl From for OutputId { } impl TryFrom for iota::OutputId { - type Error = iota_types::block::Error; + type Error = iota_sdk::types::block::Error; fn try_from(value: OutputId) -> Result { iota::OutputId::new(value.transaction_id.into(), value.index) @@ -109,7 +109,7 @@ impl TryFrom for iota::OutputId { } impl FromStr for OutputId { - type Err = iota_types::block::Error; + type Err = iota_sdk::types::block::Error; fn from_str(s: &str) -> Result { Ok(iota::OutputId::from_str(s)?.into()) @@ -205,8 +205,8 @@ impl Output { } /// Converts the [`Output`] into its raw byte representation. - pub fn raw(self, ctx: ProtocolParameters) -> Result, iota_types::block::Error> { - let bee_output = iota_types::block::output::Output::try_from_with_context(&ctx.try_into()?, self)?; + pub fn raw(self, ctx: ProtocolParameters) -> Result, iota_sdk::types::block::Error> { + let bee_output = iota_sdk::types::block::output::Output::try_from_with_context(&ctx.try_into()?, self)?; Ok(bee_output.pack_to_vec()) } @@ -235,31 +235,33 @@ impl> From for Output { } impl TryFromWithContext for iota::Output { - type Error = iota_types::block::Error; + type Error = iota_sdk::types::block::Error; fn try_from_with_context( - ctx: &iota_types::block::protocol::ProtocolParameters, + ctx: &iota_sdk::types::block::protocol::ProtocolParameters, value: Output, ) -> Result { Ok(match value { Output::Treasury(o) => iota::Output::Treasury(o.try_into_with_context(ctx)?), Output::Basic(o) => iota::Output::Basic(o.try_into_with_context(ctx)?), - Output::Alias(o) => iota::Output::Alias(o.try_into_with_context(ctx)?), - Output::Foundry(o) => iota::Output::Foundry(o.try_into_with_context(ctx)?), + Output::Alias(o) => iota::Output::Alias(o.try_into()?), + Output::Foundry(o) => iota::Output::Foundry(o.try_into()?), Output::Nft(o) => iota::Output::Nft(o.try_into_with_context(ctx)?), }) } } -impl From for iota::dto::OutputDto { - fn from(value: Output) -> Self { - match value { +impl TryFrom for iota::dto::OutputDto { + type Error = iota_sdk::types::block::Error; + + fn try_from(value: Output) -> Result { + Ok(match value { Output::Treasury(o) => Self::Treasury(o.into()), - Output::Basic(o) => Self::Basic(o.into()), - Output::Alias(o) => Self::Alias(o.into()), - Output::Foundry(o) => Self::Foundry(o.into()), - Output::Nft(o) => Self::Nft(o.into()), - } + Output::Basic(o) => Self::Basic(o.try_into()?), + Output::Alias(o) => Self::Alias(o.try_into()?), + Output::Foundry(o) => Self::Foundry(o.try_into()?), + Output::Nft(o) => Self::Nft(o.try_into()?), + }) } } @@ -305,13 +307,13 @@ impl From for Bson { #[cfg(feature = "rand")] mod rand { - use iota_types::block::rand::{number::rand_number_range, output::rand_output_id}; + use iota_sdk::types::block::rand::{number::rand_number_range, output::rand_output_id}; use super::*; impl TokenAmount { /// Generates a random [`TokenAmount`]. - pub fn rand(ctx: &iota_types::block::protocol::ProtocolParameters) -> Self { + pub fn rand(ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Self { rand_number_range(iota::Output::AMOUNT_MIN..ctx.token_supply()).into() } } @@ -325,7 +327,7 @@ mod rand { impl Output { /// Generates a random [`Output`]. - pub fn rand(ctx: &iota_types::block::protocol::ProtocolParameters) -> Self { + pub fn rand(ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Self { match rand_number_range(0..4) { 0 => Self::rand_basic(ctx), 1 => Self::rand_alias(ctx), @@ -337,27 +339,27 @@ mod rand { } /// Generates a random basic [`Output`]. - pub fn rand_basic(ctx: &iota_types::block::protocol::ProtocolParameters) -> Self { + pub fn rand_basic(ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Self { Self::Basic(BasicOutput::rand(ctx)) } /// Generates a random alias [`Output`]. - pub fn rand_alias(ctx: &iota_types::block::protocol::ProtocolParameters) -> Self { + pub fn rand_alias(ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Self { Self::Alias(AliasOutput::rand(ctx)) } /// Generates a random nft [`Output`]. - pub fn rand_nft(ctx: &iota_types::block::protocol::ProtocolParameters) -> Self { + pub fn rand_nft(ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Self { Self::Nft(NftOutput::rand(ctx)) } /// Generates a random foundry [`Output`]. - pub fn rand_foundry(ctx: &iota_types::block::protocol::ProtocolParameters) -> Self { + pub fn rand_foundry(ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Self { Self::Foundry(FoundryOutput::rand(ctx)) } /// Generates a random treasury [`Output`]. - pub fn rand_treasury(ctx: &iota_types::block::protocol::ProtocolParameters) -> Self { + pub fn rand_treasury(ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Self { Self::Treasury(TreasuryOutput::rand(ctx)) } } @@ -378,7 +380,7 @@ mod test { #[test] fn test_basic_output_bson() { - let ctx = iota_types::block::protocol::protocol_parameters(); + let ctx = iota_sdk::types::block::protocol::protocol_parameters(); let output = Output::rand_basic(&ctx); iota::Output::try_from_with_context(&ctx, output.clone()).unwrap(); let bson = to_bson(&output).unwrap(); @@ -388,7 +390,7 @@ mod test { #[test] fn test_alias_output_bson() { - let ctx = iota_types::block::protocol::protocol_parameters(); + let ctx = iota_sdk::types::block::protocol::protocol_parameters(); let output = Output::rand_alias(&ctx); iota::Output::try_from_with_context(&ctx, output.clone()).unwrap(); let bson = to_bson(&output).unwrap(); @@ -398,7 +400,7 @@ mod test { #[test] fn test_nft_output_bson() { - let ctx = iota_types::block::protocol::protocol_parameters(); + let ctx = iota_sdk::types::block::protocol::protocol_parameters(); let output = Output::rand_nft(&ctx); iota::Output::try_from_with_context(&ctx, output.clone()).unwrap(); let bson = to_bson(&output).unwrap(); @@ -408,7 +410,7 @@ mod test { #[test] fn test_foundry_output_bson() { - let ctx = iota_types::block::protocol::protocol_parameters(); + let ctx = iota_sdk::types::block::protocol::protocol_parameters(); let output = Output::rand_foundry(&ctx); iota::Output::try_from_with_context(&ctx, output.clone()).unwrap(); let bson = to_bson(&output).unwrap(); @@ -421,7 +423,7 @@ mod test { #[test] fn test_treasury_output_bson() { - let ctx = iota_types::block::protocol::protocol_parameters(); + let ctx = iota_sdk::types::block::protocol::protocol_parameters(); let output = Output::rand_treasury(&ctx); iota::Output::try_from_with_context(&ctx, output.clone()).unwrap(); let bson = to_bson(&output).unwrap(); diff --git a/src/model/block/payload/transaction/output/native_token.rs b/src/model/block/payload/transaction/output/native_token.rs index 25d281fb8..e8a644818 100644 --- a/src/model/block/payload/transaction/output/native_token.rs +++ b/src/model/block/payload/transaction/output/native_token.rs @@ -5,7 +5,7 @@ use std::{borrow::Borrow, mem::size_of, str::FromStr}; -use iota_types::block::output as iota; +use iota_sdk::types::block::output as iota; use primitive_types::U256; use serde::{Deserialize, Serialize}; @@ -30,12 +30,6 @@ impl From for U256 { } } -impl From for iota_types::block::dto::U256Dto { - fn from(value: NativeTokenAmount) -> Self { - Into::into(&U256::from(value)) - } -} - /// A unique native token identifier. #[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)] #[serde(transparent)] @@ -57,14 +51,8 @@ impl From for iota::TokenId { } } -impl From for iota::dto::TokenIdDto { - fn from(value: NativeTokenId) -> Self { - Into::into(&iota::TokenId::from(value)) - } -} - impl FromStr for NativeTokenId { - type Err = iota_types::block::Error; + type Err = iota_sdk::types::block::Error; fn from_str(s: &str) -> Result { Ok(iota::TokenId::from_str(s)?.into()) @@ -99,7 +87,7 @@ impl> From for TokenScheme { } impl TryFrom for iota::TokenScheme { - type Error = iota_types::block::Error; + type Error = iota_sdk::types::block::Error; fn try_from(value: TokenScheme) -> Result { Ok(match value { @@ -108,9 +96,9 @@ impl TryFrom for iota::TokenScheme { melted_tokens, maximum_supply, } => iota::TokenScheme::Simple(iota::SimpleTokenScheme::new( - minted_tokens.into(), - melted_tokens.into(), - maximum_supply.into(), + minted_tokens, + melted_tokens, + maximum_supply, )?), }) } @@ -152,25 +140,16 @@ impl> From for NativeToken { } impl TryFrom for iota::NativeToken { - type Error = iota_types::block::Error; + type Error = iota_sdk::types::block::Error; fn try_from(value: NativeToken) -> Result { - Self::new(value.token_id.into(), value.amount.into()) - } -} - -impl From for iota::dto::NativeTokenDto { - fn from(value: NativeToken) -> Self { - Self { - token_id: value.token_id.into(), - amount: value.amount.into(), - } + Self::new(value.token_id.into(), value.amount) } } #[cfg(feature = "rand")] mod rand { - use iota_types::block::rand::{ + use iota_sdk::types::block::rand::{ bytes::{rand_bytes, rand_bytes_array}, output::rand_token_scheme, }; diff --git a/src/model/block/payload/transaction/output/nft.rs b/src/model/block/payload/transaction/output/nft.rs index 4d18c7045..d746ff789 100644 --- a/src/model/block/payload/transaction/output/nft.rs +++ b/src/model/block/payload/transaction/output/nft.rs @@ -5,7 +5,7 @@ use std::{borrow::Borrow, str::FromStr}; -use iota_types::block::output as iota; +use iota_sdk::types::block::output as iota; use mongodb::bson::{spec::BinarySubtype, Binary, Bson}; use serde::{Deserialize, Serialize}; @@ -26,7 +26,7 @@ impl NftId { const LENGTH: usize = iota::NftId::LENGTH; /// The [`NftId`] is derived from the [`super::OutputId`] that created the alias. - pub fn from_output_id_str(s: &str) -> Result { + pub fn from_output_id_str(s: &str) -> Result { Ok(iota::NftId::from(&iota::OutputId::from_str(s)?).into()) } @@ -54,14 +54,8 @@ impl From for iota::NftId { } } -impl From for iota::dto::NftIdDto { - fn from(value: NftId) -> Self { - Into::into(&iota::NftId::from(value)) - } -} - impl FromStr for NftId { - type Err = iota_types::block::Error; + type Err = iota_sdk::types::block::Error; fn from_str(s: &str) -> Result { Ok(iota::NftId::from_str(s)?.into()) @@ -128,15 +122,17 @@ impl> From for NftOutput { } impl TryFromWithContext for iota::NftOutput { - type Error = iota_types::block::Error; + type Error = iota_sdk::types::block::Error; fn try_from_with_context( - ctx: &iota_types::block::protocol::ProtocolParameters, + ctx: &iota_sdk::types::block::protocol::ProtocolParameters, value: NftOutput, ) -> Result { // The order of the conditions is imporant here because unlock conditions have to be sorted by type. let unlock_conditions = [ - Some(iota::unlock_condition::AddressUnlockCondition::from(value.address_unlock_condition).into()), + Some(iota::unlock_condition::UnlockCondition::from( + iota::unlock_condition::AddressUnlockCondition::from(value.address_unlock_condition), + )), value .storage_deposit_return_unlock_condition .map(|x| iota::unlock_condition::StorageDepositReturnUnlockCondition::try_from_with_context(ctx, x)) @@ -154,7 +150,7 @@ impl TryFromWithContext for iota::NftOutput { .map(Into::into), ]; - Self::build_with_amount(value.amount.0, value.nft_id.into())? + Self::build_with_amount(value.amount.0, value.nft_id.into()) .with_native_tokens( value .native_tokens @@ -169,7 +165,7 @@ impl TryFromWithContext for iota::NftOutput { .features .into_vec() .into_iter() - .map(TryInto::try_into) + .map(iota::feature::Feature::try_from) .collect::, _>>()?, ) .with_immutable_features( @@ -177,15 +173,17 @@ impl TryFromWithContext for iota::NftOutput { .immutable_features .into_vec() .into_iter() - .map(TryInto::try_into) + .map(iota::feature::Feature::try_from) .collect::, _>>()?, ) - .finish(ctx.token_supply()) + .finish() } } -impl From for iota::dto::NftOutputDto { - fn from(value: NftOutput) -> Self { +impl TryFrom for iota::dto::NftOutputDto { + type Error = iota_sdk::types::block::Error; + + fn try_from(value: NftOutput) -> Result { let mut unlock_conditions = vec![iota::unlock_condition::dto::UnlockConditionDto::Address( value.address_unlock_condition.into(), )]; @@ -200,10 +198,15 @@ impl From for iota::dto::NftOutputDto { if let Some(uc) = value.expiration_unlock_condition { unlock_conditions.push(iota::unlock_condition::dto::UnlockConditionDto::Expiration(uc.into())); } - Self { + Ok(Self { kind: iota::NftOutput::KIND, amount: value.amount.0.to_string(), - native_tokens: value.native_tokens.into_vec().into_iter().map(Into::into).collect(), + native_tokens: value + .native_tokens + .into_vec() + .into_iter() + .map(TryInto::try_into) + .collect::, _>>()?, nft_id: value.nft_id.into(), unlock_conditions, features: value.features.into_vec().into_iter().map(Into::into).collect(), @@ -213,13 +216,13 @@ impl From for iota::dto::NftOutputDto { .into_iter() .map(Into::into) .collect(), - } + }) } } #[cfg(feature = "rand")] mod rand { - use iota_types::block::rand::{bytes::rand_bytes_array, output::rand_nft_output}; + use iota_sdk::types::block::rand::{bytes::rand_bytes_array, output::rand_nft_output}; use super::*; @@ -232,7 +235,7 @@ mod rand { impl NftOutput { /// Generates a random [`NftOutput`]. - pub fn rand(ctx: &iota_types::block::protocol::ProtocolParameters) -> Self { + pub fn rand(ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Self { rand_nft_output(ctx.token_supply()).into() } } @@ -254,7 +257,7 @@ mod test { #[test] fn test_nft_output_bson() { - let ctx = iota_types::block::protocol::protocol_parameters(); + let ctx = iota_sdk::types::block::protocol::protocol_parameters(); let output = NftOutput::rand(&ctx); iota::NftOutput::try_from_with_context(&ctx, output.clone()).unwrap(); let bson = to_bson(&output).unwrap(); diff --git a/src/model/block/payload/transaction/output/treasury.rs b/src/model/block/payload/transaction/output/treasury.rs index c51a445d8..ea91ddcc3 100644 --- a/src/model/block/payload/transaction/output/treasury.rs +++ b/src/model/block/payload/transaction/output/treasury.rs @@ -5,7 +5,7 @@ use std::borrow::Borrow; -use iota_types::block::output as iota; +use iota_sdk::types::block::output as iota; use serde::{Deserialize, Serialize}; use super::TokenAmount; @@ -32,10 +32,10 @@ impl> From for TreasuryOutput { } impl TryFromWithContext for iota::TreasuryOutput { - type Error = iota_types::block::Error; + type Error = iota_sdk::types::block::Error; fn try_from_with_context( - ctx: &iota_types::block::protocol::ProtocolParameters, + ctx: &iota_sdk::types::block::protocol::ProtocolParameters, value: TreasuryOutput, ) -> Result { Self::new(value.amount.0, ctx.token_supply()) @@ -53,13 +53,13 @@ impl From for iota::dto::TreasuryOutputDto { #[cfg(feature = "rand")] mod rand { - use iota_types::block::rand::output::rand_treasury_output; + use iota_sdk::types::block::rand::output::rand_treasury_output; use super::*; impl TreasuryOutput { /// Generates a random [`TreasuryOutput`]. - pub fn rand(ctx: &iota_types::block::protocol::ProtocolParameters) -> Self { + pub fn rand(ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Self { rand_treasury_output(ctx.token_supply()).into() } } @@ -73,7 +73,7 @@ mod test { #[test] fn test_treasury_output_bson() { - let ctx = iota_types::block::protocol::protocol_parameters(); + let ctx = iota_sdk::types::block::protocol::protocol_parameters(); let output = TreasuryOutput::rand(&ctx); iota::TreasuryOutput::try_from_with_context(&ctx, output).unwrap(); let bson = to_bson(&output).unwrap(); diff --git a/src/model/block/payload/transaction/output/unlock_condition/address.rs b/src/model/block/payload/transaction/output/unlock_condition/address.rs index 62ea95df7..d305b7dfd 100644 --- a/src/model/block/payload/transaction/output/unlock_condition/address.rs +++ b/src/model/block/payload/transaction/output/unlock_condition/address.rs @@ -5,7 +5,7 @@ use std::borrow::Borrow; -use iota_types::block::output::unlock_condition as iota; +use iota_sdk::types::block::output::unlock_condition as iota; use serde::{Deserialize, Serialize}; use crate::model::utxo::Address; @@ -27,7 +27,7 @@ impl> From for AddressUnlockCondition impl From for iota::AddressUnlockCondition { fn from(value: AddressUnlockCondition) -> Self { - Self::new(value.address.into()) + Self::new(value.address) } } diff --git a/src/model/block/payload/transaction/output/unlock_condition/expiration.rs b/src/model/block/payload/transaction/output/unlock_condition/expiration.rs index 8bd5b922d..248322d80 100644 --- a/src/model/block/payload/transaction/output/unlock_condition/expiration.rs +++ b/src/model/block/payload/transaction/output/unlock_condition/expiration.rs @@ -5,7 +5,7 @@ use std::borrow::Borrow; -use iota_types::block::output::unlock_condition as iota; +use iota_sdk::types::block::output::unlock_condition as iota; use serde::{Deserialize, Serialize}; use crate::model::{tangle::MilestoneTimestamp, utxo::Address}; @@ -28,10 +28,10 @@ impl> From for ExpirationUnlockCon } impl TryFrom for iota::ExpirationUnlockCondition { - type Error = iota_types::block::Error; + type Error = iota_sdk::types::block::Error; fn try_from(value: ExpirationUnlockCondition) -> Result { - iota::ExpirationUnlockCondition::new(value.return_address.into(), value.timestamp.0) + iota::ExpirationUnlockCondition::new(value.return_address, value.timestamp.0) } } @@ -47,7 +47,7 @@ impl From for iota::dto::ExpirationUnlockConditionDto #[cfg(feature = "rand")] mod rand { - use iota_types::block::rand::number::rand_number; + use iota_sdk::types::block::rand::number::rand_number; use super::*; diff --git a/src/model/block/payload/transaction/output/unlock_condition/governor_address.rs b/src/model/block/payload/transaction/output/unlock_condition/governor_address.rs index 4351a3b92..151993875 100644 --- a/src/model/block/payload/transaction/output/unlock_condition/governor_address.rs +++ b/src/model/block/payload/transaction/output/unlock_condition/governor_address.rs @@ -5,7 +5,7 @@ use std::borrow::Borrow; -use iota_types::block::output::unlock_condition as iota; +use iota_sdk::types::block::output::unlock_condition as iota; use serde::{Deserialize, Serialize}; use crate::model::utxo::Address; @@ -28,7 +28,7 @@ impl> From for GovernorAddres impl From for iota::GovernorAddressUnlockCondition { fn from(value: GovernorAddressUnlockCondition) -> Self { - Self::new(value.address.into()) + Self::new(value.address) } } diff --git a/src/model/block/payload/transaction/output/unlock_condition/immutable_alias_address.rs b/src/model/block/payload/transaction/output/unlock_condition/immutable_alias_address.rs index 305810aa7..460f53aca 100644 --- a/src/model/block/payload/transaction/output/unlock_condition/immutable_alias_address.rs +++ b/src/model/block/payload/transaction/output/unlock_condition/immutable_alias_address.rs @@ -5,7 +5,7 @@ use std::borrow::Borrow; -use iota_types::block::output::unlock_condition as iota; +use iota_sdk::types::block::output::unlock_condition as iota; use serde::{Deserialize, Serialize}; use crate::model::utxo::Address; @@ -26,10 +26,10 @@ impl> From for Immutabl } impl TryFrom for iota::ImmutableAliasAddressUnlockCondition { - type Error = iota_types::block::Error; + type Error = iota_sdk::types::block::Error; fn try_from(value: ImmutableAliasAddressUnlockCondition) -> Result { - use iota_types::block::address::Address as IotaAddress; + use iota_sdk::types::block::address::Address as IotaAddress; let address = IotaAddress::from(value.address); match address { IotaAddress::Alias(alias) => Ok(Self::new(alias)), diff --git a/src/model/block/payload/transaction/output/unlock_condition/mod.rs b/src/model/block/payload/transaction/output/unlock_condition/mod.rs index 0cb016f20..9ece48675 100644 --- a/src/model/block/payload/transaction/output/unlock_condition/mod.rs +++ b/src/model/block/payload/transaction/output/unlock_condition/mod.rs @@ -34,7 +34,7 @@ mod test { #[test] fn test_storage_deposit_unlock_bson() { - let ctx = iota_types::block::protocol::protocol_parameters(); + let ctx = iota_sdk::types::block::protocol::protocol_parameters(); let unlock = StorageDepositReturnUnlockCondition::rand(&ctx); let bson = to_bson(&unlock).unwrap(); from_bson::(bson).unwrap(); diff --git a/src/model/block/payload/transaction/output/unlock_condition/state_controller_address.rs b/src/model/block/payload/transaction/output/unlock_condition/state_controller_address.rs index 93d5d7961..1a44727a8 100644 --- a/src/model/block/payload/transaction/output/unlock_condition/state_controller_address.rs +++ b/src/model/block/payload/transaction/output/unlock_condition/state_controller_address.rs @@ -5,7 +5,7 @@ use std::borrow::Borrow; -use iota_types::block::output::unlock_condition as iota; +use iota_sdk::types::block::output::unlock_condition as iota; use serde::{Deserialize, Serialize}; use crate::model::utxo::Address; @@ -28,7 +28,7 @@ impl> From for StateCo impl From for iota::StateControllerAddressUnlockCondition { fn from(value: StateControllerAddressUnlockCondition) -> Self { - Self::new(value.address.into()) + Self::new(value.address) } } diff --git a/src/model/block/payload/transaction/output/unlock_condition/storage_deposit_return.rs b/src/model/block/payload/transaction/output/unlock_condition/storage_deposit_return.rs index dab87efa0..99c0b2d03 100644 --- a/src/model/block/payload/transaction/output/unlock_condition/storage_deposit_return.rs +++ b/src/model/block/payload/transaction/output/unlock_condition/storage_deposit_return.rs @@ -5,7 +5,7 @@ use std::borrow::Borrow; -use iota_types::block::output::unlock_condition as iota; +use iota_sdk::types::block::output::unlock_condition as iota; use serde::{Deserialize, Serialize}; use super::TokenAmount; @@ -30,13 +30,13 @@ impl> From for StorageDe } impl TryFromWithContext for iota::StorageDepositReturnUnlockCondition { - type Error = iota_types::block::Error; + type Error = iota_sdk::types::block::Error; fn try_from_with_context( - ctx: &iota_types::block::protocol::ProtocolParameters, + ctx: &iota_sdk::types::block::protocol::ProtocolParameters, value: StorageDepositReturnUnlockCondition, ) -> Result { - iota::StorageDepositReturnUnlockCondition::new(value.return_address.into(), value.amount.0, ctx.token_supply()) + iota::StorageDepositReturnUnlockCondition::new(value.return_address, value.amount.0, ctx.token_supply()) } } @@ -56,7 +56,7 @@ mod rand { impl StorageDepositReturnUnlockCondition { /// Generates a random [`StorageDepositReturnUnlockCondition`]. - pub fn rand(ctx: &iota_types::block::protocol::ProtocolParameters) -> Self { + pub fn rand(ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Self { Self { return_address: Address::rand_ed25519(), amount: TokenAmount::rand(ctx), diff --git a/src/model/block/payload/transaction/output/unlock_condition/timelock.rs b/src/model/block/payload/transaction/output/unlock_condition/timelock.rs index e9f52f2ce..e93e51abd 100644 --- a/src/model/block/payload/transaction/output/unlock_condition/timelock.rs +++ b/src/model/block/payload/transaction/output/unlock_condition/timelock.rs @@ -5,7 +5,7 @@ use std::borrow::Borrow; -use iota_types::block::output::unlock_condition as iota; +use iota_sdk::types::block::output::unlock_condition as iota; use serde::{Deserialize, Serialize}; use crate::model::tangle::MilestoneTimestamp; @@ -25,7 +25,7 @@ impl> From for TimelockUnlockConditi } impl TryFrom for iota::TimelockUnlockCondition { - type Error = iota_types::block::Error; + type Error = iota_sdk::types::block::Error; fn try_from(value: TimelockUnlockCondition) -> Result { Self::new(value.timestamp.0) @@ -43,7 +43,7 @@ impl From for iota::dto::TimelockUnlockConditionDto { #[cfg(feature = "rand")] mod rand { - use iota_types::block::rand::number::rand_number; + use iota_sdk::types::block::rand::number::rand_number; use super::*; diff --git a/src/model/block/payload/transaction/unlock.rs b/src/model/block/payload/transaction/unlock.rs index 04112a987..fc62f96af 100644 --- a/src/model/block/payload/transaction/unlock.rs +++ b/src/model/block/payload/transaction/unlock.rs @@ -3,7 +3,7 @@ //! Module containing the [`Unlock`] types. -use iota_types::block::unlock as iota; +use iota_sdk::types::block::unlock as iota; use serde::{Deserialize, Serialize}; use crate::model::signature::Signature; @@ -48,11 +48,13 @@ impl From<&iota::Unlock> for Unlock { } impl TryFrom for iota::Unlock { - type Error = iota_types::block::Error; + type Error = iota_sdk::types::block::Error; fn try_from(value: Unlock) -> Result { Ok(match value { - Unlock::Signature { signature } => iota::Unlock::Signature(iota::SignatureUnlock::new(signature.into())), + Unlock::Signature { signature } => { + iota::Unlock::Signature(iota::SignatureUnlock::new(signature.try_into()?)) + } Unlock::Reference { index } => iota::Unlock::Reference(iota::ReferenceUnlock::new(index)?), Unlock::Alias { index } => iota::Unlock::Alias(iota::AliasUnlock::new(index)?), Unlock::Nft { index } => iota::Unlock::Nft(iota::NftUnlock::new(index)?), @@ -85,7 +87,7 @@ impl From for iota::dto::UnlockDto { #[cfg(feature = "rand")] mod rand { - use iota_types::block::{rand::number::rand_number_range, unlock::UNLOCK_INDEX_RANGE}; + use iota_sdk::types::block::{rand::number::rand_number_range, unlock::UNLOCK_INDEX_RANGE}; use super::*; diff --git a/src/model/block/payload/treasury_transaction.rs b/src/model/block/payload/treasury_transaction.rs index 344b0a2fb..8a39633cb 100644 --- a/src/model/block/payload/treasury_transaction.rs +++ b/src/model/block/payload/treasury_transaction.rs @@ -5,7 +5,7 @@ use std::borrow::Borrow; -use iota_types::block::payload as iota; +use iota_sdk::types::block::payload as iota; use serde::{Deserialize, Serialize}; use super::milestone::MilestoneId; @@ -36,15 +36,15 @@ impl> From for TreasuryTransactio } impl TryFromWithContext for iota::TreasuryTransactionPayload { - type Error = iota_types::block::Error; + type Error = iota_sdk::types::block::Error; fn try_from_with_context( - ctx: &iota_types::block::protocol::ProtocolParameters, + ctx: &iota_sdk::types::block::protocol::ProtocolParameters, value: TreasuryTransactionPayload, ) -> Result { Self::new( - iota_types::block::input::TreasuryInput::new(value.input_milestone_id.into()), - iota_types::block::output::TreasuryOutput::new(value.output_amount, ctx.token_supply())?, + iota_sdk::types::block::input::TreasuryInput::new(value.input_milestone_id.into()), + iota_sdk::types::block::output::TreasuryOutput::new(value.output_amount, ctx.token_supply())?, ) } } @@ -53,13 +53,15 @@ impl From for iota::dto::TreasuryTransactionPayloadD fn from(value: TreasuryTransactionPayload) -> Self { Self { kind: iota::TreasuryTransactionPayload::KIND, - input: iota_types::block::input::dto::InputDto::Treasury(iota_types::block::input::dto::TreasuryInputDto { - kind: iota_types::block::input::TreasuryInput::KIND, - milestone_id: value.input_milestone_id.to_hex(), - }), - output: iota_types::block::output::dto::OutputDto::Treasury( - iota_types::block::output::dto::TreasuryOutputDto { - kind: iota_types::block::output::TreasuryOutput::KIND, + input: iota_sdk::types::block::input::dto::InputDto::Treasury( + iota_sdk::types::block::input::dto::TreasuryInputDto { + kind: iota_sdk::types::block::input::TreasuryInput::KIND, + milestone_id: value.input_milestone_id.to_hex(), + }, + ), + output: iota_sdk::types::block::output::dto::OutputDto::Treasury( + iota_sdk::types::block::output::dto::TreasuryOutputDto { + kind: iota_sdk::types::block::output::TreasuryOutput::KIND, amount: value.output_amount.to_string(), }, ), @@ -69,13 +71,13 @@ impl From for iota::dto::TreasuryTransactionPayloadD #[cfg(feature = "rand")] mod rand { - use iota_types::block::rand::payload::rand_treasury_transaction_payload; + use iota_sdk::types::block::rand::payload::rand_treasury_transaction_payload; use super::*; impl TreasuryTransactionPayload { /// Generates a random [`TreasuryTransactionPayload`]. - pub fn rand(ctx: &iota_types::block::protocol::ProtocolParameters) -> Self { + pub fn rand(ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Self { rand_treasury_transaction_payload(ctx.token_supply()).into() } } @@ -89,7 +91,7 @@ mod test { #[test] fn test_treasury_transaction_payload_bson() { - let ctx = iota_types::block::protocol::protocol_parameters(); + let ctx = iota_sdk::types::block::protocol::protocol_parameters(); let payload = TreasuryTransactionPayload::rand(&ctx); iota::TreasuryTransactionPayload::try_from_with_context(&ctx, payload).unwrap(); let bson = to_bson(&payload).unwrap(); diff --git a/src/model/protocol.rs b/src/model/protocol.rs index 7eaeb6fdf..bab668051 100644 --- a/src/model/protocol.rs +++ b/src/model/protocol.rs @@ -3,7 +3,7 @@ #![allow(missing_docs)] -use iota_types::block as iota; +use iota_sdk::types::block as iota; use serde::{Deserialize, Serialize}; use crate::model::stringify; @@ -28,11 +28,10 @@ impl From<&iota::output::RentStructure> for RentStructure { impl From for iota::output::RentStructure { fn from(value: RentStructure) -> Self { - Self::build() - .byte_cost(value.v_byte_cost) - .byte_factor_data(value.v_byte_factor_data) - .byte_factor_key(value.v_byte_factor_key) - .finish() + Self::default() + .with_byte_cost(value.v_byte_cost) + .with_byte_factor_data(value.v_byte_factor_data) + .with_byte_factor_key(value.v_byte_factor_key) } } @@ -54,7 +53,7 @@ impl From for ProtocolParameters { Self { version: value.protocol_version(), network_name: value.network_name().into(), - bech32_hrp: value.bech32_hrp().into(), + bech32_hrp: value.bech32_hrp().to_string(), min_pow_score: value.min_pow_score(), below_max_depth: value.below_max_depth(), rent_structure: value.rent_structure().into(), @@ -64,7 +63,7 @@ impl From for ProtocolParameters { } impl TryFrom for iota::protocol::ProtocolParameters { - type Error = iota_types::block::Error; + type Error = iota_sdk::types::block::Error; fn try_from(value: ProtocolParameters) -> Result { Self::new( diff --git a/src/model/signature.rs b/src/model/signature.rs index 0a6982de4..1a1d4696d 100644 --- a/src/model/signature.rs +++ b/src/model/signature.rs @@ -3,7 +3,7 @@ //! Module containing the [`Signature`] type. -use iota_types::block::signature as iota; +use iota_sdk::types::block::signature as iota; use serde::{Deserialize, Serialize}; use crate::model::bytify; @@ -32,48 +32,50 @@ impl From<&iota::Signature> for Signature { fn from(value: &iota::Signature) -> Self { match value { iota::Signature::Ed25519(signature) => Self::Ed25519 { - public_key: *signature.public_key(), - signature: *signature.signature(), + public_key: signature.public_key().to_bytes(), + signature: signature.signature().to_bytes(), }, } } } -impl From for iota::Signature { - fn from(value: Signature) -> Self { - match value { +impl TryFrom for iota::Signature { + type Error = iota_sdk::types::block::Error; + + fn try_from(value: Signature) -> Result { + Ok(match value { Signature::Ed25519 { public_key, signature } => { - iota::Signature::Ed25519(iota::Ed25519Signature::new(public_key, signature)) + iota::Ed25519Signature::try_from_bytes(public_key, signature)?.into() } - } + }) } } impl From for iota::dto::SignatureDto { fn from(value: Signature) -> Self { match value { - Signature::Ed25519 { public_key, signature } => Self::Ed25519(iota::dto::Ed25519SignatureDto { - kind: iota::Ed25519Signature::KIND, - public_key: prefix_hex::encode(public_key), - signature: prefix_hex::encode(signature), - }), + Signature::Ed25519 { public_key, signature } => Self::Ed25519( + iota::dto::Ed25519SignatureDto { + kind: iota::Ed25519Signature::KIND, + public_key: prefix_hex::encode(public_key), + signature: prefix_hex::encode(signature), + } + .into(), + ), } } } #[cfg(feature = "rand")] mod rand { - use iota_types::block::rand::bytes::rand_bytes_array; + use iota_sdk::types::block::rand::signature::rand_signature; use super::*; impl Signature { /// Generates a random [`Signature`] with an [`iota::Ed25519Signature`]. pub fn rand() -> Self { - Self::from(&iota::Signature::Ed25519(iota::Ed25519Signature::new( - rand_bytes_array(), - rand_bytes_array(), - ))) + Self::from(&rand_signature()) } } } diff --git a/src/model/util/context.rs b/src/model/util/context.rs index 5a87fc43a..bb1bd0ebe 100644 --- a/src/model/util/context.rs +++ b/src/model/util/context.rs @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 //! This module provides conversion methods between types while respecting the context that is the current -//! [`ProtocolParameters`](iota_types::block::protocol::ProtocolParameters). +//! [`ProtocolParameters`](iota_sdk::types::block::protocol::ProtocolParameters). /// The equivalent to [`TryFrom`] but with an additional context. pub trait TryFromWithContext: Sized { @@ -11,7 +11,7 @@ pub trait TryFromWithContext: Sized { /// Performs the conversion. fn try_from_with_context( - ctx: &iota_types::block::protocol::ProtocolParameters, + ctx: &iota_sdk::types::block::protocol::ProtocolParameters, value: T, ) -> Result; } @@ -22,7 +22,10 @@ pub trait TryIntoWithContext: Sized { type Error; /// Performs the conversion. - fn try_into_with_context(self, ctx: &iota_types::block::protocol::ProtocolParameters) -> Result; + fn try_into_with_context( + self, + ctx: &iota_sdk::types::block::protocol::ProtocolParameters, + ) -> Result; } // TryFromWithContext implies TryIntoWithContext @@ -32,7 +35,7 @@ where { type Error = U::Error; - fn try_into_with_context(self, ctx: &iota_types::block::protocol::ProtocolParameters) -> Result { + fn try_into_with_context(self, ctx: &iota_sdk::types::block::protocol::ProtocolParameters) -> Result { U::try_from_with_context(ctx, self) } } diff --git a/src/tangle/sources/inx.rs b/src/tangle/sources/inx.rs index b6597c962..5f3183e29 100644 --- a/src/tangle/sources/inx.rs +++ b/src/tangle/sources/inx.rs @@ -43,7 +43,7 @@ impl InputSource for Inx { let mut inx = inx.clone(); async move { let node_config = inx.read_node_configuration().await?.into(); - let payload = if let iota_types::block::payload::Payload::Milestone(payload) = + let payload = if let iota_sdk::types::block::payload::Payload::Milestone(payload) = msg.milestone.milestone.inner_unverified()? { payload.into() diff --git a/tests/blocks.rs b/tests/blocks.rs index 4132227aa..df87160f5 100644 --- a/tests/blocks.rs +++ b/tests/blocks.rs @@ -48,7 +48,9 @@ mod test_rand { raw, metadata, }| { - let block = iota_types::block::Block::unpack_unverified(raw.clone()).unwrap().into(); + let block = iota_sdk::types::block::Block::unpack_unverified(raw.clone()) + .unwrap() + .into(); (block_id, block, raw, metadata) }, ) @@ -118,7 +120,7 @@ mod test_rand { ( block_id, block, - iota_types::block::rand::bytes::rand_bytes(100), + iota_sdk::types::block::rand::bytes::rand_bytes(100), BlockMetadata { parents, is_solid: true, @@ -188,7 +190,9 @@ mod test_rand { raw, metadata, }| { - let block = iota_types::block::Block::unpack_unverified(raw.clone()).unwrap().into(); + let block = iota_sdk::types::block::Block::unpack_unverified(raw.clone()) + .unwrap() + .into(); (block_id, block, raw, metadata) }, ) @@ -210,7 +214,9 @@ mod test_rand { raw, metadata, }| { - let block: Block = iota_types::block::Block::unpack_unverified(raw.clone()).unwrap().into(); + let block: Block = iota_sdk::types::block::Block::unpack_unverified(raw.clone()) + .unwrap() + .into(); (block_id, block, raw, metadata) }, ) @@ -260,7 +266,7 @@ mod test_rand { ( block_id, block, - iota_types::block::rand::bytes::rand_bytes(100), + iota_sdk::types::block::rand::bytes::rand_bytes(100), BlockMetadata { parents, is_solid: true, diff --git a/tests/ledger_updates.rs b/tests/ledger_updates.rs index 61d44a6f1..acf62aa9b 100644 --- a/tests/ledger_updates.rs +++ b/tests/ledger_updates.rs @@ -23,7 +23,7 @@ mod test_rand { }, }; use futures::TryStreamExt; - use iota_types::block::rand::number::rand_number_range; + use iota_sdk::types::block::rand::number::rand_number_range; use super::common::{setup_collection, setup_database, teardown}; @@ -32,7 +32,7 @@ mod test_rand { let db = setup_database("test-ledger-updates-by-address").await.unwrap(); let update_collection = setup_collection::(&db).await.unwrap(); - let ctx = iota_types::block::protocol::protocol_parameters(); + let ctx = iota_sdk::types::block::protocol::protocol_parameters(); let mut outputs = HashSet::new(); let address_unlock_condition = AddressUnlockCondition::rand(); @@ -124,7 +124,7 @@ mod test_rand { let db = setup_database("test-ledger-updates-by-milestone").await.unwrap(); let update_collection = setup_collection::(&db).await.unwrap(); - let ctx = iota_types::block::protocol::protocol_parameters(); + let ctx = iota_sdk::types::block::protocol::protocol_parameters(); let mut outputs = HashMap::new(); let ledger_outputs = std::iter::repeat_with(|| (BlockId::rand(), Output::rand_basic(&ctx), OutputId::rand())) @@ -179,7 +179,7 @@ mod test_rand { let db = setup_database("test-insert-spent-ledger-updates").await.unwrap(); let update_collection = setup_collection::(&db).await.unwrap(); - let ctx = iota_types::block::protocol::protocol_parameters(); + let ctx = iota_sdk::types::block::protocol::protocol_parameters(); let unspent_outputs = std::iter::repeat_with(|| (BlockId::rand(), Output::rand_basic(&ctx), OutputId::rand())) .take(100) diff --git a/tests/milestones.rs b/tests/milestones.rs index bf383106e..4829d765a 100644 --- a/tests/milestones.rs +++ b/tests/milestones.rs @@ -17,7 +17,7 @@ mod test_rand { let db = setup_database("test-milestones").await.unwrap(); let milestone_collection = setup_collection::(&db).await.unwrap(); - let milestone = MilestonePayload::rand(&iota_types::block::protocol::protocol_parameters()); + let milestone = MilestonePayload::rand(&iota_sdk::types::block::protocol::protocol_parameters()); let milestone_id = MilestoneId::rand(); milestone_collection diff --git a/tests/outputs.rs b/tests/outputs.rs index 096a77431..866d29b15 100644 --- a/tests/outputs.rs +++ b/tests/outputs.rs @@ -24,7 +24,7 @@ mod test_rand { let db = setup_database("test-outputs").await.unwrap(); let output_collection = setup_collection::(&db).await.unwrap(); - let protocol_params = iota_types::block::protocol::protocol_parameters(); + let protocol_params = iota_sdk::types::block::protocol::protocol_parameters(); let outputs = std::iter::repeat_with(|| Output::rand(&protocol_params)) .take(100) diff --git a/tests/protocol_updates.rs b/tests/protocol_updates.rs index cc6766062..9b480cd5a 100644 --- a/tests/protocol_updates.rs +++ b/tests/protocol_updates.rs @@ -9,7 +9,7 @@ mod test_rand { db::{mongodb::collections::ProtocolUpdateCollection, MongoDbCollectionExt}, model::{tangle::MilestoneIndex, ProtocolParameters}, }; - use iota_types::block::rand::number::rand_number_range; + use iota_sdk::types::block::rand::number::rand_number_range; use super::common::{setup_collection, setup_database, teardown}; @@ -27,7 +27,7 @@ mod test_rand { .inspect(|(i, _)| update_indexes.push(MilestoneIndex(*i as u32))) .enumerate() .map(|(i, (ledger_index, _))| { - let mut parameters = ProtocolParameters::from(iota_types::block::protocol::protocol_parameters()); + let mut parameters = ProtocolParameters::from(iota_sdk::types::block::protocol::protocol_parameters()); parameters.version = i as u8; (ledger_index as u32, parameters) }) @@ -56,7 +56,7 @@ mod test_rand { ); } - let mut parameters = ProtocolParameters::from(iota_types::block::protocol::protocol_parameters()); + let mut parameters = ProtocolParameters::from(iota_sdk::types::block::protocol::protocol_parameters()); parameters.version = 10; parameters.token_supply = u64::MAX; diff --git a/tests/treasury_updates.rs b/tests/treasury_updates.rs index 80ccbd243..16e5882a4 100644 --- a/tests/treasury_updates.rs +++ b/tests/treasury_updates.rs @@ -14,7 +14,7 @@ mod test_rand { tangle::MilestoneIndex, }, }; - use iota_types::block::rand::number::rand_number_range; + use iota_sdk::types::block::rand::number::rand_number_range; use super::common::{setup_collection, setup_database, teardown}; @@ -23,7 +23,7 @@ mod test_rand { let db = setup_database("test-insert-treasury-updates").await.unwrap(); let update_collection = setup_collection::(&db).await.unwrap(); - let ctx = iota_types::block::protocol::protocol_parameters(); + let ctx = iota_sdk::types::block::protocol::protocol_parameters(); let mut milestones = HashMap::new(); for (milestone_index, payload) in From b1bb296a2662ed74ef4cb85c71f54e7f67085386 Mon Sep 17 00:00:00 2001 From: Alex Coats Date: Tue, 15 Aug 2023 10:36:42 -0400 Subject: [PATCH 3/7] Update influxdb --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 554de2aa8..09b5135b0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1639,9 +1639,9 @@ dependencies = [ [[package]] name = "influxdb" -version = "0.5.2" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39023407f0546c3b30607950f8b600c7db4ef7621fbaa0159de733d73e68b23f" +checksum = "4f79168e8b5047761c3e027438d6a46150380b2d78b15b723da04beefde29832" dependencies = [ "chrono", "futures-util", diff --git a/Cargo.toml b/Cargo.toml index 24949c8bf..d7be63cfb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,7 +54,7 @@ uuid = { version = "1.3", default-features = false, features = [ "v4" ] } # Optional chrono = { version = "0.4", default-features = false, features = [ "std" ], optional = true } -influxdb = { version = "0.5", default-features = false, features = [ "use-serde", "reqwest-client-rustls", "derive" ], optional = true } +influxdb = { version = "0.7", default-features = false, features = [ "use-serde", "reqwest-client-rustls", "derive" ], optional = true } # API auth-helper = { version = "0.3", default-features = false, optional = true } From 4e12c1d290993045b56ec84ad08e858284c6c78f Mon Sep 17 00:00:00 2001 From: Alex Coats Date: Thu, 24 Aug 2023 14:24:28 -0400 Subject: [PATCH 4/7] fix doc CI --- src/db/mongodb/collections/milestone.rs | 2 +- src/db/mongodb/collections/outputs/mod.rs | 2 +- src/inx/block.rs | 2 +- src/model/block/payload/transaction/output/alias.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/db/mongodb/collections/milestone.rs b/src/db/mongodb/collections/milestone.rs index 1c1fbdef9..c927d5555 100644 --- a/src/db/mongodb/collections/milestone.rs +++ b/src/db/mongodb/collections/milestone.rs @@ -31,7 +31,7 @@ const BY_NEWEST: i32 = -1; /// A milestone's metadata. #[derive(Clone, Debug, Serialize, Deserialize)] pub struct MilestoneDocument { - /// The [`MilestoneId`](MilestoneId) of the milestone. + /// The [`MilestoneId`] of the milestone. #[serde(rename = "_id")] milestone_id: MilestoneId, /// The milestone index and timestamp. diff --git a/src/db/mongodb/collections/outputs/mod.rs b/src/db/mongodb/collections/outputs/mod.rs index 79ab14f8a..8ee3b6ab3 100644 --- a/src/db/mongodb/collections/outputs/mod.rs +++ b/src/db/mongodb/collections/outputs/mod.rs @@ -416,7 +416,7 @@ impl OutputCollection { .await } - /// Sums the amounts of all outputs owned by the given [`Address`](crate::model::utxo::Address). + /// Sums the amounts of all outputs owned by the given [`Address`]. pub async fn get_address_balance( &self, address: Address, diff --git a/src/inx/block.rs b/src/inx/block.rs index ebc3fc690..c831fc0da 100644 --- a/src/inx/block.rs +++ b/src/inx/block.rs @@ -52,7 +52,7 @@ pub struct BlockMetadataMessage { /// The [`BlockWithMetadataMessage`] type. #[derive(Clone, Debug, PartialEq, Eq)] pub struct BlockWithMetadataMessage { - /// The [`BlockMetadataMessage`](BlockMetadataMessage) of the block. + /// The [`BlockMetadataMessage`] of the block. pub metadata: BlockMetadataMessage, /// The complete [`Block`](iota::Block) as raw bytes. pub block: RawMessage, diff --git a/src/model/block/payload/transaction/output/alias.rs b/src/model/block/payload/transaction/output/alias.rs index b06662e64..de4e2f20a 100644 --- a/src/model/block/payload/transaction/output/alias.rs +++ b/src/model/block/payload/transaction/output/alias.rs @@ -25,7 +25,7 @@ pub struct AliasId(#[serde(with = "bytify")] pub [u8; Self::LENGTH]); impl AliasId { const LENGTH: usize = iota::AliasId::LENGTH; - /// The [`AliasId`] is derived from the [`OutputId`](super::OutputId) that created the alias. + /// The [`AliasId`] is derived from the [`OutputId`] that created the alias. pub fn from_output_id_str(s: &str) -> Result { Ok(iota::AliasId::from(&iota::OutputId::from_str(s)?).into()) } From 7b3a9e52d182f78d6978d45bd2243430e43b7774 Mon Sep 17 00:00:00 2001 From: Alex Coats Date: Mon, 11 Sep 2023 08:44:10 -0400 Subject: [PATCH 5/7] lint --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 7e969837e..277f02e37 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,7 +3,7 @@ // Ideally, this would be handled completely by CI, but there is a bug in `petgraph` that prevents us from doing that. #![warn(missing_docs)] -#![deny(unreachable_pub, private_in_public)] +#![deny(unreachable_pub, private_interfaces, private_bounds)] //! The basic types and MongoDb queries for Chronicle. From 32ab6fc33e0cac08d6ee0f9baf247c11c3f7b3dc Mon Sep 17 00:00:00 2001 From: Alex Coats Date: Mon, 11 Sep 2023 09:41:09 -0400 Subject: [PATCH 6/7] remove unstable lints --- src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 277f02e37..2e183dbb5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,7 +3,9 @@ // Ideally, this would be handled completely by CI, but there is a bug in `petgraph` that prevents us from doing that. #![warn(missing_docs)] -#![deny(unreachable_pub, private_interfaces, private_bounds)] +#![deny(unreachable_pub)] +// TODO: +// #![deny(unreachable_pub, private_interfaces, private_bounds)] //! The basic types and MongoDb queries for Chronicle. From a4b6161a29bb129e8d12d076c4e4f776ad3dfdbd Mon Sep 17 00:00:00 2001 From: Alex Coats Date: Tue, 12 Sep 2023 08:47:41 -0400 Subject: [PATCH 7/7] Add zeroize feature to ed25519 --- Cargo.lock | 2 ++ Cargo.toml | 1 + 2 files changed, 3 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 09b5135b0..8e9f4bef3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -499,6 +499,7 @@ dependencies = [ "decimal", "derive_more", "dotenvy", + "ed25519", "ed25519-zebra", "eyre", "futures", @@ -990,6 +991,7 @@ dependencies = [ "pkcs8", "serde", "signature", + "zeroize", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index d7be63cfb..3b3d73763 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -59,6 +59,7 @@ influxdb = { version = "0.7", default-features = false, features = [ "use-serde" # API auth-helper = { version = "0.3", default-features = false, optional = true } axum = { version = "0.5", default-features = false, features = [ "http1", "json", "query", "original-uri", "headers" ], optional = true } +ed25519 = { version = "2.2", default-features = false, features = [ "zeroize" ] } # This is here simply to force this feature ed25519-zebra = { version = "4.0", default-features = false, features = [ "std", "pkcs8", "pem" ], optional = true } hex = { version = "0.4", default-features = false, optional = true } hyper = { version = "0.14", default-features = false, features = [ "server", "tcp", "stream" ], optional = true }