From 2051546d144fe9b3c4a40d744e79f4dd853a235a Mon Sep 17 00:00:00 2001 From: "artem.ivanov" Date: Wed, 7 Feb 2024 11:59:05 +0300 Subject: [PATCH] Updated migration sample script to use indy shared components (#17) Signed-off-by: artem.ivanov --- docs/README.md | 2 +- docs/{migrtion => migration}/compatibiliy.md | 0 docs/{migrtion => migration}/migration.md | 0 examples/README.md | 5 + examples/migration/Cargo.lock | 3264 ++++++++++++++--- examples/migration/Cargo.toml | 13 +- examples/migration/README.md | 23 + examples/migration/besu-config.json | 22 + .../{docker.txn => indy-genesis.txn} | 0 examples/migration/src/holder.rs | 172 +- examples/migration/src/issuer.rs | 306 +- examples/migration/src/ledger.rs | 400 +- examples/migration/src/main.rs | 89 +- examples/migration/src/trustee.rs | 90 +- examples/migration/src/verifier.rs | 105 +- examples/migration/src/wallet.rs | 39 +- network/config/nodes/validator5/key | 2 +- vdr/Cargo.lock | 180 + vdr/Cargo.toml | 1 + vdr/src/contracts/cl/schema_registry.rs | 6 +- .../cl/types/credential_definition.rs | 20 +- vdr/src/contracts/cl/types/schema.rs | 12 +- vdr/src/lib.rs | 10 +- vdr/src/migration/credential_definition.rs | 116 +- vdr/src/migration/schema.rs | 93 +- 25 files changed, 3828 insertions(+), 1142 deletions(-) rename docs/{migrtion => migration}/compatibiliy.md (100%) rename docs/{migrtion => migration}/migration.md (100%) create mode 100644 examples/README.md create mode 100644 examples/migration/README.md create mode 100644 examples/migration/besu-config.json rename examples/migration/{docker.txn => indy-genesis.txn} (100%) diff --git a/docs/README.md b/docs/README.md index d65db3b6..5e6e9c59 100644 --- a/docs/README.md +++ b/docs/README.md @@ -21,7 +21,7 @@ ### Migration documents -- [Indy Migration](migrtion/migration.md) +- [Indy Migration](migration/migration.md) ### Development designs diff --git a/docs/migrtion/compatibiliy.md b/docs/migration/compatibiliy.md similarity index 100% rename from docs/migrtion/compatibiliy.md rename to docs/migration/compatibiliy.md diff --git a/docs/migrtion/migration.md b/docs/migration/migration.md similarity index 100% rename from docs/migrtion/migration.md rename to docs/migration/migration.md diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 00000000..e382878e --- /dev/null +++ b/examples/README.md @@ -0,0 +1,5 @@ +This directory contains some small examples demonstrating flows and capabilities of indy-besu. + +* [Migration](./migration) - sample demonstrating migration flow from + using [Indy-Node](https://github.com/hyperledger/indy-node.git) + to [Indy-Besu](https://github.com/hyperledger/indy-besu.git) as AnonCreds verifiable data registry. diff --git a/examples/migration/Cargo.lock b/examples/migration/Cargo.lock index 08a19adf..cb37de8d 100644 --- a/examples/migration/Cargo.lock +++ b/examples/migration/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.19.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -17,6 +17,54 @@ 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.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" +dependencies = [ + "aead", + "aes", + "cipher", + "ctr", + "ghash", + "subtle", +] + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if", + "getrandom", + "once_cell", + "version_check", + "zerocopy", +] + [[package]] name = "aho-corasick" version = "1.1.2" @@ -26,19 +74,172 @@ dependencies = [ "memchr", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "amcl" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee5cca1ddc8b9dceb55b7f1272a9d1e643d73006f350a20ab4926d24e33f0f0d" + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "anoncreds-clsignatures" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e43b1e6346133a92d4af655cdc07d389a2cfece7971db48129e54fce38b79e1d" +dependencies = [ + "amcl", + "glass_pumpkin", + "log", + "num-bigint", + "num-integer", + "num-traits", + "once_cell", + "openssl", + "rand", + "serde", + "sha2", +] + +[[package]] +name = "arc-swap" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" + +[[package]] +name = "argon2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c3610892ee6e0cbce8ae2700349fcf8f98adb0dbfbee85aec3c9179d29cc072" +dependencies = [ + "base64ct", + "blake2", + "cpufeatures", + "password-hash", +] + +[[package]] +name = "aries-askar" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61df62c8f62c0f850805c2b65f85633cb2c0e334b1376ce98aaaf30616e4657e" +dependencies = [ + "askar-crypto", + "askar-storage", + "async-lock 3.3.0", + "env_logger", + "ffi-support", + "log", + "once_cell", + "serde", + "serde_cbor", + "serde_json", + "zeroize", +] + [[package]] name = "arrayvec" version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +[[package]] +name = "askar-crypto" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39746932b19e345196a089e61a0f0175fc4d673db4b624424d8babf505e48a3d" +dependencies = [ + "aead", + "aes", + "aes-gcm", + "argon2", + "base64 0.21.7", + "blake2", + "block-modes", + "bls12_381", + "cbc", + "chacha20", + "chacha20poly1305", + "cipher", + "crypto_box", + "curve25519-dalek", + "digest 0.10.7", + "ed25519-dalek", + "elliptic-curve", + "group", + "hkdf", + "hmac", + "k256", + "p256", + "p384", + "rand", + "serde", + "serde-json-core", + "sha2", + "subtle", + "x25519-dalek", + "zeroize", +] + +[[package]] +name = "askar-storage" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b82a5c62e62075c68e4504ecc281fccce88f4692df43d50194cbbf918179ee" +dependencies = [ + "arc-swap", + "askar-crypto", + "async-lock 3.3.0", + "async-stream", + "bs58", + "chrono", + "digest 0.10.7", + "futures-lite 2.2.0", + "hex", + "hmac", + "itertools", + "log", + "once_cell", + "percent-encoding", + "rmp-serde", + "serde", + "serde_cbor", + "serde_json", + "sha2", + "sqlx", + "tokio", + "url", + "uuid", + "zeroize", +] + [[package]] name = "async-attributes" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3203e79f4dd9bdda415ed03cf14dae5a2bf775c683a00f94e9cd1faf0f596e5" dependencies = [ - "quote 1.0.33", + "quote", "syn 1.0.109", ] @@ -49,58 +250,90 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" dependencies = [ "concurrent-queue", - "event-listener", + "event-listener 2.5.3", + "futures-core", +] + +[[package]] +name = "async-channel" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" +dependencies = [ + "concurrent-queue", + "event-listener 4.0.3", + "event-listener-strategy", "futures-core", + "pin-project-lite", ] [[package]] name = "async-executor" -version = "1.5.4" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1da3ae8dabd9c00f453a329dfe1fb28da3c0a72e2478cdcd93171740c20499" +checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" dependencies = [ - "async-lock", + "async-lock 3.3.0", "async-task", "concurrent-queue", "fastrand 2.0.1", - "futures-lite", + "futures-lite 2.2.0", "slab", ] [[package]] name = "async-global-executor" -version = "2.3.1" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1b6f5d7df27bd294849f8eec66ecfc63d11814df7a4f5d74168a2394467b776" +checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" dependencies = [ - "async-channel", + "async-channel 2.1.1", "async-executor", - "async-io", - "async-lock", + "async-io 2.3.1", + "async-lock 3.3.0", "blocking", - "futures-lite", + "futures-lite 2.2.0", "once_cell", "tokio", ] [[package]] name = "async-io" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c374dda1ed3e7d8f0d9ba58715f924862c63eae6849c92d3a18e7fbde9e2794" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" dependencies = [ - "async-lock", + "async-lock 2.8.0", "autocfg", + "cfg-if", "concurrent-queue", - "futures-lite", - "libc", + "futures-lite 1.13.0", "log", "parking", - "polling", + "polling 2.8.0", + "rustix 0.37.27", "slab", - "socket2", + "socket2 0.4.10", "waker-fn", - "windows-sys 0.42.0", +] + +[[package]] +name = "async-io" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f97ab0c5b00a7cdbe5a371b9a782ee7be1316095885c8a4ea1daf490eb0ef65" +dependencies = [ + "async-lock 3.3.0", + "cfg-if", + "concurrent-queue", + "futures-io", + "futures-lite 2.2.0", + "parking", + "polling 3.3.2", + "rustix 0.38.31", + "slab", + "tracing", + "windows-sys 0.52.0", ] [[package]] @@ -109,7 +342,18 @@ version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" dependencies = [ - "event-listener", + "event-listener 2.5.3", +] + +[[package]] +name = "async-lock" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +dependencies = [ + "event-listener 4.0.3", + "event-listener-strategy", + "pin-project-lite", ] [[package]] @@ -119,15 +363,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" dependencies = [ "async-attributes", - "async-channel", + "async-channel 1.9.0", "async-global-executor", - "async-io", - "async-lock", + "async-io 1.13.0", + "async-lock 2.8.0", "crossbeam-utils", "futures-channel", "futures-core", "futures-io", - "futures-lite", + "futures-lite 1.13.0", "gloo-timers", "kv-log-macro", "log", @@ -139,21 +383,52 @@ dependencies = [ "wasm-bindgen-futures", ] +[[package]] +name = "async-stream" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd56dd203fef61ac097dd65721a419ddccb106b2d2b70ba60a6b529f03961a51" +dependencies = [ + "async-stream-impl", + "futures-core", + "pin-project-lite", +] + +[[package]] +name = "async-stream-impl" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16e62a023e7c117e27523144c5d2459f4397fcc3cab0085af8e2224f643a0193" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "async-task" -version = "4.4.1" +version = "4.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9441c6b2fe128a7c2bf680a44c34d0df31ce09e5b7e401fcca3faa483dbc921" +checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" [[package]] name = "async-trait" -version = "0.1.73" +version = "0.1.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "atoi" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", - "syn 2.0.38", + "num-traits", ] [[package]] @@ -162,6 +437,27 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" +[[package]] +name = "atomic-write-file" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edcdbedc2236483ab103a53415653d6b4442ea6141baf1ffa85df29635e88436" +dependencies = [ + "nix", + "rand", +] + +[[package]] +name = "auto_impl" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "823b8bb275161044e2ac7a25879cb3e2480cb403e3943022c7c769c599b756aa" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -170,9 +466,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.67" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", @@ -183,6 +479,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" @@ -191,9 +493,15 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.4" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64ct" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" [[package]] name = "bitflags" @@ -203,9 +511,12 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +dependencies = [ + "serde", +] [[package]] name = "bitvec" @@ -219,6 +530,15 @@ dependencies = [ "wyz", ] +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest 0.10.7", +] + [[package]] name = "block-buffer" version = "0.9.0" @@ -237,22 +557,50 @@ dependencies = [ "generic-array", ] +[[package]] +name = "block-modes" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e2211b0817f061502a8dd9f11a37e879e79763e3c698d2418cf824d8cb2f21e" + +[[package]] +name = "block-padding" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8894febbff9f758034a5b8e12d87918f56dfc64a8e1fe757d65e29041538d93" +dependencies = [ + "generic-array", +] + [[package]] name = "blocking" -version = "1.4.1" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c36a4d0d48574b3dd360b4b7d95cc651d2b6557b6402848a27d4b228a473e2a" +checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" dependencies = [ - "async-channel", - "async-lock", + "async-channel 2.1.1", + "async-lock 3.3.0", "async-task", "fastrand 2.0.1", "futures-io", - "futures-lite", + "futures-lite 2.2.0", "piper", "tracing", ] +[[package]] +name = "bls12_381" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7bc6d6292be3a19e6379786dac800f551e5865a5bb51ebbe3064ab80433f403" +dependencies = [ + "ff", + "group", + "rand_core", + "subtle", + "zeroize", +] + [[package]] name = "bs58" version = "0.5.0" @@ -285,6 +633,18 @@ name = "bytes" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +dependencies = [ + "serde", +] + +[[package]] +name = "cbc" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6" +dependencies = [ + "cipher", +] [[package]] name = "cc" @@ -302,59 +662,178 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] -name = "concurrent-queue" -version = "2.3.0" +name = "chacha20" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f057a694a54f12365049b0958a1685bb52d567f5593b355fbf685838e873d400" +checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" dependencies = [ - "crossbeam-utils", + "cfg-if", + "cipher", + "cpufeatures", ] [[package]] -name = "convert_case" -version = "0.4.0" +name = "chacha20poly1305" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" +checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" +dependencies = [ + "aead", + "chacha20", + "cipher", + "poly1305", + "zeroize", +] [[package]] -name = "core-foundation" -version = "0.9.3" +name = "chrono" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" dependencies = [ - "core-foundation-sys", - "libc", + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-targets 0.52.0", ] [[package]] -name = "core-foundation-sys" -version = "0.8.4" +name = "cipher" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", + "zeroize", +] [[package]] -name = "cpufeatures" -version = "0.2.9" +name = "cmake" +version = "0.1.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" dependencies = [ - "libc", + "cc", ] [[package]] -name = "crossbeam-utils" -version = "0.8.16" +name = "concurrent-queue" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +checksum = "d16048cd947b08fa32c24458a22f5dc5e835264f689f4f5653210c69fd107363" dependencies = [ - "cfg-if", + "crossbeam-utils", ] [[package]] -name = "crunchy" -version = "0.2.2" +name = "const-hex" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "a5104de16b218eddf8e34ffe2f86f74bfa4e61e95a1b89732fccf6325efd0557" +dependencies = [ + "cfg-if", + "cpufeatures", + "hex", + "proptest", + "serde", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "convert_case" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "core2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" +dependencies = [ + "memchr", +] + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crc" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86ec7a15cbe22e59248fc7eadb1907dab5ba09372595da4d73dd805ed4417dfe" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" + +[[package]] +name = "crossbeam-queue" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + +[[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.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] [[package]] name = "crypto-common" @@ -363,9 +842,122 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array", + "rand_core", "typenum", ] +[[package]] +name = "crypto_box" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16182b4f39a82ec8a6851155cc4c0cda3065bb1db33651726a29e1951de0f009" +dependencies = [ + "aead", + "crypto_secretbox", + "curve25519-dalek", + "salsa20", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto_secretbox" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9d6cf87adf719ddf43a805e92c6870a531aedda35ff640442cbaf8674e141e1" +dependencies = [ + "aead", + "cipher", + "generic-array", + "poly1305", + "salsa20", + "subtle", + "zeroize", +] + +[[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 = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto", + "platforms", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "darling" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 1.0.109", +] + +[[package]] +name = "darling_macro" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" +dependencies = [ + "darling_core", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "der" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + [[package]] name = "derive_more" version = "0.99.17" @@ -373,8 +965,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "convert_case", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "rustc_version", "syn 1.0.109", ] @@ -395,7 +987,107 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", + "const-oid", "crypto-common", + "subtle", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + +[[package]] +name = "dotenvy" +version = "0.15.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aaf95b3e5c8f23aa320147307562d361db0ae0d51242340f558153b4eb2439b" + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest 0.10.7", + "elliptic-curve", + "rfc6979", + "signature", + "spki", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f628eaec48bfd21b865dc2950cfa014450c01d2fa2b69a86c2fd5844ec523c0" +dependencies = [ + "curve25519-dalek", + "ed25519", + "sha2", + "subtle", + "zeroize", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +dependencies = [ + "serde", +] + +[[package]] +name = "elastic-array-plus" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "562cc8504a01eb20c10fb154abd7c4baeb9beba2329cf85838ee2bd48a468b18" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest 0.10.7", + "ff", + "generic-array", + "group", + "hkdf", + "pkcs8", + "rand_core", + "sec1", + "subtle", + "zeroize", ] [[package]] @@ -407,12 +1099,70 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "env_logger" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" +dependencies = [ + "humantime", + "is-terminal", + "log", + "regex", + "termcolor", +] + [[package]] name = "equivalent" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "errno" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "error-chain" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9435d864e017c3c6afeac1654189b06cdb491cf2ff73dbf0d73b0f292f42ff8" + +[[package]] +name = "etcetera" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "136d1b5283a1ab77bd9257427ffd09d8667ced0570b6f938942bc7568ed5b943" +dependencies = [ + "cfg-if", + "home", + "windows-sys 0.48.0", +] + +[[package]] +name = "etcommon-hexutil" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20b4d1933bf88b806ba2d9189880b1b4ef205e42df9573b65716f2a50818024c" + +[[package]] +name = "etcommon-rlp" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c978ef454cd97da44a3a15d55cc312313be04b9692e39fa4cd3c00401f39bcb" +dependencies = [ + "byteorder", + "elastic-array-plus", + "etcommon-hexutil", + "lazy_static", +] + [[package]] name = "ethabi" version = "18.0.0" @@ -438,11 +1188,31 @@ checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" dependencies = [ "crunchy", "fixed-hash", + "impl-codec", "impl-rlp", "impl-serde", + "scale-info", "tiny-keccak", ] +[[package]] +name = "ethereum" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e04d24d20b8ff2235cffbf242d5092de3aa45f77c5270ddbfadd2778ca13fea" +dependencies = [ + "bytes", + "ethereum-types", + "hash-db", + "hash256-std-hasher", + "parity-scale-codec", + "rlp", + "scale-info", + "serde", + "sha3", + "trie-root", +] + [[package]] name = "ethereum-types" version = "0.14.1" @@ -451,12 +1221,41 @@ checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" dependencies = [ "ethbloom", "fixed-hash", + "impl-codec", "impl-rlp", "impl-serde", "primitive-types", + "scale-info", "uint", ] +[[package]] +name = "ethers-core" +version = "2.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aab3cef6cc1c9fd7f787043c81ad3052eff2b96a3878ef1526aa446311bdbfc9" +dependencies = [ + "arrayvec", + "bytes", + "chrono", + "const-hex", + "elliptic-curve", + "ethabi", + "generic-array", + "k256", + "num_enum", + "open-fastrlp", + "rand", + "rlp", + "serde", + "serde_json", + "strum", + "tempfile", + "thiserror", + "tiny-keccak", + "unicode-xid", +] + [[package]] name = "event-listener" version = "2.5.3" @@ -464,25 +1263,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] -name = "failure" -version = "0.1.8" +name = "event-listener" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32e9bd16cc02eae7db7ef620b392808b89f6a5e16bb3497d159c6b92a0f4f86" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" dependencies = [ - "backtrace", - "failure_derive", + "concurrent-queue", + "parking", + "pin-project-lite", ] [[package]] -name = "failure_derive" -version = "0.1.8" +name = "event-listener-strategy" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa4da3c766cd7a0db8242e326e9e4e081edd567072893ed320008189715366a4" +checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", - "syn 1.0.109", - "synstructure", + "event-listener 4.0.3", + "pin-project-lite", ] [[package]] @@ -500,6 +1298,38 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "ffi-support" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27838c6815cfe9de2d3aeb145ffd19e565f577414b33f3bdbf42fe040e9e0ff6" +dependencies = [ + "lazy_static", + "log", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7" + +[[package]] +name = "finl_unicode" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fcfdc7a0362c9f4444381a9e697c79d435fe65b52a37466fc2c1184cee9edc6" + [[package]] name = "fixed-hash" version = "0.8.0" @@ -512,6 +1342,17 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "flume" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" +dependencies = [ + "futures-core", + "futures-sink", + "spin 0.9.8", +] + [[package]] name = "fnv" version = "1.0.7" @@ -535,9 +1376,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -556,9 +1397,9 @@ checksum = "3a471a38ef8ed83cd6e40aa59c1ffe17db6855c18e3604d9c4ed8c08ebc28678" [[package]] name = "futures" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -571,9 +1412,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -581,26 +1422,37 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", "futures-util", ] +[[package]] +name = "futures-intrusive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d930c203dd0b6ff06e0201a4a2fe9149b43c684fd4420555b26d21b1a02956f" +dependencies = [ + "futures-core", + "lock_api", + "parking_lot", +] + [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" @@ -617,28 +1469,41 @@ dependencies = [ "waker-fn", ] +[[package]] +name = "futures-lite" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" +dependencies = [ + "fastrand 2.0.1", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] + [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", - "syn 2.0.38", + "proc-macro2", + "quote", + "syn 2.0.48", ] [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-timer" @@ -648,9 +1513,9 @@ checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -672,24 +1537,49 @@ checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", + "zeroize", ] [[package]] name = "getrandom" -version = "0.2.8" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "libc", "wasi", ] +[[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" +version = "0.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[package]] +name = "glass_pumpkin" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "b9e847fe780e2fd8aa993bef2124361c285349ff0e9315e8285f8126386b54a9" +dependencies = [ + "core2", + "num-bigint", + "num-integer", + "num-traits", + "once_cell", + "rand_core", +] [[package]] name = "gloo-timers" @@ -703,11 +1593,22 @@ dependencies = [ "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", + "subtle", +] + [[package]] name = "h2" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" dependencies = [ "bytes", "fnv", @@ -715,7 +1616,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 1.9.3", + "indexmap", "slab", "tokio", "tokio-util", @@ -723,16 +1624,44 @@ dependencies = [ ] [[package]] -name = "hashbrown" -version = "0.12.3" +name = "half" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" + +[[package]] +name = "hash-db" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +checksum = "8e7d7786361d7425ae2fe4f9e407eb0efaa0840f5212d109cc018c40c35c6ab4" + +[[package]] +name = "hash256-std-hasher" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92c171d55b98633f4ed3860808f004099b36c1cc29c42cfc53aa8591b21efcf2" +dependencies = [ + "crunchy", +] [[package]] name = "hashbrown" -version = "0.14.1" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] + +[[package]] +name = "hashlink" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8094feaf31ff591f651a2664fb9cfd92bba7a60ce3197265e9482ebe753c8f7" +dependencies = [ + "hashbrown", +] [[package]] name = "headers" @@ -740,7 +1669,7 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06683b93020a07e3dbcf5f8c0f6d40080d725bea7936fc01ad345c01b97dc270" dependencies = [ - "base64 0.21.4", + "base64 0.21.7", "bytes", "headers-core", "http", @@ -758,11 +1687,20 @@ dependencies = [ "http", ] +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" [[package]] name = "hex" @@ -770,11 +1708,38 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +[[package]] +name = "hkdf" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" +dependencies = [ + "hmac", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.7", +] + +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "http" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", @@ -783,9 +1748,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", @@ -804,11 +1769,17 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes", "futures-channel", @@ -821,7 +1792,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.5.5", "tokio", "tower-service", "tracing", @@ -829,18 +1800,47 @@ dependencies = [ ] [[package]] -name = "hyper-tls" -version = "0.5.0" +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.60" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" dependencies = [ - "bytes", - "hyper", - "native-tls", - "tokio", - "tokio-native-tls", + "cc", ] +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" version = "0.4.0" @@ -851,6 +1851,16 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "impl-codec" version = "0.6.0" @@ -884,49 +1894,178 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "syn 1.0.109", ] [[package]] name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - -[[package]] -name = "indexmap" -version = "2.0.2" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" +checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" dependencies = [ "equivalent", - "hashbrown 0.14.1", + "hashbrown", ] [[package]] -name = "indy2_vdr" +name = "indy-besu-vdr" version = "0.0.1" dependencies = [ "async-std", "async-trait", - "futures 0.3.28", + "base64 0.21.7", + "bs58", + "chrono", + "ethabi", + "ethereum", + "ethereum-types", + "ethers-core", + "futures 0.3.30", "hex", + "indy-data-types 0.7.1", + "log", + "log-derive", "once_cell", "rand", - "secp256k1 0.28.0", + "secp256k1 0.28.2", "serde", "serde_derive", "serde_json", + "sha3", "thiserror", "web3", ] +[[package]] +name = "indy-blssignatures" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ea4f5684155eae13be942fc61ff57706254adc0c6e99316c98805a0985200db" +dependencies = [ + "amcl", + "rand", + "serde", + "sha2", + "sha3", +] + +[[package]] +name = "indy-credx" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba445ec807f219abb5ea41c20c753aaa4aa90494d3d1d2900b2f2703205d04e2" +dependencies = [ + "env_logger", + "ffi-support", + "indy-data-types 0.7.1", + "log", + "once_cell", + "rand", + "regex", + "serde", + "serde_json", + "sha2", + "zeroize", +] + +[[package]] +name = "indy-data-types" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bc9972c657fd152d394f61b00d677aa8a700abd8c39137164e399a1d9fd0c6d" +dependencies = [ + "anoncreds-clsignatures", + "hex", + "indy-utils", + "once_cell", + "regex", + "serde", + "serde_json", + "sha2", + "zeroize", +] + +[[package]] +name = "indy-data-types" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3c213857cd6ff5ad634276bcbdcc5e911b32dcbd7127357776468016fef852c" +dependencies = [ + "anoncreds-clsignatures", + "bs58", + "curve25519-dalek", + "ed25519-dalek", + "hex", + "once_cell", + "rand", + "regex", + "serde", + "serde_json", + "sha2", + "thiserror", + "x25519-dalek", + "zeroize", +] + +[[package]] +name = "indy-utils" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d7e0cdcece8d97982e82aba5b0cb8c7e87ffb5f4fa48b935a3647d24db5439" +dependencies = [ + "bs58", + "once_cell", + "regex", + "serde", + "thiserror", + "zeroize", +] + +[[package]] +name = "indy-vdr" +version = "0.4.1" +source = "git+https://github.com/hyperledger/indy-vdr.git#6dbf40d66a031abf9690d7670cde4b21dadf8745" +dependencies = [ + "base64 0.21.7", + "bs58", + "env_logger", + "etcommon-rlp", + "ffi-support", + "futures-channel", + "futures-executor", + "futures-util", + "hex", + "indy-blssignatures", + "indy-data-types 0.7.1", + "log", + "once_cell", + "percent-encoding", + "pin-utils", + "rand", + "regex", + "rmp-serde", + "serde", + "serde_json", + "sha2", + "sha3", + "thiserror", + "time", + "url", + "zmq", +] + +[[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 = "instant" version = "0.1.12" @@ -936,23 +2075,54 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi", + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "ipnet" -version = "2.8.0" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" + +[[package]] +name = "is-terminal" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" +dependencies = [ + "hermit-abi", + "rustix 0.38.31", + "windows-sys 0.52.0", +] + +[[package]] +name = "itertools" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" dependencies = [ "wasm-bindgen", ] @@ -963,7 +2133,7 @@ version = "18.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14f7f76aef2d054868398427f6c54943cf3d1caa9a7ec7d0c38d69df97a965eb" dependencies = [ - "futures 0.3.28", + "futures 0.3.30", "futures-executor", "futures-util", "log", @@ -972,11 +2142,24 @@ dependencies = [ "serde_json", ] +[[package]] +name = "k256" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "956ff9b67e26e1a6a866cb758f12c6f8746208489e3e4a4b5580802f2f0a587b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "once_cell", + "sha2", +] + [[package]] name = "keccak" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" dependencies = [ "cpufeatures", ] @@ -995,18 +2178,61 @@ name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +dependencies = [ + "spin 0.5.2", +] [[package]] name = "libc" -version = "0.2.126" +version = "0.2.153" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" + +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + +[[package]] +name = "libredox" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +dependencies = [ + "bitflags 2.4.2", + "libc", + "redox_syscall", +] + +[[package]] +name = "libsqlite3-sys" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf4e226dcd58b4be396f7bd3c20da8fdee2911400705297ba7d2d7cc2c30f716" +dependencies = [ + "cc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + +[[package]] +name = "linux-raw-sys" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -1021,24 +2247,62 @@ dependencies = [ "value-bag", ] +[[package]] +name = "log-derive" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a42526bb432bcd1b43571d5f163984effa25409a29f1a3242a54d0577d55bcf" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest 0.10.7", +] + [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" + +[[package]] +name = "metadeps" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "73b122901b3a675fac8cecf68dcb2f0d3036193bc861d1ac0e1c337f7d5254c2" +dependencies = [ + "error-chain", + "pkg-config", + "toml", +] [[package]] name = "migration" version = "0.1.0" dependencies = [ + "aries-askar", "async-std", "async-trait", "bs58", + "dirs", "futures 0.1.31", - "indy2_vdr", + "indy-besu-vdr", + "indy-credx", + "indy-data-types 0.6.1", + "indy-vdr", "serde", "serde_json", - "vdrtools", + "urlencoding", ] [[package]] @@ -1047,23 +2311,28 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" -version = "0.6.2" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", - "log", "wasi", "windows-sys 0.48.0", ] @@ -1074,27 +2343,87 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "nix" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +dependencies = [ + "bitflags 2.4.2", + "cfg-if", + "libc", +] + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", + "rand", +] + +[[package]] +name = "num-bigint-dig" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc84195820f291c7697304f3cbdadd1cb7199c0efc917ff5eafd71225c136151" +dependencies = [ + "byteorder", + "lazy_static", + "libm", + "num-integer", + "num-iter", + "num-traits", + "rand", + "smallvec", + "zeroize", +] + +[[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-derive" -version = "0.2.5" +name = "num-iter" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eafd0b45c5537c3ba526f79d3e75120036502bebacbb3f3220914067ce39dbf2" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "syn 0.15.44", + "autocfg", + "num-integer", + "num-traits", ] [[package]] @@ -1104,6 +2433,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", + "libm", ] [[package]] @@ -1116,20 +2446,41 @@ dependencies = [ "libc", ] +[[package]] +name = "num_enum" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +dependencies = [ + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "object" -version = "0.30.4" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "opaque-debug" @@ -1137,13 +2488,38 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" +[[package]] +name = "open-fastrlp" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", + "ethereum-types", + "open-fastrlp-derive", +] + +[[package]] +name = "open-fastrlp-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "003b2be5c6c53c1cfeb0a238b8a1c3915cd410feb684457a36c10038f764bb1c" +dependencies = [ + "bytes", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "openssl" -version = "0.10.57" +version = "0.10.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" +checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.2", "cfg-if", "foreign-types", "libc", @@ -1158,9 +2534,9 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", - "syn 2.0.38", + "proc-macro2", + "quote", + "syn 2.0.48", ] [[package]] @@ -1171,9 +2547,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.93" +version = "0.9.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" +checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" dependencies = [ "cc", "libc", @@ -1181,11 +2557,41 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "p384" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70786f51bcc69f6a4c0360e063a4cac5419ef7c5cd5b3c99ad70f3be5ba79209" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + [[package]] name = "parity-scale-codec" -version = "3.6.5" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dec8a8073036902368c2cdc0387e85ff9a37054d7e7c98e592145e0c92cd4fb" +checksum = "881331e34fa842a2fb61cc2db9643a8fedc615e47cfcc52597d1af0db9a7e8fe" dependencies = [ "arrayvec", "bitvec", @@ -1197,21 +2603,21 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.6.5" +version = "3.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "312270ee71e1cd70289dacf597cab7b207aa107d2f28191c2ae45b2ece18a260" +checksum = "be30eaf4b0a9fba5336683b38de57bb86d179a35862ba6bfcf57625d006bde5b" dependencies = [ - "proc-macro-crate", - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro-crate 2.0.0", + "proc-macro2", + "quote", "syn 1.0.109", ] [[package]] name = "parking" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e52c774a4c39359c1d1c52e43f73dd91a75a614652c825408eec30c95a9b2067" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" @@ -1225,41 +2631,67 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", + "redox_syscall", "smallvec", "windows-targets 0.48.5", ] +[[package]] +name = "password-hash" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346f04948ba92c43e8469c1ee6736c7563d71012b17d40745260fe106aac2166" +dependencies = [ + "base64ct", + "rand_core", + "subtle", +] + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", - "syn 2.0.38", + "proc-macro2", + "quote", + "syn 2.0.48", ] [[package]] @@ -1285,11 +2717,38 @@ dependencies = [ "futures-io", ] +[[package]] +name = "pkcs1" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" +dependencies = [ + "der", + "pkcs8", + "spki", +] + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" + +[[package]] +name = "platforms" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" [[package]] name = "polling" @@ -1307,12 +2766,58 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "polling" +version = "3.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "545c980a3880efd47b2e262f6a4bb6daad6555cf3367aa9c4e52895f69537a41" +dependencies = [ + "cfg-if", + "concurrent-queue", + "pin-project-lite", + "rustix 0.38.31", + "tracing", + "windows-sys 0.52.0", +] + +[[package]] +name = "poly1305" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" +dependencies = [ + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "polyval" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" +dependencies = [ + "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 = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + [[package]] name = "primitive-types" version = "0.12.2" @@ -1323,6 +2828,7 @@ dependencies = [ "impl-codec", "impl-rlp", "impl-serde", + "scale-info", "uint", ] @@ -1333,43 +2839,59 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "toml_edit", + "toml_edit 0.19.15", ] [[package]] -name = "proc-macro2" -version = "0.4.30" +name = "proc-macro-crate" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e8366a6159044a37876a2b9817124296703c586a5c92e2c53751fa06d8d43e8" +dependencies = [ + "toml_edit 0.20.7", +] + +[[package]] +name = "proc-macro-crate" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" dependencies = [ - "unicode-xid 0.1.0", + "toml_edit 0.21.1", ] [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] [[package]] -name = "quote" -version = "0.6.13" +name = "proptest" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" +checksum = "31b476131c3c86cb68032fdc5cb6d5a1045e3e42d96b69fa599fd77701e1f5bf" dependencies = [ - "proc-macro2 0.4.30", + "bitflags 2.4.2", + "lazy_static", + "num-traits", + "rand", + "rand_chacha", + "rand_xorshift", + "regex-syntax", + "unarray", ] [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ - "proc-macro2 1.0.69", + "proc-macro2", ] [[package]] @@ -1409,28 +2931,39 @@ dependencies = [ ] [[package]] -name = "redox_syscall" -version = "0.2.16" +name = "rand_xorshift" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" dependencies = [ - "bitflags 1.3.2", + "rand_core", ] [[package]] name = "redox_syscall" -version = "0.3.5" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_users" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +dependencies = [ + "getrandom", + "libredox", + "thiserror", +] + [[package]] name = "regex" -version = "1.10.0" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d119d7c7ca818f8a53c300863d4f87566aac09943aef5b355bb83969dae75d87" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", @@ -1440,9 +2973,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.1" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "465c6fc0621e4abc4187a2bda0937bfd4f722c2730b29562e19689ea796c9a4b" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", @@ -1451,26 +2984,17 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56d84fdd47036b038fc80dd333d10b6aab10d5d31f4a366e20014def75328d33" - -[[package]] -name = "remove_dir_all" -version = "0.5.3" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.22" +version = "0.11.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" dependencies = [ - "base64 0.21.4", + "base64 0.21.7", "bytes", "encoding_rs", "futures-core", @@ -1488,9 +3012,11 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", + "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "system-configuration", "tokio", "tokio-native-tls", @@ -1503,49 +3029,224 @@ dependencies = [ ] [[package]] -name = "rlp" -version = "0.5.2" +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.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +dependencies = [ + "cc", + "getrandom", + "libc", + "spin 0.9.8", + "untrusted", + "windows-sys 0.48.0", +] + +[[package]] +name = "rlp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" +dependencies = [ + "bytes", + "rlp-derive", + "rustc-hex", +] + +[[package]] +name = "rlp-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "rmp" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f9860a6cc38ed1da53456442089b4dfa35e7cedaa326df63017af88385e6b20" +dependencies = [ + "byteorder", + "num-traits", + "paste", +] + +[[package]] +name = "rmp-serde" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bffea85eea980d8a74453e5d02a8d93028f3c34725de143085a844ebe953258a" +dependencies = [ + "byteorder", + "rmp", + "serde", +] + +[[package]] +name = "rsa" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d0e5124fcb30e76a7e79bfee683a2746db83784b86289f6251b54b7950a0dfc" +dependencies = [ + "const-oid", + "digest 0.10.7", + "num-bigint-dig", + "num-integer", + "num-traits", + "pkcs1", + "pkcs8", + "rand_core", + "signature", + "spki", + "subtle", + "zeroize", +] + +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.37.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" +dependencies = [ + "bitflags 1.3.2", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustix" +version = "0.38.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +dependencies = [ + "bitflags 2.4.2", + "errno", + "libc", + "linux-raw-sys 0.4.13", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls" +version = "0.21.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +dependencies = [ + "ring", + "rustls-webpki", + "sct", +] + +[[package]] +name = "rustls-pemfile" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "bytes", - "rustc-hex", + "base64 0.21.7", ] [[package]] -name = "rustc-demangle" -version = "0.1.23" +name = "rustls-webpki" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" +dependencies = [ + "ring", + "untrusted", +] [[package]] -name = "rustc-hex" -version = "2.1.0" +name = "rustversion" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] -name = "rustc_version" -version = "0.4.0" +name = "ryu" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" + +[[package]] +name = "salsa20" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" dependencies = [ - "semver", + "cipher", ] [[package]] -name = "ryu" -version = "1.0.15" +name = "scale-info" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7d66a1128282b7ef025a8ead62a4a9fcf017382ec53b8ffbf4d7bf77bd3c60" +dependencies = [ + "bitvec", + "cfg-if", + "derive_more", + "parity-scale-codec", + "scale-info-derive", +] + +[[package]] +name = "scale-info-derive" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "abf2c68b89cafb3b8d918dd07b42be0da66ff202cf1155c5739a4e0c1ea0dc19" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1554,6 +3255,30 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring", + "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", + "subtle", + "zeroize", +] + [[package]] name = "secp256k1" version = "0.27.0" @@ -1565,12 +3290,12 @@ dependencies = [ [[package]] name = "secp256k1" -version = "0.28.0" +version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2acea373acb8c21ecb5a23741452acd2593ed44ee3d343e72baaa143bc89d0d5" +checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" dependencies = [ "rand", - "secp256k1-sys 0.9.0", + "secp256k1-sys 0.9.2", ] [[package]] @@ -1584,18 +3309,18 @@ dependencies = [ [[package]] name = "secp256k1-sys" -version = "0.9.0" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09e67c467c38fd24bd5499dc9a18183b31575c12ee549197e3e20d57aa4fe3b7" +checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb" dependencies = [ "cc", ] [[package]] name = "security-framework" -version = "2.8.1" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c4437699b6d34972de58652c68b98cb5b53a4199ab126db8e20ec8ded29a721" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -1606,9 +3331,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.8.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" dependencies = [ "core-foundation-sys", "libc", @@ -1616,35 +3341,55 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" [[package]] name = "serde" -version = "1.0.189" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] +[[package]] +name = "serde-json-core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c9e1ab533c0bc414c34920ec7e5f097101d126ed5eac1a1aac711222e0bbb33" +dependencies = [ + "ryu", + "serde", +] + +[[package]] +name = "serde_cbor" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" +dependencies = [ + "half", + "serde", +] + [[package]] name = "serde_derive" -version = "1.0.189" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", - "syn 2.0.38", + "proc-macro2", + "quote", + "syn 2.0.48", ] [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ "itoa", "ryu", @@ -1687,6 +3432,17 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.7", +] + [[package]] name = "sha3" version = "0.10.8" @@ -1707,61 +3463,355 @@ dependencies = [ ] [[package]] -name = "slab" -version = "0.4.9" +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest 0.10.7", + "rand_core", +] + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" + +[[package]] +name = "socket2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + +[[package]] +name = "soketto" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" +dependencies = [ + "base64 0.13.1", + "bytes", + "futures 0.3.30", + "httparse", + "log", + "rand", + "sha-1", +] + +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "sqlformat" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce81b7bd7c4493975347ef60d8c7e8b742d4694f4c49f93e0a12ea263938176c" +dependencies = [ + "itertools", + "nom", + "unicode_categories", +] + +[[package]] +name = "sqlx" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dba03c279da73694ef99763320dea58b51095dfe87d001b1d4b5fe78ba8763cf" +dependencies = [ + "sqlx-core", + "sqlx-macros", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", +] + +[[package]] +name = "sqlx-core" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d84b0a3c3739e220d94b3239fd69fb1f74bc36e16643423bd99de3b43c21bfbd" +dependencies = [ + "ahash", + "atoi", + "byteorder", + "bytes", + "chrono", + "crc", + "crossbeam-queue", + "dotenvy", + "either", + "event-listener 2.5.3", + "futures-channel", + "futures-core", + "futures-intrusive", + "futures-io", + "futures-util", + "hashlink", + "hex", + "indexmap", + "log", + "memchr", + "once_cell", + "paste", + "percent-encoding", + "rustls", + "rustls-pemfile", + "serde", + "serde_json", + "sha2", + "smallvec", + "sqlformat", + "thiserror", + "tokio", + "tokio-stream", + "tracing", + "url", + "webpki-roots", +] + +[[package]] +name = "sqlx-macros" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89961c00dc4d7dffb7aee214964b065072bff69e36ddb9e2c107541f75e4f2a5" +dependencies = [ + "proc-macro2", + "quote", + "sqlx-core", + "sqlx-macros-core", + "syn 1.0.109", +] + +[[package]] +name = "sqlx-macros-core" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0bd4519486723648186a08785143599760f7cc81c52334a55d6a83ea1e20841" +dependencies = [ + "atomic-write-file", + "dotenvy", + "either", + "heck", + "hex", + "once_cell", + "proc-macro2", + "quote", + "serde", + "serde_json", + "sha2", + "sqlx-core", + "sqlx-mysql", + "sqlx-postgres", + "sqlx-sqlite", + "syn 1.0.109", + "tempfile", + "tokio", + "url", +] + +[[package]] +name = "sqlx-mysql" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e37195395df71fd068f6e2082247891bc11e3289624bbc776a0cdfa1ca7f1ea4" +dependencies = [ + "atoi", + "base64 0.21.7", + "bitflags 2.4.2", + "byteorder", + "bytes", + "chrono", + "crc", + "digest 0.10.7", + "dotenvy", + "either", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "generic-array", + "hex", + "hkdf", + "hmac", + "itoa", + "log", + "md-5", + "memchr", + "once_cell", + "percent-encoding", + "rand", + "rsa", + "serde", + "sha1", + "sha2", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror", + "tracing", + "whoami", +] + +[[package]] +name = "sqlx-postgres" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6ac0ac3b7ccd10cc96c7ab29791a7dd236bd94021f31eec7ba3d46a74aa1c24" +dependencies = [ + "atoi", + "base64 0.21.7", + "bitflags 2.4.2", + "byteorder", + "chrono", + "crc", + "dotenvy", + "etcetera", + "futures-channel", + "futures-core", + "futures-io", + "futures-util", + "hex", + "hkdf", + "hmac", + "home", + "itoa", + "log", + "md-5", + "memchr", + "once_cell", + "rand", + "serde", + "serde_json", + "sha1", + "sha2", + "smallvec", + "sqlx-core", + "stringprep", + "thiserror", + "tracing", + "whoami", +] + +[[package]] +name = "sqlx-sqlite" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "210976b7d948c7ba9fced8ca835b11cbb2d677c59c79de41ac0d397e14547490" +dependencies = [ + "atoi", + "chrono", + "flume", + "futures-channel", + "futures-core", + "futures-executor", + "futures-intrusive", + "futures-util", + "libsqlite3-sys", + "log", + "percent-encoding", + "serde", + "sqlx-core", + "tracing", + "url", + "urlencoding", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "stringprep" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb41d74e231a107a1b4ee36bd1214b11285b77768d2e3824aedafa988fd36ee6" dependencies = [ - "autocfg", + "finl_unicode", + "unicode-bidi", + "unicode-normalization", ] [[package]] -name = "smallvec" -version = "1.11.1" +name = "strsim" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" +checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" [[package]] -name = "socket2" -version = "0.4.7" +name = "strum" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" dependencies = [ - "libc", - "winapi", + "strum_macros", ] [[package]] -name = "soketto" -version = "0.7.1" +name = "strum_macros" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d1c5305e39e09653383c2c7244f2f78b3bcae37cf50c64cb4789c9f5096ec2" +checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" dependencies = [ - "base64 0.13.1", - "bytes", - "futures 0.3.28", - "httparse", - "log", - "rand", - "sha-1", + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.48", ] [[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "syn" -version = "0.15.44" +name = "subtle" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca4b3b69a77cbe1ffc9e198781b7acb0c7365a883670e8f1c1bc66fba79a5c5" -dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", - "unicode-xid 0.1.0", -] +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" @@ -1769,33 +3819,27 @@ version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "unicode-ident", ] [[package]] name = "syn" -version = "2.0.38" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", + "proc-macro2", + "quote", "unicode-ident", ] [[package]] -name = "synstructure" -version = "0.12.6" +name = "sync_wrapper" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" -dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", - "syn 1.0.109", - "unicode-xid 0.2.4", -] +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" [[package]] name = "system-configuration" @@ -1826,36 +3870,70 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.3.0" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" dependencies = [ "cfg-if", - "fastrand 1.9.0", - "libc", - "redox_syscall 0.2.16", - "remove_dir_all", - "winapi", + "fastrand 2.0.1", + "redox_syscall", + "rustix 0.38.31", + "windows-sys 0.52.0", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", ] [[package]] name = "thiserror" -version = "1.0.49" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.49" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "time" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd0cbfecb4d19b5ea75bb31ad904eb5b9fa13f21079c3b92017ebdf4999a5890" +dependencies = [ + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e153e1f1acaef8acc537e68b44906d2db6436e2b35ac2c6b42640fff91f00fd" + +[[package]] +name = "time-macros" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" +checksum = "fd80a657e71da814b8e5d60d3374fc6d35045062245d80224748ae522dd76f36" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", - "syn 2.0.38", + "time-core", ] [[package]] @@ -1884,33 +3962,32 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.26.0" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" dependencies = [ - "autocfg", + "backtrace", "bytes", "libc", - "memchr", "mio", "num_cpus", "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.5.5", "tokio-macros", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "1.8.2" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", - "syn 1.0.109", + "proc-macro2", + "quote", + "syn 2.0.48", ] [[package]] @@ -1936,9 +4013,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", @@ -1949,11 +4026,17 @@ dependencies = [ "tracing", ] +[[package]] +name = "toml" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "736b60249cb25337bc196faa43ee12c705e426f3d55c214d73a4e7be06f92cb4" + [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" [[package]] name = "toml_edit" @@ -1961,7 +4044,29 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.2", + "indexmap", + "toml_datetime", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.20.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" +dependencies = [ + "indexmap", + "toml_datetime", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" +dependencies = [ + "indexmap", "toml_datetime", "winnow", ] @@ -1974,29 +4079,50 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", + "log", "pin-project-lite", + "tracing-attributes", "tracing-core", ] +[[package]] +name = "tracing-attributes" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", ] +[[package]] +name = "trie-root" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4ed310ef5ab98f5fa467900ed906cb9232dd5376597e00fd4cba2a449d06c0b" +dependencies = [ + "hash-db", +] + [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typenum" @@ -2016,11 +4142,17 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "unarray" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" + [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" @@ -2038,10 +4170,10 @@ dependencies = [ ] [[package]] -name = "unicode-xid" -version = "0.1.0" +name = "unicode-segmentation" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" [[package]] name = "unicode-xid" @@ -2049,61 +4181,65 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "unicode_categories" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" + +[[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.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", - "idna", + "idna 0.5.0", "percent-encoding", ] [[package]] -name = "value-bag" -version = "1.4.1" +name = "urlencoding" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d92ccd67fb88503048c01b59152a04effd0782d035a83a6d256ce6085f08f4a3" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" [[package]] -name = "vcpkg" -version = "0.2.15" +name = "uuid" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - -[[package]] -name = "vdrtools" -version = "0.8.6" -source = "git+https://gitlab.com/evernym/verity/vdr-tools.git#d0bb0ef2ec9cefbf7f74939bad7bba4f09185927" +checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" dependencies = [ - "async-std", - "async-trait", - "failure", - "futures 0.1.31", - "lazy_static", - "libc", - "log", - "num-derive", - "num-traits", - "serde", - "serde_derive", - "serde_json", - "vdrtools-sys", + "getrandom", ] [[package]] -name = "vdrtools-sys" -version = "0.8.6" -source = "git+https://gitlab.com/evernym/verity/vdr-tools.git#d0bb0ef2ec9cefbf7f74939bad7bba4f09185927" -dependencies = [ - "libc", - "pkg-config", - "regex", - "serde", - "serde_derive", - "vcpkg", -] +name = "value-bag" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126e423afe2dd9ac52142e7e9d5ce4135d7e13776c529d27fd6bc49f19e3280b" + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" @@ -2134,9 +4270,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2144,24 +4280,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" dependencies = [ "bumpalo", "log", "once_cell", - "proc-macro2 1.0.69", - "quote 1.0.33", - "syn 2.0.38", + "proc-macro2", + "quote", + "syn 2.0.48", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" dependencies = [ "cfg-if", "js-sys", @@ -2171,38 +4307,38 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" dependencies = [ - "quote 1.0.33", + "quote", "wasm-bindgen-macro-support", ] [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" dependencies = [ - "proc-macro2 1.0.69", - "quote 1.0.33", - "syn 2.0.38", + "proc-macro2", + "quote", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" dependencies = [ "js-sys", "wasm-bindgen", @@ -2215,16 +4351,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5388522c899d1e1c96a4c307e3797e0f697ba7c77dd8e0e625ecba9dd0342937" dependencies = [ "arrayvec", - "base64 0.21.4", + "base64 0.21.7", "bytes", "derive_more", "ethabi", "ethereum-types", - "futures 0.3.28", + "futures 0.3.30", "futures-timer", "headers", "hex", - "idna", + "idna 0.4.0", "jsonrpc-core", "log", "once_cell", @@ -2256,6 +4392,18 @@ dependencies = [ "url", ] +[[package]] +name = "webpki-roots" +version = "0.25.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" + +[[package]] +name = "whoami" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22fc3756b8a9133049b26c7f61ab35416c130e8c09b660f5b3958b446f52cc50" + [[package]] name = "winapi" version = "0.3.9" @@ -2273,33 +4421,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" +name = "winapi-util" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +dependencies = [ + "winapi", +] [[package]] -name = "windows-sys" -version = "0.42.0" +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", -] +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "windows-sys" -version = "0.45.0" +name = "windows-core" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.42.2", + "windows-targets 0.52.0", ] [[package]] @@ -2312,18 +4454,12 @@ dependencies = [ ] [[package]] -name = "windows-targets" -version = "0.42.2" +name = "windows-sys" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows-targets 0.52.0", ] [[package]] @@ -2342,10 +4478,19 @@ dependencies = [ ] [[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" +name = "windows-targets" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +dependencies = [ + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", +] [[package]] name = "windows_aarch64_gnullvm" @@ -2354,10 +4499,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" +name = "windows_aarch64_gnullvm" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[package]] name = "windows_aarch64_msvc" @@ -2366,10 +4511,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] -name = "windows_i686_gnu" -version = "0.42.2" +name = "windows_aarch64_msvc" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" @@ -2378,10 +4523,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] -name = "windows_i686_msvc" -version = "0.42.2" +name = "windows_i686_gnu" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] name = "windows_i686_msvc" @@ -2390,10 +4535,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" +name = "windows_i686_msvc" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" @@ -2402,10 +4547,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" +name = "windows_x86_64_gnu" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" @@ -2414,10 +4559,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" +name = "windows_x86_64_gnullvm" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" @@ -2425,11 +4570,17 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + [[package]] name = "winnow" -version = "0.5.16" +version = "0.5.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037711d82167854aff2018dfd193aa0fef5370f456732f0d5a0c59b0f1b4b907" +checksum = "a7cad8365489051ae9f054164e459304af2e7e9bb407c958076c8bf4aef52da5" dependencies = [ "memchr", ] @@ -2452,3 +4603,86 @@ checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" dependencies = [ "tap", ] + +[[package]] +name = "x25519-dalek" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96" +dependencies = [ + "curve25519-dalek", + "rand_core", + "zeroize", +] + +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "zeroize" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "zeromq-src" +version = "0.1.10+4.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df9133d366817fcffe22e4356043ba187ae122ec5db63d7ce73d1e6a18efa2f1" +dependencies = [ + "cmake", +] + +[[package]] +name = "zmq" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aad98a7a617d608cd9e1127147f630d24af07c7cd95ba1533246d96cbdd76c66" +dependencies = [ + "bitflags 1.3.2", + "libc", + "log", + "zmq-sys", +] + +[[package]] +name = "zmq-sys" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d33a2c51dde24d5b451a2ed4b488266df221a5eaee2ee519933dc46b9a9b3648" +dependencies = [ + "libc", + "metadeps", + "zeromq-src", +] diff --git a/examples/migration/Cargo.toml b/examples/migration/Cargo.toml index 1b86b414..b5c2b542 100644 --- a/examples/migration/Cargo.toml +++ b/examples/migration/Cargo.toml @@ -1,16 +1,21 @@ [package] name = "migration" -description = "This package contains an execution script demonstratin the migration flow from Indy to Besu ledger" +description = "This package contains an execution script demonstratin the migration flow from Indy to Indy-Besu ledger" version = "0.1.0" authors = ["artem.ivanov "] -edition = "2018" +edition = "2021" [dependencies] +aries-askar = "0.3.1" async-std = { version = "1.12.0", features = ["attributes", "tokio1"] } async-trait = "0.1.73" +indy-credx = "1.1.1" bs58 = "0.5.0" futures = "0.1.23" -indy2_vdr = { path = "../../vdr", features = ["migration", "basic_signer"] } -vdrtools = { git = "https://gitlab.com/evernym/verity/vdr-tools.git" } +indy-data-types = "0.6.1" +indy-besu-vdr = { path = "../../vdr", features = ["migration", "basic_signer"] } +indy-vdr = { git = "https://github.com/hyperledger/indy-vdr.git" } serde = "1.0.188" serde_json = "1.0.107" +urlencoding = "2.1.2" +dirs = "5.0.1" diff --git a/examples/migration/README.md b/examples/migration/README.md new file mode 100644 index 00000000..075b331f --- /dev/null +++ b/examples/migration/README.md @@ -0,0 +1,23 @@ +Sample script demonstration migration path described at the [design document](../../docs/migration/migration.md). + +> NOTE: Under development + +### Flow + +The scripts consist of the following steps: +1. Setup actors: Trustee, Issuer, Verifier, Holder +2. Prepare Issuer data (DID, Schema, Credential Definition) and publish it to [Indy-Node](https://github.com/hyperledger/indy-node.git) +3. Issuer issue a credential to Holder and verifier request proof +4. Issuer migrate data to Besu Ledger +5. Verify previously issued holder credential using Besu Ledger as the data registry + +### Requirements + +* [Genesis transactions](./indy-genesis.txn) of a running Indy ledger +* [Node and contracts](./besu-config.json) of a running Indy-Besu ledger + +### Run + +``` +cargo run +``` \ No newline at end of file diff --git a/examples/migration/besu-config.json b/examples/migration/besu-config.json new file mode 100644 index 00000000..8ea82bf3 --- /dev/null +++ b/examples/migration/besu-config.json @@ -0,0 +1,22 @@ +{ + "chainId": 1337, + "nodeAddress": "http://127.0.0.1:8545", + "contracts": { + "didRegistry": { + "address": "0x0000000000000000000000000000000000018888", + "path": "../../smart_contracts/artifacts/contracts/did/EthereumExtDidRegistry.sol/EthereumExtDidRegistry.json" + }, + "schemaRegistry": { + "address": "0x0000000000000000000000000000000000005555", + "path": "../../smart_contracts/artifacts/contracts/cl/SchemaRegistry.sol/SchemaRegistry.json" + }, + "credentialDefinitionRegistry": { + "address": "0x0000000000000000000000000000000000004444", + "path": "../../smart_contracts/artifacts/contracts/cl/CredentialDefinitionRegistry.sol/CredentialDefinitionRegistry.json" + }, + "roleControl": { + "address": "0x0000000000000000000000000000000000006666", + "path": "../../smart_contracts/artifacts/contracts/auth/RoleControl.sol/RoleControl.json" + } + } +} \ No newline at end of file diff --git a/examples/migration/docker.txn b/examples/migration/indy-genesis.txn similarity index 100% rename from examples/migration/docker.txn rename to examples/migration/indy-genesis.txn diff --git a/examples/migration/src/holder.rs b/examples/migration/src/holder.rs index aba2acee..602d9628 100644 --- a/examples/migration/src/holder.rs +++ b/examples/migration/src/holder.rs @@ -2,132 +2,122 @@ use crate::{ ledger::{BesuLedger, IndyLedger, Ledgers}, wallet::{BesuWallet, IndyWallet}, }; -use indy2_vdr::{ - migration::{IndyCredentialDefinitionFormat, IndySchemaFormat}, - CredentialDefinitionId, SchemaId, +use indy_credx::types::{ + Credential, CredentialDefinition, CredentialDefinitionId, CredentialOffer, CredentialRequest, + CredentialRequestMetadata, DidValue, LinkSecret, PresentCredentials, Presentation, + PresentationRequest, Schema, SchemaId, }; -use serde_json::json; -use vdrtoolsrs::future::Future; +use std::collections::HashMap; pub struct Holder { - indy_wallet: IndyWallet, - indy_ledger: IndyLedger, - besu_ledger: BesuLedger, - did: String, - master_secret: String, - used_ledger: Ledgers, + pub indy_wallet: IndyWallet, + pub indy_ledger: IndyLedger, + pub besu_ledger: BesuLedger, + pub besu_wallet: BesuWallet, + pub indy_did: String, + pub master_secret: LinkSecret, + pub master_secret_name: String, + pub used_ledger: Ledgers, + cred_request_meta: Option, } impl Holder { const NAME: &'static str = "holder"; pub async fn setup() -> Holder { - let indy_wallet = IndyWallet::new(Self::NAME); - let indy_ledger = IndyLedger::new(Self::NAME); + let indy_wallet = IndyWallet::new(None).await; + let indy_ledger = IndyLedger::new(); let besu_wallet = BesuWallet::new(None); - let besu_ledger = BesuLedger::new(besu_wallet).await; - let master_secret = - vdrtoolsrs::anoncreds::prover_create_master_secret(indy_wallet.handle, None) - .wait() - .unwrap(); - let (did, _) = vdrtoolsrs::did::create_and_store_my_did(indy_wallet.handle, "{}") - .wait() - .unwrap(); + let besu_ledger = BesuLedger::new().await; + let master_secret = indy_credx::prover::create_link_secret().unwrap(); + let indy_did = indy_wallet.did.clone(); Holder { indy_wallet, indy_ledger, + besu_wallet, besu_ledger, - did, + indy_did, master_secret, + master_secret_name: Self::NAME.to_string(), used_ledger: Ledgers::Indy, + cred_request_meta: None, } } - pub fn create_credential_request(&self, cred_offer: &str, cred_def: &str) -> (String, String) { - vdrtoolsrs::anoncreds::prover_create_credential_req( - self.indy_wallet.handle, - &self.did, - cred_offer, - cred_def, + pub async fn create_credential_request( + &mut self, + cred_offer: &CredentialOffer, + ) -> CredentialRequest { + let cred_def = self.get_cred_def(&cred_offer.cred_def_id).await; + let (cred_req, cred_request_meta) = indy_credx::prover::create_credential_request( + &DidValue(self.indy_did.to_string()), + &cred_def, &self.master_secret, + &self.master_secret_name, + cred_offer, ) - .wait() - .unwrap() + .unwrap(); + self.cred_request_meta = Some(cred_request_meta); + cred_req } - pub fn store_credential( - &self, - cred_request_meta: &str, - credential: &str, - cred_def: &str, - ) -> String { - vdrtoolsrs::anoncreds::prover_store_credential( - self.indy_wallet.handle, - None, - cred_request_meta, + pub async fn store_credential(&self, credential: &mut Credential) { + let cred_def = self.get_cred_def(&credential.cred_def_id).await; + let cred_request_meta = self + .cred_request_meta + .as_ref() + .expect("missing cred_request_meta"); + indy_credx::prover::process_credential( credential, - cred_def, + cred_request_meta, + &self.master_secret, + &cred_def, None, ) - .wait() - .unwrap() + .unwrap(); + } + + async fn get_schema(&self, schema_id: &str) -> Schema { + match self.used_ledger { + Ledgers::Indy => self.indy_ledger.get_schema(schema_id).await, + Ledgers::Besu => self.besu_ledger.get_schema(schema_id).await, + } } - pub fn make_request_credentials(cred_id: &str) -> String { - json!({ - "self_attested_attributes": {}, - "requested_attributes": { - "attr1_referent": { "cred_id": cred_id, "revealed": true } - }, - "requested_predicates": {} - }) - .to_string() + async fn get_cred_def(&self, cred_def_id: &str) -> CredentialDefinition { + match self.used_ledger { + Ledgers::Indy => self.indy_ledger.get_cred_def(cred_def_id).await, + Ledgers::Besu => self.besu_ledger.get_cred_def(cred_def_id).await, + } } - pub async fn make_proof(&self, proof_request: &str, cred_id: &str) -> String { - let requested_credentials = Holder::make_request_credentials(&cred_id); - let credential = - vdrtoolsrs::anoncreds::prover_get_credential(self.indy_wallet.handle, &cred_id) - .wait() - .unwrap(); - let credential = serde_json::from_str::(&credential).unwrap(); - let schema_id = credential["schema_id"].as_str().unwrap(); - let cred_def_id = credential["cred_def_id"].as_str().unwrap(); + pub async fn make_proof( + &self, + proof_request: &PresentationRequest, + credential: &Credential, + ) -> Presentation { + let schema = self.get_schema(&credential.schema_id).await; + let cred_def = self.get_cred_def(&credential.cred_def_id).await; + + let mut schemas: HashMap = HashMap::new(); + schemas.insert(credential.schema_id.clone(), &schema); - let (schema, cred_def) = match self.used_ledger { - Ledgers::Indy => { - let (_, schema) = self.indy_ledger.get_schema(&schema_id); - let (_, cred_def) = self.indy_ledger.get_cred_def(&cred_def_id); - (schema, cred_def) - } - Ledgers::Besu => { - let schema_id = SchemaId::from_indy_format(schema_id).unwrap(); - let cred_def_id = CredentialDefinitionId::from_indy_format(cred_def_id).unwrap(); - let schema = self.besu_ledger.get_schema(&schema_id).await; - let cred_def = self.besu_ledger.get_cred_def(&cred_def_id).await; - let schema: IndySchemaFormat = schema.into(); - let cred_def: IndyCredentialDefinitionFormat = cred_def.into(); - (json!(schema).to_string(), json!(cred_def).to_string()) - } - }; + let mut cred_defs: HashMap = HashMap::new(); + cred_defs.insert(credential.cred_def_id.clone(), &cred_def); - let schemas_json = - json!({schema_id: serde_json::from_str::(&schema).unwrap()}) - .to_string(); - let cred_defs_json = - json!({cred_def_id: serde_json::from_str::(&cred_def).unwrap()}) - .to_string(); + let mut credentials = PresentCredentials::new(); + credentials + .add_credential(credential, None, None) + .add_requested_attribute("attr1_referent", true); - vdrtoolsrs::anoncreds::prover_create_proof( - self.indy_wallet.handle, - &proof_request, - &requested_credentials, + indy_credx::prover::create_presentation( + proof_request, + credentials, + None, &self.master_secret, - &schemas_json, - &cred_defs_json, - "{}", + &schemas, + &cred_defs, ) - .wait() .unwrap() } diff --git a/examples/migration/src/issuer.rs b/examples/migration/src/issuer.rs index a4b0980d..7d998f4b 100644 --- a/examples/migration/src/issuer.rs +++ b/examples/migration/src/issuer.rs @@ -2,217 +2,211 @@ use crate::{ ledger::{BesuLedger, IndyLedger, Ledgers}, wallet::{BesuWallet, IndyWallet}, }; -use indy2_vdr::{CredentialDefinition, CredentialDefinitionRegistry, DidDocument, DidDocumentBuilder, DidRegistry, Schema, SchemaRegistry, VerificationKey, VerificationKeyType, DID, Address}; +use indy_besu_vdr::{Address, DidDocAttribute, DID}; +use indy_credx::types::{ + AttributeNames, AttributeValues, Credential, CredentialDefinition, CredentialDefinitionConfig, + CredentialDefinitionId, CredentialDefinitionPrivate, CredentialKeyCorrectnessProof, + CredentialOffer, CredentialRequest, CredentialValues, DidValue, Schema, SchemaId, + SignatureType, +}; use serde_json::json; -use std::time::Duration; -use vdrtoolsrs::future::Future; +use std::collections::HashMap; pub struct Issuer { - indy_wallet: IndyWallet, - indy_ledger: IndyLedger, - besu_ledger: BesuLedger, - pub did: String, - pub account: Address, + pub indy_wallet: IndyWallet, + pub indy_ledger: IndyLedger, + pub besu_wallet: BesuWallet, + pub besu_ledger: BesuLedger, + pub indy_did: String, + pub besu_did: String, pub edkey: String, + pub account: Address, pub secpkey: String, pub service: String, - used_ledger: Ledgers, + pub used_ledger: Ledgers, + pub schema_attributes: Vec, + pub credential_values: HashMap, + cred_def_priv: Option, + correctness_proof: Option, } impl Issuer { - const NAME: &'static str = "issuer"; - const SCHEMA_NAME: &'static str = "test_credential"; const SCHEMA_VERSION: &'static str = "1.0.0"; - const SCHEMA_ATTRIBUTES: &'static str = r#"["first_name", "last_name"]"#; - const CREDENTIAL_VALUES: &'static str = r#"{"first_name": {"raw": "alice", "encoded":"3987245649832503"}, "last_name": {"raw": "clarck", "encoded": "45436456457657"}}"#; - pub const SECP_PRIVATE_KEY: &'static str = - "8bbbb1b345af56b560a5b20bd4b0ed1cd8cc9958a16262bc75118453cb546df7"; - pub const SERVICE_ENDPOINT: &'static str = "127.0.0.1:5555"; + const SERVICE_ENDPOINT: &'static str = "127.0.0.1:5555"; pub async fn setup() -> Issuer { - let indy_wallet = IndyWallet::new(Self::NAME); - let indy_ledger = IndyLedger::new(Self::NAME); - let besu_wallet = BesuWallet::new(Some(Self::SECP_PRIVATE_KEY)); + let indy_wallet = IndyWallet::new(None).await; + let indy_ledger = IndyLedger::new(); + let besu_wallet = BesuWallet::new(None); + let besu_ledger = BesuLedger::new().await; + + let indy_did = indy_wallet.did.clone(); + let edkey = indy_wallet.edkey.clone(); let account = besu_wallet.account.clone(); let secpkey = besu_wallet.secpkey.clone(); - let besu_ledger = BesuLedger::new(besu_wallet).await; - let (did, verkey) = vdrtoolsrs::did::create_and_store_my_did(indy_wallet.handle, "{}") - .wait() - .unwrap(); + let besu_did = DID::build("ethr", None, account.as_ref()); + + let schema_attributes = vec!["name".to_string(), "age".to_string()]; + + let mut credential_values: HashMap = HashMap::new(); + credential_values.insert( + "name".to_string(), + AttributeValues { + raw: "Alex".to_string(), + encoded: "1139481716457488690172217916278103335".to_string(), + }, + ); + credential_values.insert( + "age".to_string(), + AttributeValues { + raw: "28".to_string(), + encoded: "28".to_string(), + }, + ); + Issuer { + indy_ledger, indy_wallet, besu_ledger, - indy_ledger, - did, - edkey: verkey, + besu_wallet, + indy_did, + besu_did: besu_did.to_string(), + edkey, account, secpkey, used_ledger: Ledgers::Indy, service: Self::SERVICE_ENDPOINT.to_string(), + cred_def_priv: None, + correctness_proof: None, + schema_attributes, + credential_values, } } - pub fn publish_attrib(&self, attrib: &str) { - let request = vdrtoolsrs::ledger::build_attrib_request( - &self.did, - &self.did, - None, - Some(attrib), + pub async fn create_schema(&self) -> (SchemaId, Schema) { + let schema = indy_credx::issuer::create_schema( + &DidValue(self.indy_did.to_string()), + Self::SCHEMA_NAME, + Self::SCHEMA_VERSION, + AttributeNames::from(self.schema_attributes.clone()), None, ) - .wait() .unwrap(); - let _response = vdrtoolsrs::ledger::sign_and_submit_request( - self.indy_ledger.handle, - self.indy_wallet.handle, - &self.did, - &request, + (schema.id().clone(), schema) + } + + pub async fn create_cred_def( + &mut self, + schema_id: &SchemaId, + ) -> (CredentialDefinitionId, CredentialDefinition) { + let schema = self.indy_ledger.get_schema(schema_id).await; + let (cred_def, cred_def_priv, cred_def_proof) = + indy_credx::issuer::create_credential_definition( + &DidValue(self.indy_did.to_string()), + &schema, + Self::SCHEMA_VERSION, + SignatureType::CL, + CredentialDefinitionConfig::new(false), + ) + .unwrap(); + + self.cred_def_priv = Some(cred_def_priv); + self.correctness_proof = Some(cred_def_proof); + + (cred_def.id().clone(), cred_def) + } + + pub fn create_credential_offer( + &self, + schema_id: &SchemaId, + cred_def: &CredentialDefinition, + ) -> CredentialOffer { + let correctness_proof = self + .correctness_proof + .as_ref() + .expect("missing correctness_proof"); + indy_credx::issuer::create_credential_offer(schema_id, cred_def, correctness_proof).unwrap() + } + + pub fn sign_credential( + &self, + cred_def: &CredentialDefinition, + cred_offer: &CredentialOffer, + cred_req: &CredentialRequest, + ) -> Credential { + let cred_def_priv = self.cred_def_priv.as_ref().expect("missing cred_def_priv"); + let (credential, _, _) = indy_credx::issuer::create_credential( + cred_def, + cred_def_priv, + cred_offer, + cred_req, + CredentialValues(self.credential_values.clone()), + None, ) - .wait() .unwrap(); - std::thread::sleep(Duration::from_millis(500)); + credential + } + + pub async fn publish_attrib_to_indy(&self, attrib: &serde_json::Value) { + self.indy_ledger + .publish_attrib(&self.indy_wallet, &self.indy_did, &self.indy_did, attrib) + .await; } - pub fn publish_service_endpoint(&self, endpoint: &str) { + pub async fn publish_service_endpoint_to_indy(&self, endpoint: &str) { let endpoint = json!({ "endpoint":{ "ha": endpoint } - }) - .to_string(); - self.publish_attrib(&endpoint) + }); + self.publish_attrib_to_indy(&endpoint).await } - pub fn publish_besu_ledger_account(&self, key: &str) { + pub async fn publish_besu_ledger_account_to_indy(&self, key: &str) { let key = json!({ "besu":{ "key": key } - }) - .to_string(); - self.publish_attrib(&key) + }); + self.publish_attrib_to_indy(&key).await } - pub fn create_schema(&self) -> (String, String) { - let (schema_id, schema) = vdrtoolsrs::anoncreds::issuer_create_schema( - &self.did, - Self::SCHEMA_NAME, - Self::SCHEMA_VERSION, - Self::SCHEMA_ATTRIBUTES, - ) - .wait() - .unwrap(); - let request = vdrtoolsrs::ledger::build_schema_request(&self.did, &schema) - .wait() - .unwrap(); - let _response = vdrtoolsrs::ledger::sign_and_submit_request( - self.indy_ledger.handle, - self.indy_wallet.handle, - &self.did, - &request, - ) - .wait() - .unwrap(); - std::thread::sleep(Duration::from_millis(500)); - (schema_id, schema) - } - - pub fn create_cred_def(&self, schema_id: &str) -> (String, String) { - let (_, schema) = self.indy_ledger.get_schema(schema_id); - let (cred_def_id, cred_def) = - vdrtoolsrs::anoncreds::issuer_create_and_store_credential_def( - self.indy_wallet.handle, - &self.did, - &schema, - "default", - None, - "{}", - ) - .wait() - .unwrap(); - let request = vdrtoolsrs::ledger::build_cred_def_request(&self.did, &cred_def) - .wait() - .unwrap(); - let _response = vdrtoolsrs::ledger::sign_and_submit_request( - self.indy_ledger.handle, - self.indy_wallet.handle, - &self.did, - &request, - ) - .wait() - .unwrap(); - std::thread::sleep(Duration::from_millis(500)); - (cred_def_id, cred_def) + pub async fn publish_schema_to_indy(&self, schema: &Schema) { + self.indy_ledger + .publish_schema(&self.indy_wallet, &self.indy_did, schema) + .await; } - pub fn create_credential_offer(&self, cred_def_id: &str) -> String { - vdrtoolsrs::anoncreds::issuer_create_credential_offer(self.indy_wallet.handle, cred_def_id) - .wait() - .unwrap() + pub async fn publish_cred_def_to_indy(&self, cred_def: &CredentialDefinition) { + self.indy_ledger + .publish_cred_def(&self.indy_wallet, &self.indy_did, cred_def) + .await; } - pub fn sign_credential(&self, cred_offer: &str, cred_request: &str) -> String { - let (credential, _, _) = vdrtoolsrs::anoncreds::issuer_create_credential( - self.indy_wallet.handle, - cred_offer, - cred_request, - Issuer::CREDENTIAL_VALUES, - None, - -1, - ) - .wait() - .unwrap(); - credential - } - - pub fn build_did_doc(did: &str, edkey: &str, secpkey: &str, endpoint: &str) -> DidDocument { - let id = DID::build("indy", "testnet", did); - DidDocumentBuilder::new() - .set_id(&id) - .add_verification_method( - VerificationKeyType::Ed25519VerificationKey2018, - &id, - VerificationKey::Multibase { - public_key_multibase: edkey.to_string(), - }, - ) - .add_verification_method( - VerificationKeyType::EcdsaSecp256k1VerificationKey2019, - &id, - VerificationKey::Multibase { - public_key_multibase: secpkey.to_string(), - }, - ) - .add_authentication_reference(0) - .unwrap() - .add_authentication_reference(1) - .unwrap() - .add_service("DIDCommService", endpoint) - .build() - } - - pub async fn publish_did(&self, did_doc: &DidDocument) -> String { - DidRegistry::create_did(&self.besu_ledger.client, &self.account, did_doc) + pub async fn publish_did_attribute_to_besu(&self, attribute: &DidDocAttribute) { + self.besu_ledger + .publish_did_attribute(&self.account, &self.besu_did, attribute, &self.besu_wallet) .await - .unwrap() } - pub async fn publish_schema(&self, schema: &Schema) -> String { - SchemaRegistry::create_schema(&self.besu_ledger.client, &self.account, schema) + pub async fn publish_schema_to_besu( + &self, + schema: &indy_besu_vdr::Schema, + ) -> indy_besu_vdr::SchemaId { + self.besu_ledger + .publish_schema(&self.account, schema, &self.besu_wallet) .await - .unwrap() } - pub async fn publish_cred_def(&self, cred_def: &CredentialDefinition) -> String { - CredentialDefinitionRegistry::create_credential_definition( - &self.besu_ledger.client, - &self.account, - cred_def, - ) - .await - .unwrap() + pub async fn publish_cred_def_to_besu( + &self, + cred_def: &indy_besu_vdr::CredentialDefinition, + ) -> indy_besu_vdr::CredentialDefinitionId { + self.besu_ledger + .publish_cred_def(&self.account, cred_def, &self.besu_wallet) + .await } pub fn use_indy_ledger(&mut self) { diff --git a/examples/migration/src/ledger.rs b/examples/migration/src/ledger.rs index b1f9910f..83736989 100644 --- a/examples/migration/src/ledger.rs +++ b/examples/migration/src/ledger.rs @@ -1,11 +1,27 @@ -use crate::wallet::BesuWallet; -use indy2_vdr::{ - ContractConfig, CredentialDefinition, CredentialDefinitionId, CredentialDefinitionRegistry, - LedgerClient, Schema, SchemaId, SchemaRegistry, Status, +use crate::wallet::{BesuWallet, IndyWallet}; +use indy_besu_vdr::{ + credential_definition_registry::{ + build_create_credential_definition_transaction, resolve_credential_definition, + }, + did_ethr_registry::build_did_set_attribute_transaction, + role_control::build_assign_role_transaction, + schema_registry::{build_create_schema_transaction, resolve_schema}, + Address, ContractConfig, DidDocAttribute, LedgerClient, Role, Status, Transaction, Validity, }; +use indy_credx::types::{AttributeNames, CredentialDefinition, Schema}; +use indy_data_types::{CredentialDefinitionId, SchemaId}; +use indy_vdr::{ + config::PoolConfig, + ledger::constants::UpdateRole, + pool::{ + helpers::perform_ledger_request, LocalPool, Pool, PoolBuilder, PoolTransactions, + PreparedRequest, RequestResult, + }, + utils::did::DidValue, +}; +use serde::{Deserialize, Serialize}; use serde_json::json; -use std::{env, fs}; -use vdrtoolsrs::{future::Future, PoolHandle}; +use std::{env, fs, str::FromStr, time::Duration}; pub enum Ledgers { Indy, @@ -13,53 +29,161 @@ pub enum Ledgers { } pub struct IndyLedger { - pub handle: PoolHandle, + pool: LocalPool, } impl IndyLedger { - pub fn new(name: &str) -> IndyLedger { + pub fn new() -> IndyLedger { let mut cur_dir = env::current_dir().unwrap(); - cur_dir.push("docker.txn"); - let genesis_txn = fs::canonicalize(&cur_dir) - .unwrap() - .to_str() - .unwrap() - .to_string(); - - let config = json!({ "genesis_txn": genesis_txn }).to_string(); - vdrtoolsrs::pool::create_pool_ledger_config(name, Some(&config)) - .wait() - .ok(); - let handle = vdrtoolsrs::pool::open_pool_ledger(name, None) - .wait() + cur_dir.push("indy-genesis.txn"); + let pool_transactions = PoolTransactions::from_json_file(cur_dir.as_path()).unwrap(); + + let pool = PoolBuilder::new(PoolConfig::default(), pool_transactions) + .into_local() .unwrap(); - IndyLedger { handle } + IndyLedger { pool } } - pub fn get_schema(&self, id: &str) -> (String, String) { - let request = vdrtoolsrs::ledger::build_get_schema_request(None, id) - .wait() - .unwrap(); - let response = vdrtoolsrs::ledger::submit_request(self.handle, &request) - .wait() - .unwrap(); - let (schema_id, schema) = vdrtoolsrs::ledger::parse_get_schema_response(&response) - .wait() + pub async fn publish_nym( + &self, + wallet: &IndyWallet, + submitter_did: &str, + target_did: &str, + verkey: &str, + role: Option<&str>, + ) { + let mut request = self + .pool + .get_request_builder() + .build_nym_request( + &DidValue(submitter_did.to_string()), + &DidValue(target_did.to_string()), + Some(verkey.to_string()), + None, + role.map(|role| UpdateRole::from_str(role).unwrap()), + None, + None, + ) .unwrap(); - (schema_id, schema) + + self._sign_and_submit_request(wallet, &mut request).await; } - pub fn get_cred_def(&self, id: &str) -> (String, String) { - let request = vdrtoolsrs::ledger::build_get_cred_def_request(None, id) - .wait() + pub async fn publish_attrib( + &self, + wallet: &IndyWallet, + submitter_did: &str, + target_did: &str, + attrib: &serde_json::Value, + ) { + let mut request = self + .pool + .get_request_builder() + .build_attrib_request( + &DidValue(submitter_did.to_string()), + &DidValue(target_did.to_string()), + None, + Some(attrib), + None, + ) .unwrap(); - let response = vdrtoolsrs::ledger::submit_request(self.handle, &request) - .wait() + + self._sign_and_submit_request(wallet, &mut request).await; + } + + pub async fn publish_schema(&self, wallet: &IndyWallet, submitter_did: &str, schema: &Schema) { + let mut request = self + .pool + .get_request_builder() + .build_schema_request(&DidValue(submitter_did.to_string()), schema.clone()) .unwrap(); - let (schema_id, schema) = vdrtoolsrs::ledger::parse_get_cred_def_response(&response) - .wait() + + self._sign_and_submit_request(wallet, &mut request).await; + } + + pub async fn publish_cred_def( + &self, + wallet: &IndyWallet, + submitter_did: &str, + cred_def: &CredentialDefinition, + ) { + // hack to clone cred def + let cred_def_json = json!(cred_def).to_string(); + let cred_def = serde_json::from_str(&cred_def_json).unwrap(); + + let mut request = self + .pool + .get_request_builder() + .build_cred_def_request(&DidValue(submitter_did.to_string()), cred_def) .unwrap(); - (schema_id, schema) + + self._sign_and_submit_request(wallet, &mut request).await; + } + + pub async fn get_schema(&self, id: &str) -> Schema { + let request = self + .pool + .get_request_builder() + .build_get_schema_request( + None, + &indy_vdr::ledger::identifiers::SchemaId(id.to_string()), + ) + .expect("Unable to build get schema request"); + + let response = self._submit_request(&request).await; + serde_json::from_value(json!({ + "name": response["result"]["data"]["name"].as_str().unwrap().to_string(), + "version": response["result"]["data"]["version"].as_str().unwrap().to_string(), + "attrNames": serde_json::from_value::(response["result"]["data"]["attr_names"].clone()).unwrap(), + "id": SchemaId(id.to_string()), + "seqNo": Some(response["result"]["seqNo"].as_u64().unwrap() as u32), + "ver": "1.0" + })).unwrap() + } + + pub async fn get_cred_def(&self, id: &str) -> CredentialDefinition { + let request = self + .pool + .get_request_builder() + .build_get_cred_def_request( + None, + &indy_vdr::ledger::identifiers::CredentialDefinitionId(id.to_string()), + ) + .expect("Unable to build get cred def request"); + + let response = self._submit_request(&request).await; + let seq_no = response["result"]["ref"].as_u64().unwrap().to_string(); + serde_json::from_value(json!({ + "id": CredentialDefinitionId(id.to_string()), + "schemaId": seq_no, + "type": response["result"]["signature_type"], + "tag": response["result"]["tag"], + "value": response["result"]["data"], + "ver": "1.0" + })) + .unwrap() + } + + async fn _sign_and_submit_request( + &self, + wallet: &IndyWallet, + request: &mut PreparedRequest, + ) -> serde_json::Value { + let sig_bytes = request.get_signature_input().unwrap(); + let signature = wallet.sign(sig_bytes.as_bytes()).await; + request.set_signature(&signature).unwrap(); + self._submit_request(request).await + } + + async fn _submit_request(&self, request: &PreparedRequest) -> serde_json::Value { + let (request_result, _) = perform_ledger_request(&self.pool, request).await.unwrap(); + std::thread::sleep(Duration::from_millis(500)); + match request_result { + RequestResult::Reply(message) => serde_json::from_str(&message).unwrap(), + RequestResult::Failed(error) => { + panic!("Unable to send request. Err: {:?}", error); + } + } } } @@ -67,70 +191,182 @@ pub struct BesuLedger { pub client: LedgerClient, } -impl BesuLedger { - pub const CHAIN_ID: u64 = 1337; - pub const NODE_ADDRESS: &'static str = "http://127.0.0.1:8545"; - pub const CONTRACTS_SPEC_BASE_PATH: &'static str = "../../smart_contracts/artifacts/contracts/"; - pub const DID_REGISTRY_ADDRESS: &'static str = "0x0000000000000000000000000000000000003333"; - pub const DID_REGISTRY_SPEC_PATH: &'static str = "did/DidRegistry.sol/DidRegistry.json"; - pub const SCHEMA_REGISTRY_ADDRESS: &'static str = "0x0000000000000000000000000000000000005555"; - pub const SCHEMA_REGISTRY_SPEC_PATH: &'static str = "cl/SchemaRegistry.sol/SchemaRegistry.json"; - pub const CRED_DEF_REGISTRY_ADDRESS: &'static str = - "0x0000000000000000000000000000000000004444"; - pub const CRED_DEF_REGISTRY_SPEC_PATH: &'static str = - "cl/CredentialDefinitionRegistry.sol/CredentialDefinitionRegistry.json"; - - fn build_contract_path(contract_path: &str) -> String { - let mut cur_dir = env::current_dir().unwrap(); - cur_dir.push(Self::CONTRACTS_SPEC_BASE_PATH); - cur_dir.push(contract_path); - fs::canonicalize(&cur_dir) - .unwrap() - .to_str() - .unwrap() - .to_string() - } +#[derive(Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +struct BesuConfig { + chain_id: u64, + node_address: String, + contracts: BesuContracts, +} + +#[derive(Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +struct BesuContracts { + did_registry: BesuContractConfig, + schema_registry: BesuContractConfig, + credential_definition_registry: BesuContractConfig, + role_control: BesuContractConfig, +} - fn contracts() -> Vec { +#[derive(Serialize, Deserialize)] +struct BesuContractConfig { + address: String, + path: String, +} + +impl BesuLedger { + fn contracts(contracts: &BesuContracts) -> Vec { vec![ ContractConfig { - address: Self::DID_REGISTRY_ADDRESS.to_string(), - spec_path: Self::build_contract_path(Self::DID_REGISTRY_SPEC_PATH), + address: contracts.did_registry.address.to_string(), + spec_path: Some(contracts.did_registry.path.to_string()), + spec: None, }, ContractConfig { - address: Self::SCHEMA_REGISTRY_ADDRESS.to_string(), - spec_path: Self::build_contract_path(Self::SCHEMA_REGISTRY_SPEC_PATH), + address: contracts.schema_registry.address.to_string(), + spec_path: Some(contracts.schema_registry.path.to_string()), + spec: None, }, ContractConfig { - address: Self::CRED_DEF_REGISTRY_ADDRESS.to_string(), - spec_path: Self::build_contract_path(Self::CRED_DEF_REGISTRY_SPEC_PATH), + address: contracts.credential_definition_registry.address.to_string(), + spec_path: Some(contracts.credential_definition_registry.path.to_string()), + spec: None, + }, + ContractConfig { + address: contracts.role_control.address.to_string(), + spec_path: Some(contracts.role_control.path.to_string()), + spec: None, }, ] } - pub async fn new(wallet: BesuWallet) -> BesuLedger { + pub async fn new() -> BesuLedger { + let file = fs::File::open("besu-config.json").expect("Unable to open besu config file"); + let config: BesuConfig = + serde_json::from_reader(file).expect("Unable to parse besu config file"); + let client = LedgerClient::new( - Self::CHAIN_ID, - Self::NODE_ADDRESS, - &Self::contracts(), - Some(Box::new(wallet.signer)), + config.chain_id, + config.node_address.as_str(), + &Self::contracts(&config.contracts), + None, ) .unwrap(); let status = client.ping().await.unwrap(); - assert_eq!(Status::Ok, status.status, "Besu network is not reachable"); + match status.status { + Status::Ok { .. } => { + // ok + } + Status::Err { .. } => { + panic!("Besu network is not reachable") + } + }; BesuLedger { client } } - pub async fn get_schema(&self, id: &SchemaId) -> Schema { - SchemaRegistry::resolve_schema(&self.client, id) + pub async fn assign_role( + &self, + account: &Address, + role: &Role, + to: &Address, + wallet: &BesuWallet, + ) { + let transaction = build_assign_role_transaction(&self.client, account, role, to) .await - .unwrap() + .unwrap(); + self.sign_and_submit_transaction(&transaction, wallet, account) + .await; + } + + pub async fn publish_did_attribute( + &self, + account: &Address, + did: &str, + attribute: &DidDocAttribute, + wallet: &BesuWallet, + ) { + let did = indy_besu_vdr::DID::from(did); + let transaction = build_did_set_attribute_transaction( + &self.client, + account, + &did, + attribute, + &Validity::from(10000), + ) + .await + .unwrap(); + self.sign_and_submit_transaction(&transaction, wallet, account) + .await; + } + + pub async fn publish_schema( + &self, + account: &Address, + schema: &indy_besu_vdr::Schema, + wallet: &BesuWallet, + ) -> indy_besu_vdr::SchemaId { + let schema_id = + indy_besu_vdr::SchemaId::build(&schema.issuer_id, &schema.name, &schema.version); + let transaction = + build_create_schema_transaction(&self.client, account, &schema_id, schema) + .await + .unwrap(); + self.sign_and_submit_transaction(&transaction, wallet, account) + .await; + schema_id + } + + pub async fn publish_cred_def( + &self, + account: &Address, + cred_def: &indy_besu_vdr::CredentialDefinition, + wallet: &BesuWallet, + ) -> indy_besu_vdr::CredentialDefinitionId { + let cred_def_id = indy_besu_vdr::CredentialDefinitionId::build( + &cred_def.issuer_id, + cred_def.schema_id.as_ref(), + &cred_def.tag, + ); + let transaction = build_create_credential_definition_transaction( + &self.client, + account, + &cred_def_id, + cred_def, + ) + .await + .unwrap(); + self.sign_and_submit_transaction(&transaction, wallet, account) + .await; + cred_def_id } - pub async fn get_cred_def(&self, id: &CredentialDefinitionId) -> CredentialDefinition { - CredentialDefinitionRegistry::resolve_credential_definition(&self.client, id) + async fn sign_and_submit_transaction( + &self, + transaction: &Transaction, + wallet: &BesuWallet, + account: &Address, + ) { + let signature = wallet + .signer + .sign(&transaction.get_signing_bytes().unwrap(), account.as_ref()) + .unwrap(); + transaction.set_signature(signature); + let hash = self.client.submit_transaction(transaction).await.unwrap(); + let _receipt = self.client.get_receipt(&hash).await.unwrap(); + } + + pub async fn get_schema(&self, id: &str) -> Schema { + let id = indy_besu_vdr::SchemaId::from_indy_format(id).unwrap(); + let schema = resolve_schema(&self.client, &id).await.unwrap(); + (&schema).into() + } + + pub async fn get_cred_def(&self, id: &str) -> CredentialDefinition { + let id = indy_besu_vdr::CredentialDefinitionId::from_indy_format(id).unwrap(); + let cred_def = resolve_credential_definition(&self.client, &id) .await - .unwrap() + .unwrap(); + (&cred_def).into() } } diff --git a/examples/migration/src/main.rs b/examples/migration/src/main.rs index 197de36e..5d790e38 100644 --- a/examples/migration/src/main.rs +++ b/examples/migration/src/main.rs @@ -5,7 +5,10 @@ mod trustee; mod verifier; mod wallet; -use indy2_vdr::{CredentialDefinition, Schema}; +use indy_besu_vdr::{ + CredentialDefinition, DidDocAttribute, PublicKeyAttribute, PublicKeyPurpose, PublicKeyType, + Role, Schema, ServiceAttribute, ServiceEndpoint, +}; use crate::{holder::Holder, issuer::Issuer, trustee::Trustee, verifier::Verifier}; @@ -16,7 +19,7 @@ async fn main() { */ println!("1. Setup actors"); println!(" 1.1 Setup Trustee"); - let mut trustee = Trustee::setup("000000000000000000000000Trustee1"); + let mut trustee = Trustee::setup().await; println!(" 1.2 Setup Holder"); let mut holder = Holder::setup().await; println!(" 1.3 Setup Verifier"); @@ -38,40 +41,53 @@ async fn main() { // Publish Schema println!("2. Prepare Issuer/Credential data"); println!(" 2.1 Trustee publish DID"); - trustee.publish_did(&issuer.did, &issuer.edkey); + trustee + .publish_indy_did(&issuer.indy_did, &issuer.edkey) + .await; println!(" 2.2 Issuer publish Endpoint"); - issuer.publish_service_endpoint(&issuer.service); + issuer + .publish_service_endpoint_to_indy(&issuer.service) + .await; println!(" 2.3 Issuer publish Schema"); - let (schema_id, schema) = issuer.create_schema(); + let (schema_id, schema) = issuer.create_schema().await; + issuer.publish_schema_to_indy(&schema).await; println!(" 2.4 Issuer publish Cred Def"); - let (cred_def_id, cred_def) = issuer.create_cred_def(&schema_id); - println!(" DID: {}", issuer.did); - println!(" Schema: {}", schema); - println!(" Credential Definition: {}", cred_def); + let (_, cred_def) = issuer.create_cred_def(&schema_id).await; + issuer.publish_cred_def_to_indy(&cred_def).await; + println!(" DID: {}", issuer.indy_did); + println!(" Schema: {:?}", schema); + println!(" Credential Definition: {:?}", cred_def); /* * Step 3: Before Ledger migration (use Indy) issue credential to Holder and verify Proof using Indy Ledger */ println!("3. Issue Credential and Verity Proof"); println!(" 3.1 Issuer create Credential Offer"); - let cred_offer = issuer.create_credential_offer(&cred_def_id); + let cred_offer = issuer.create_credential_offer(&schema_id, &cred_def); println!(" 3.2 Holder create Credential Request"); - let (cred_request, cred_request_meta) = - holder.create_credential_request(&cred_offer, &cred_def); + let cred_request = holder.create_credential_request(&cred_offer).await; println!(" 3.3 Issuer sign Credential"); - let credential = issuer.sign_credential(&cred_offer, &cred_request); + let mut credential = issuer.sign_credential(&cred_def, &cred_offer, &cred_request); println!(" 3.4 Holder store Credential"); - let cred_id = holder.store_credential(&cred_request_meta, &credential, &cred_def); + holder.store_credential(&mut credential).await; // Make sure verification works println!(" 3.5 Verifier create Proof Request"); let proof_request = Verifier::request(); println!(" 3.6 Holder create Proof"); - let proof = holder.make_proof(&proof_request, &cred_id).await; + let proof = holder.make_proof(&proof_request, &credential).await; println!(" 3.7 Verifier verifies Proof"); let valid = verifier.verify_proof(&proof_request, &proof).await; println!(" Verification Result: {}", valid); + /* + * Trustee assign role to Issuer in Besu Ledger + */ + trustee.use_besu_ledger(); + trustee + .assign_besu_role(&Role::Trustee, &issuer.account) + .await; + /* * Step 4: Issuer does data migration to Besu Ledger */ @@ -79,7 +95,9 @@ async fn main() { println!( " 4.1 Issuer publish Besu Ledger key to Indy Ledger to prove DID ownership for Besu key" ); - issuer.publish_besu_ledger_account(&issuer.secpkey); + issuer + .publish_besu_ledger_account_to_indy(&issuer.secpkey) + .await; /* * Set actor to use Besu Ledger @@ -89,25 +107,32 @@ async fn main() { holder.use_besu_ledger(); verifier.use_besu_ledger(); - println!(" 4.2 Issuer publish DID Document"); - let did_doc = - Issuer::build_did_doc(&issuer.did, &issuer.edkey, &issuer.secpkey, &issuer.service); - let receipt = issuer.publish_did(&did_doc).await; - println!(" Did Document: {:?}", did_doc); - println!(" Receipt: {}", receipt); + println!(" 4.2 Issuer publish DID Service and Public Key"); + let service = DidDocAttribute::Service(ServiceAttribute { + type_: "IndyService".to_string(), + service_endpoint: ServiceEndpoint::String(issuer.service.to_string()), + }); + issuer.publish_did_attribute_to_besu(&service).await; + + let key = DidDocAttribute::PublicKey(PublicKeyAttribute { + purpose: PublicKeyPurpose::VeriKey, + type_: PublicKeyType::Ed25519VerificationKey2020, + public_key_hex: None, + public_key_base64: None, + public_key_base58: Some(issuer.edkey.to_string()), + public_key_pem: None, + }); + issuer.publish_did_attribute_to_besu(&key).await; println!(" 4.3 Issuer publish Schema"); - let schema = Schema::from_indy_format(&schema).unwrap(); - let receipt = issuer.publish_schema(&schema).await; - println!(" Schema: {:?}", schema); - println!(" Receipt: {}", receipt); + let schema = Schema::from_indy_format(&schema, &issuer.besu_did).unwrap(); + let schema_id = issuer.publish_schema_to_besu(&schema).await; println!(" 4.4 Issuer publish Credential Definition"); - let mut cred_def = CredentialDefinition::from_indy_format(&cred_def).unwrap(); - cred_def.schema_id = schema.id; - let receipt = issuer.publish_cred_def(&cred_def).await; - println!(" Credential Definition: {:?}", cred_def); - println!(" Receipt: {}", receipt); + let cred_def = + CredentialDefinition::from_indy_format(&cred_def, &issuer.besu_did, schema_id.as_ref()) + .unwrap(); + issuer.publish_cred_def_to_besu(&cred_def).await; /* * Step 5: Verify existing credential using Besu Ledger @@ -116,7 +141,7 @@ async fn main() { println!(" 5.1 Verifier create Proof Request"); let proof_request = Verifier::request(); println!(" 5.2 Holder create Proof"); - let proof = holder.make_proof(&proof_request, &cred_id).await; + let proof = holder.make_proof(&proof_request, &credential).await; println!(" 5.3 Verifier verifies Proof"); let valid = verifier.verify_proof(&proof_request, &proof).await; println!(" Verification Result: {}", valid); diff --git a/examples/migration/src/trustee.rs b/examples/migration/src/trustee.rs index 8ead160a..2f0bf78a 100644 --- a/examples/migration/src/trustee.rs +++ b/examples/migration/src/trustee.rs @@ -1,57 +1,75 @@ use crate::{ - ledger::{IndyLedger, Ledgers}, - wallet::IndyWallet, + ledger::{BesuLedger, IndyLedger, Ledgers}, + wallet::{BesuWallet, IndyWallet}, }; -use serde_json::json; +use indy_besu_vdr::{Address, Role, DID}; use std::time::Duration; -use vdrtoolsrs::future::Future; pub struct Trustee { - indy_wallet: IndyWallet, - indy_ledger: IndyLedger, - did: String, - used_ledger: Ledgers, + pub indy_wallet: IndyWallet, + pub indy_ledger: IndyLedger, + pub besu_wallet: BesuWallet, + pub besu_ledger: BesuLedger, + + pub indy_did: String, + pub besu_did: String, + pub edkey: String, + pub account: Address, + pub secpkey: String, + pub used_ledger: Ledgers, } impl Trustee { - const NAME: &'static str = "trustee"; - - pub fn setup(seed: &str) -> Trustee { - let indy_wallet = IndyWallet::new(Self::NAME); - let indy_ledger = IndyLedger::new(Self::NAME); - let config = json!({ "seed": seed }).to_string(); - let (did, _) = vdrtoolsrs::did::create_and_store_my_did(indy_wallet.handle, &config) - .wait() - .unwrap(); + const ED25519_SEED: &'static str = "000000000000000000000000Trustee1"; + + const SECP_PRIVATE_KEY: &'static str = + "8bbbb1b345af56b560a5b20bd4b0ed1cd8cc9958a16262bc75118453cb546df7"; + + pub async fn setup() -> Trustee { + let indy_wallet = IndyWallet::new(Some(Self::ED25519_SEED)).await; + let indy_ledger = IndyLedger::new(); + let besu_wallet = BesuWallet::new(Some(Self::SECP_PRIVATE_KEY)); + let besu_ledger = BesuLedger::new().await; + + let indy_did = indy_wallet.did.clone(); + let edkey = indy_wallet.edkey.clone(); + let account = besu_wallet.account.clone(); + let secpkey = besu_wallet.secpkey.clone(); + let besu_did = DID::build("ethr", None, account.as_ref()); + Trustee { indy_wallet, indy_ledger, - did, + besu_wallet, + besu_ledger, + indy_did, + besu_did: besu_did.to_string(), + edkey, + account, + secpkey, used_ledger: Ledgers::Indy, } } - pub fn publish_did(&self, did: &str, verkey: &str) { - let request = vdrtoolsrs::ledger::build_nym_request( - &self.did, - &did, - Some(&verkey), - None, - Some("ENDORSER"), - ) - .wait() - .unwrap(); - let _response = vdrtoolsrs::ledger::sign_and_submit_request( - self.indy_ledger.handle, - self.indy_wallet.handle, - &self.did, - &request, - ) - .wait() - .unwrap(); + pub async fn publish_indy_did(&self, did: &str, verkey: &str) { + self.indy_ledger + .publish_nym( + &self.indy_wallet, + &self.indy_did, + did, + verkey, + Some("ENDORSER"), + ) + .await; std::thread::sleep(Duration::from_millis(500)); } + pub async fn assign_besu_role(&self, role: &Role, to: &Address) { + self.besu_ledger + .assign_role(&self.account, role, to, &self.besu_wallet) + .await + } + pub fn use_indy_ledger(&mut self) { self.used_ledger = Ledgers::Indy } diff --git a/examples/migration/src/verifier.rs b/examples/migration/src/verifier.rs index bf0499aa..6536d9ed 100644 --- a/examples/migration/src/verifier.rs +++ b/examples/migration/src/verifier.rs @@ -1,27 +1,21 @@ -use crate::{ - ledger::{BesuLedger, IndyLedger, Ledgers}, - wallet::BesuWallet, -}; -use indy2_vdr::{ - migration::{IndyCredentialDefinitionFormat, IndySchemaFormat}, - CredentialDefinitionId, SchemaId, +use crate::ledger::{BesuLedger, IndyLedger, Ledgers}; +use indy_credx::types::{ + CredentialDefinition, CredentialDefinitionId, Presentation, PresentationRequest, Schema, + SchemaId, }; use serde_json::json; -use vdrtoolsrs::future::Future; +use std::collections::HashMap; pub struct Verifier { - indy_ledger: IndyLedger, - besu_ledger: BesuLedger, - used_ledger: Ledgers, + pub indy_ledger: IndyLedger, + pub besu_ledger: BesuLedger, + pub used_ledger: Ledgers, } impl Verifier { - const NAME: &'static str = "verifier"; - pub async fn setup() -> Verifier { - let indy_ledger = IndyLedger::new(Self::NAME); - let besu_wallet = BesuWallet::new(None); - let besu_ledger = BesuLedger::new(besu_wallet).await; + let indy_ledger = IndyLedger::new(); + let besu_ledger = BesuLedger::new().await; Verifier { indy_ledger, besu_ledger, @@ -29,60 +23,61 @@ impl Verifier { } } - pub fn request() -> String { - json!({ + async fn get_schema(&self, schema_id: &str) -> Schema { + match self.used_ledger { + Ledgers::Indy => self.indy_ledger.get_schema(schema_id).await, + Ledgers::Besu => self.besu_ledger.get_schema(schema_id).await, + } + } + + async fn get_cred_def(&self, cred_def_id: &str) -> CredentialDefinition { + match self.used_ledger { + Ledgers::Indy => self.indy_ledger.get_cred_def(cred_def_id).await, + Ledgers::Besu => self.besu_ledger.get_cred_def(cred_def_id).await, + } + } + + pub fn request() -> PresentationRequest { + serde_json::from_value(json!({ "nonce":"123432421212", "name":"proof_req_1", "version":"0.1", "requested_attributes": { "attr1_referent": { - "name": "first_name" + "name": "name" } }, "requested_predicates": {} - }) - .to_string() + })) + .unwrap() } - pub async fn verify_proof(&self, proof_request: &str, proof: &str) -> bool { - let parsed_proof = serde_json::from_str::(proof).unwrap(); - let identifier = parsed_proof["identifiers"][0].as_object().unwrap(); - let schema_id = identifier["schema_id"].as_str().unwrap(); - let cred_def_id = identifier["cred_def_id"].as_str().unwrap(); + pub async fn verify_proof( + &self, + proof_request: &PresentationRequest, + proof: &Presentation, + ) -> bool { + let identifier = proof.identifiers[0].clone(); + let schema_id = identifier.schema_id; + let cred_def_id = identifier.cred_def_id; + + let schema = self.get_schema(&schema_id).await; + let cred_def = self.get_cred_def(&cred_def_id).await; - let (schema, cred_def) = match self.used_ledger { - Ledgers::Indy => { - let (_, schema) = self.indy_ledger.get_schema(&schema_id); - let (_, cred_def) = self.indy_ledger.get_cred_def(&cred_def_id); - (schema, cred_def) - } - Ledgers::Besu => { - let schema_id = SchemaId::from_indy_format(schema_id).unwrap(); - let cred_def_id = CredentialDefinitionId::from_indy_format(cred_def_id).unwrap(); - let schema = self.besu_ledger.get_schema(&schema_id).await; - let cred_def = self.besu_ledger.get_cred_def(&cred_def_id).await; - let schema: IndySchemaFormat = schema.into(); - let cred_def: IndyCredentialDefinitionFormat = cred_def.into(); - (json!(schema).to_string(), json!(cred_def).to_string()) - } - }; + let mut schemas: HashMap = HashMap::new(); + schemas.insert(schema_id, &schema); - let schemas_json = - json!({schema_id: serde_json::from_str::(&schema).unwrap()}) - .to_string(); - let cred_defs_json = - json!({cred_def_id: serde_json::from_str::(&cred_def).unwrap()}) - .to_string(); + let mut cred_defs: HashMap = HashMap::new(); + cred_defs.insert(cred_def_id, &cred_def); - vdrtoolsrs::anoncreds::verifier_verify_proof( - &proof_request, + indy_credx::verifier::verify_presentation( proof, - &schemas_json, - &cred_defs_json, - "{}", - "{}", + proof_request, + &schemas, + &cred_defs, + None, + None, ) - .wait() .unwrap() } diff --git a/examples/migration/src/wallet.rs b/examples/migration/src/wallet.rs index ea4f4e6f..0ccaacef 100644 --- a/examples/migration/src/wallet.rs +++ b/examples/migration/src/wallet.rs @@ -1,29 +1,28 @@ -use indy2_vdr::{Address, BasicSigner}; -use serde_json::json; -use vdrtoolsrs::{future::Future, WalletHandle}; +use aries_askar::kms::{KeyAlg, LocalKey}; +use indy_besu_vdr::{Address, BasicSigner}; pub struct IndyWallet { - pub handle: WalletHandle, + pub did: String, + pub edkey: String, + key: LocalKey, } impl IndyWallet { - pub const KEY: &'static str = "8dvfYSt5d1taSd6yJdpjq4emkwsPDDLYxkNFysFD2cZY"; - pub const KEY_DERIVATION: &'static str = "RAW"; + pub async fn new(seed: Option<&str>) -> IndyWallet { + let key = match seed { + Some(seed) => LocalKey::from_secret_bytes(KeyAlg::Ed25519, seed.as_bytes()).unwrap(), + None => LocalKey::generate(KeyAlg::Ed25519, false).unwrap(), + }; - pub fn new(name: &str) -> IndyWallet { - let config = json!({ "id": format!("{}_wallet", name) }).to_string(); - let credentials = json!({ - "key": Self::KEY, - "key_derivation_method": Self::KEY_DERIVATION - }) - .to_string(); - vdrtoolsrs::wallet::create_wallet(&config, &credentials) - .wait() - .ok(); - let handle = vdrtoolsrs::wallet::open_wallet(&config, &credentials) - .wait() - .unwrap(); - IndyWallet { handle } + let verkey_bytes = key.to_public_bytes().unwrap(); + let did = bs58::encode(&verkey_bytes[0..16]).into_string(); + let edkey = bs58::encode(verkey_bytes.as_ref()).into_string(); + + IndyWallet { did, edkey, key } + } + + pub async fn sign(&self, bytes: &[u8]) -> Vec { + self.key.sign_message(bytes, None).unwrap() } } diff --git a/network/config/nodes/validator5/key b/network/config/nodes/validator5/key index bbab15bd..cc082ea6 100644 --- a/network/config/nodes/validator5/key +++ b/network/config/nodes/validator5/key @@ -1 +1 @@ -0xcab177e8e28012e7e8ae143174eb3efdacbe84aedb30e8fc88e8530ca47fb88b \ No newline at end of file +0xac6701921de0697f32539d9e95ffa85bbb846203ea2fce4cc19516c79ce578aa \ No newline at end of file diff --git a/vdr/Cargo.lock b/vdr/Cargo.lock index 54a6490a..825467bf 100644 --- a/vdr/Cargo.lock +++ b/vdr/Cargo.lock @@ -26,6 +26,12 @@ dependencies = [ "memchr", ] +[[package]] +name = "amcl" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee5cca1ddc8b9dceb55b7f1272a9d1e643d73006f350a20ab4926d24e33f0f0d" + [[package]] name = "android-tzdata" version = "0.1.1" @@ -41,6 +47,25 @@ dependencies = [ "libc", ] +[[package]] +name = "anoncreds-clsignatures" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e43b1e6346133a92d4af655cdc07d389a2cfece7971db48129e54fce38b79e1d" +dependencies = [ + "amcl", + "glass_pumpkin", + "log", + "num-bigint", + "num-integer", + "num-traits", + "once_cell", + "openssl", + "rand", + "serde", + "sha2", +] + [[package]] name = "anstyle" version = "1.0.4" @@ -413,6 +438,15 @@ version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +[[package]] +name = "core2" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b49ba7ef1ad6107f8824dbe97de947cbaac53c44e7f9756a1fba0d37c1eec505" +dependencies = [ + "memchr", +] + [[package]] name = "cpufeatures" version = "0.2.9" @@ -459,6 +493,34 @@ dependencies = [ "typenum", ] +[[package]] +name = "curve25519-dalek" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto", + "platforms", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.37", +] + [[package]] name = "darling" version = "0.10.2" @@ -558,6 +620,28 @@ dependencies = [ "spki", ] +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f628eaec48bfd21b865dc2950cfa014450c01d2fa2b69a86c2fd5844ec523c0" +dependencies = [ + "curve25519-dalek", + "ed25519", + "sha2", + "subtle", + "zeroize", +] + [[package]] name = "either" version = "1.9.0" @@ -745,6 +829,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "fiat-crypto" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27573eac26f4dd11e2b1916c3fe1baa56407c83c71a773a8ba17ec0bca03b6b7" + [[package]] name = "fixed-hash" version = "0.8.0" @@ -943,6 +1033,20 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +[[package]] +name = "glass_pumpkin" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e847fe780e2fd8aa993bef2124361c285349ff0e9315e8285f8126386b54a9" +dependencies = [ + "core2", + "num-bigint", + "num-integer", + "num-traits", + "once_cell", + "rand_core", +] + [[package]] name = "gloo-timers" version = "0.2.6" @@ -1247,6 +1351,7 @@ dependencies = [ "ethers-core", "futures", "hex", + "indy-data-types", "log", "log-derive", "mockall", @@ -1262,6 +1367,28 @@ dependencies = [ "web3", ] +[[package]] +name = "indy-data-types" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3c213857cd6ff5ad634276bcbdcc5e911b32dcbd7127357776468016fef852c" +dependencies = [ + "anoncreds-clsignatures", + "bs58", + "curve25519-dalek", + "ed25519-dalek", + "hex", + "once_cell", + "rand", + "regex", + "serde", + "serde_json", + "sha2", + "thiserror", + "x25519-dalek", + "zeroize", +] + [[package]] name = "instant" version = "0.1.12" @@ -1507,6 +1634,28 @@ dependencies = [ "tempfile", ] +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", + "rand", +] + +[[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.17" @@ -1758,6 +1907,12 @@ version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" +[[package]] +name = "platforms" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" + [[package]] name = "polling" version = "2.8.0" @@ -3128,8 +3283,33 @@ dependencies = [ "tap", ] +[[package]] +name = "x25519-dalek" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96" +dependencies = [ + "curve25519-dalek", + "rand_core", + "zeroize", +] + [[package]] name = "zeroize" version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.37", +] diff --git a/vdr/Cargo.toml b/vdr/Cargo.toml index 5414aca7..edadacd1 100644 --- a/vdr/Cargo.toml +++ b/vdr/Cargo.toml @@ -34,6 +34,7 @@ ethers-core = "2.0.12" hex = "0.4.3" futures = "0.3.28" once_cell = "1.18.0" +indy-data-types = "0.7.1" rand = { version = "0.8.5", optional = true } secp256k1 = { version = "0.28.0", optional = true, features = ["recovery", "rand"] } sha3 = "0.10.8" diff --git a/vdr/src/contracts/cl/schema_registry.rs b/vdr/src/contracts/cl/schema_registry.rs index 4c2502c1..cd4abedb 100644 --- a/vdr/src/contracts/cl/schema_registry.rs +++ b/vdr/src/contracts/cl/schema_registry.rs @@ -289,9 +289,9 @@ pub mod test { 101, 57, 98, 50, 98, 53, 34, 44, 34, 110, 97, 109, 101, 34, 58, 34, 70, 49, 68, 67, 108, 97, 70, 69, 122, 105, 51, 116, 34, 44, 34, 118, 101, 114, 115, 105, 111, 110, 34, 58, 34, 49, 46, 48, 46, 48, 34, 44, 34, 97, 116, 116, 114, 78, - 97, 109, 101, 115, 34, 58, 91, 34, 70, 105, 114, 115, 116, 32, 78, 97, 109, - 101, 34, 44, 34, 76, 97, 115, 116, 32, 78, 97, 109, 101, 34, 93, 125, 0, 0, 0, - 0, 0, 0, 0, + 97, 109, 101, 115, 34, 58, 91, 34, 76, 97, 115, 116, 32, 78, 97, 109, 101, 34, + 44, 34, 70, 105, 114, 115, 116, 32, 78, 97, 109, 101, 34, 93, 125, 0, 0, 0, 0, + 0, 0, 0, ], signature: RwLock::new(None), hash: None, diff --git a/vdr/src/contracts/cl/types/credential_definition.rs b/vdr/src/contracts/cl/types/credential_definition.rs index d7288ceb..f64fcd95 100644 --- a/vdr/src/contracts/cl/types/credential_definition.rs +++ b/vdr/src/contracts/cl/types/credential_definition.rs @@ -6,6 +6,8 @@ use crate::{ }; use serde_derive::{Deserialize, Serialize}; +pub use indy_data_types::anoncreds::cred_def::SignatureType; + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] pub struct CredentialDefinition { #[serde(rename = "issuerId")] @@ -13,25 +15,11 @@ pub struct CredentialDefinition { #[serde(rename = "schemaId")] pub schema_id: SchemaId, #[serde(rename = "credDefType")] - pub cred_def_type: CredentialDefinitionTypes, + pub cred_def_type: SignatureType, pub tag: String, pub value: serde_json::Value, } -#[derive(Debug, Default, Clone, PartialEq, Deserialize, Serialize)] -pub enum CredentialDefinitionTypes { - #[default] - CL, -} - -impl AsRef for CredentialDefinitionTypes { - fn as_ref(&self) -> &str { - match self { - CredentialDefinitionTypes::CL => "CL", - } - } -} - impl TryFrom<&CredentialDefinition> for ContractParam { type Error = VdrError; @@ -116,7 +104,7 @@ pub mod test { let cred_def = CredentialDefinition { issuer_id: issuer_id.clone(), schema_id: SchemaId::from(schema_id.as_ref()), - cred_def_type: CredentialDefinitionTypes::CL, + cred_def_type: SignatureType::CL, tag: tag.to_string(), value: credential_definition_value(), }; diff --git a/vdr/src/contracts/cl/types/schema.rs b/vdr/src/contracts/cl/types/schema.rs index 3ba933e7..b0595893 100644 --- a/vdr/src/contracts/cl/types/schema.rs +++ b/vdr/src/contracts/cl/types/schema.rs @@ -3,6 +3,7 @@ use crate::{ types::{ContractOutput, ContractParam}, Address, }; +use std::collections::HashSet; use crate::{contracts::did::types::did::DID, types::ContractEvent}; use serde_derive::{Deserialize, Serialize}; @@ -14,7 +15,7 @@ pub struct Schema { pub name: String, pub version: String, #[serde(rename = "attrNames")] - pub attr_names: Vec, + pub attr_names: HashSet, } impl TryFrom<&Schema> for ContractParam { @@ -91,14 +92,15 @@ pub mod test { pub fn schema(issuer_id: &DID, name: Option<&str>) -> (SchemaId, Schema) { let name = name.map(String::from).unwrap_or_else(rand_string); let id = schema_id(issuer_id, name.as_str()); + let mut attr_names: HashSet = HashSet::new(); + attr_names.insert(SCHEMA_ATTRIBUTE_FIRST_NAME.to_string()); + attr_names.insert(SCHEMA_ATTRIBUTE_LAST_NAME.to_string()); + let schema = Schema { issuer_id: issuer_id.clone(), name, version: SCHEMA_VERSION.to_string(), - attr_names: vec![ - SCHEMA_ATTRIBUTE_FIRST_NAME.to_string(), - SCHEMA_ATTRIBUTE_LAST_NAME.to_string(), - ], + attr_names, }; (id, schema) } diff --git a/vdr/src/lib.rs b/vdr/src/lib.rs index 707d2f3a..25ce9072 100644 --- a/vdr/src/lib.rs +++ b/vdr/src/lib.rs @@ -31,8 +31,14 @@ pub use contracts::{ did_ethr_registry, types::{ did::DID, - did_doc::{DidDocument, DidResolutionOptions, VerificationKeyType}, - did_doc_attribute::{DelegateType, DidDocAttribute, Validity}, + did_doc::{ + DidDocument, DidResolutionOptions, Service, ServiceEndpoint, ServiceEndpointObject, + VerificationKeyType, + }, + did_doc_attribute::{ + DelegateType, DidDocAttribute, PublicKeyAttribute, PublicKeyPurpose, PublicKeyType, + ServiceAttribute, Validity, + }, did_doc_builder::DidDocumentBuilder, did_events::{DidAttributeChanged, DidDelegateChanged, DidEvents, DidOwnerChanged}, }, diff --git a/vdr/src/migration/credential_definition.rs b/vdr/src/migration/credential_definition.rs index e1faa86b..3952167c 100644 --- a/vdr/src/migration/credential_definition.rs +++ b/vdr/src/migration/credential_definition.rs @@ -1,27 +1,21 @@ use crate::{ - contracts::{ - cl::types::credential_definition::CredentialDefinitionTypes, did::types::did::DID, - }, + contracts::did::types::did::DID, error::{VdrError, VdrResult}, migration::{DID_METHOD, NETWORK}, CredentialDefinition, CredentialDefinitionId, SchemaId, }; use log::warn; use log_derive::{logfn, logfn_inputs}; -use serde_derive::{Deserialize, Serialize}; +use serde_json::json; -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -pub struct IndyCredentialDefinitionFormat { - pub id: String, - #[serde(rename = "schemaId")] - pub schema_id: String, - #[serde(rename = "type")] - pub type_: CredentialDefinitionTypes, - pub tag: String, - pub value: serde_json::Value, - #[serde(default)] - pub ver: String, -} +use indy_data_types::{ + anoncreds::cred_def::{ + CredentialDefinition as IndyCredentialDefinition, + CredentialDefinitionV1 as IndyCredentialDefinitionV1, + }, + did::DidValue, + CredentialDefinitionId as IndyCredentialDefinitionId, SchemaId as IndySchemaId, +}; impl CredentialDefinitionId { #[logfn(Trace)] @@ -69,61 +63,61 @@ impl CredentialDefinitionId { impl CredentialDefinition { #[logfn(Trace)] #[logfn_inputs(Trace)] - pub fn from_indy_format(credential_definition: &str) -> VdrResult { - let indy_cred_def: IndyCredentialDefinitionFormat = - serde_json::from_str(&credential_definition) - .map_err(|_err| VdrError::CommonInvalidData("Invalid indy cred def".to_string()))?; - let besu_cred_def = CredentialDefinition::try_from(indy_cred_def); - besu_cred_def + pub fn from_indy_format_str( + cred_def: &str, + issuer_did: &str, + schema_id: &str, + ) -> VdrResult { + let cred_def: IndyCredentialDefinition = serde_json::from_str(cred_def).map_err(|err| { + VdrError::CommonInvalidData(format!( + "Unable to parse indy credential definition. Err: {:?}", + err + )) + })?; + CredentialDefinition::from_indy_format(&cred_def, issuer_did, schema_id) } -} - -impl TryFrom for CredentialDefinition { - type Error = VdrError; #[logfn(Trace)] #[logfn_inputs(Trace)] - fn try_from(cred_def: IndyCredentialDefinitionFormat) -> Result { - let parts: Vec<&str> = cred_def.id.split(':').collect(); - let id = parts.get(0).ok_or_else(|| { - let vdr_error = VdrError::CommonInvalidData("Invalid indy cred def id".to_string()); - - warn!("Error: {:?} during converting CredentialDefinition from IndyCredentialDefinitionFormat", vdr_error); - - vdr_error - })?; - let issuer_id = DID::build(DID_METHOD, Some(NETWORK), id); - // TODO: How to deal with schema_id - now it's just sequence number? - let schema_id = cred_def.schema_id.to_string(); - - let besu_cred_def = CredentialDefinition { - issuer_id, - schema_id: SchemaId::from(schema_id.as_str()), - cred_def_type: cred_def.type_.clone(), - tag: cred_def.tag.to_string(), - value: cred_def.value.clone(), - }; - Ok(besu_cred_def) + pub fn from_indy_format( + cred_def: &IndyCredentialDefinition, + issuer_did: &str, + schema_id: &str, + ) -> VdrResult { + match cred_def { + IndyCredentialDefinition::CredentialDefinitionV1(cred_def) => { + let besu_schema = CredentialDefinition { + issuer_id: DID::from(issuer_did), + schema_id: SchemaId::from(schema_id), + cred_def_type: cred_def.signature_type.clone(), + tag: cred_def.tag.to_string(), + value: json!(cred_def.value), + }; + + Ok(besu_schema) + } + } } } -impl Into for &CredentialDefinition { +impl Into for &CredentialDefinition { #[logfn(Trace)] #[logfn_inputs(Trace)] - fn into(self) -> IndyCredentialDefinitionFormat { - IndyCredentialDefinitionFormat { - id: format!( - "{}:3:{}:{}:{}", - self.issuer_id.as_ref(), - self.cred_def_type.as_ref(), - self.schema_id.as_ref(), - self.tag + fn into(self) -> IndyCredentialDefinition { + let value = serde_json::from_str(&self.value.to_string()) + .expect("Unable to parse credential definition data"); + + IndyCredentialDefinition::CredentialDefinitionV1(IndyCredentialDefinitionV1 { + id: IndyCredentialDefinitionId::new( + &DidValue(self.issuer_id.to_string()), + &IndySchemaId(self.schema_id.to_string()), + &self.cred_def_type.to_str(), + &self.tag, ), - schema_id: self.schema_id.to_string(), - type_: self.cred_def_type.clone(), + schema_id: IndySchemaId(self.schema_id.to_string()), + signature_type: self.cred_def_type.clone(), tag: self.tag.to_string(), - value: self.value.clone(), - ver: "1.0".to_string(), - } + value, + }) } } diff --git a/vdr/src/migration/schema.rs b/vdr/src/migration/schema.rs index d056ffcb..f85a3cc4 100644 --- a/vdr/src/migration/schema.rs +++ b/vdr/src/migration/schema.rs @@ -4,22 +4,13 @@ use crate::{ migration::{DID_METHOD, NETWORK}, Schema, SchemaId, }; +use indy_data_types::{ + anoncreds::schema::{AttributeNames, Schema as IndySchema, SchemaV1 as IndySchemaV1}, + did::DidValue, + SchemaId as IndySchemaId, +}; use log::warn; use log_derive::{logfn, logfn_inputs}; -use serde_derive::{Deserialize, Serialize}; - -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] -pub struct IndySchemaFormat { - pub id: String, - pub name: String, - pub version: String, - #[serde(rename = "attrNames")] - pub attr_names: Vec, - #[serde(rename = "seqNo")] - pub seq_no: Option, - #[serde(default)] - pub ver: String, -} impl SchemaId { #[logfn(Trace)] @@ -66,67 +57,45 @@ impl SchemaId { impl Schema { #[logfn(Trace)] #[logfn_inputs(Trace)] - pub fn from_indy_format(schema: &str) -> VdrResult { - let indy_schema: IndySchemaFormat = serde_json::from_str(&schema).map_err(|_err| { - let vdr_error = VdrError::CommonInvalidData("Invalid indy schema".to_string()); - - warn!( - "Error: {:?} during converting Schema from indy format", - vdr_error - ); - - vdr_error + pub fn from_indy_format_str(schema: &str, issuer_did: &str) -> VdrResult { + let schema: IndySchema = serde_json::from_str(schema).map_err(|err| { + VdrError::CommonInvalidData(format!("Unable to parse indy schema. Err: {:?}", err)) })?; - - Schema::try_from(indy_schema) + Schema::from_indy_format(&schema, issuer_did) } -} - -impl TryFrom for Schema { - type Error = VdrError; #[logfn(Trace)] #[logfn_inputs(Trace)] - fn try_from(schema: IndySchemaFormat) -> Result { - let parts: Vec<&str> = schema.id.split(':').collect(); - let id = parts.get(0).ok_or_else(|| { - let vdr_error = VdrError::CommonInvalidData("Invalid indy schema".to_string()); - - warn!( - "Error: {:?} during converting Schema from IndySchemaFormat", - vdr_error - ); - - vdr_error - })?; - let issuer_id = DID::build(DID_METHOD, Some(NETWORK), id); - - let besu_schema = Schema { - issuer_id, - name: schema.name.to_string(), - version: schema.version.to_string(), - attr_names: schema.attr_names.clone(), - }; - Ok(besu_schema) + pub fn from_indy_format(schema: &IndySchema, issuer_did: &str) -> VdrResult { + match schema { + IndySchema::SchemaV1(schema) => { + let besu_schema = Schema { + issuer_id: DID::from(issuer_did), + name: schema.name.to_string(), + version: schema.version.to_string(), + attr_names: schema.attr_names.clone().0, + }; + + Ok(besu_schema) + } + } } } -impl Into for &Schema { +impl Into for &Schema { #[logfn(Trace)] #[logfn_inputs(Trace)] - fn into(self) -> IndySchemaFormat { - IndySchemaFormat { - id: format!( - "{}:2:{}:{}", - self.issuer_id.as_ref(), - self.name, - self.version + fn into(self) -> IndySchema { + IndySchema::SchemaV1(IndySchemaV1 { + id: IndySchemaId::new( + &DidValue(self.issuer_id.to_string()), + &self.name, + &self.version, ), name: self.name.to_string(), version: self.version.to_string(), - attr_names: self.attr_names.clone(), + attr_names: AttributeNames(self.attr_names.clone()), seq_no: None, - ver: "1.0".to_string(), - } + }) } }