diff --git a/.github/workflows/rust-fmt-lint.yaml b/.github/workflows/rust-fmt-lint.yaml index 455bcae6..fecb2138 100644 --- a/.github/workflows/rust-fmt-lint.yaml +++ b/.github/workflows/rust-fmt-lint.yaml @@ -16,8 +16,8 @@ env: RUST_CLIPPY: 1.67 jobs: - "lint_fmt": - name: lint:fmt + lint_fmt: + name: Running formatting # Don't run on draft pull requests if: ${{ !github.event.pull_request.draft }} runs-on: ubuntu-latest @@ -27,6 +27,7 @@ jobs: - gallery/verifier/Cargo.toml - sponsoredTransactions/backend/Cargo.toml - sponsoredTransactionsAuction/backend/Cargo.toml + - trackAndTrace/smart-contract/Cargo.toml steps: - name: Checkout @@ -44,9 +45,9 @@ jobs: command: fmt args: --manifest-path=${{ matrix.crates }} -- --check - "lint_clippy": - name: lint:clippy - needs: "lint_fmt" + lint_clippy: + name: Running clippy + needs: lint_fmt # Don't run on draft pull requests if: ${{ !github.event.pull_request.draft }} runs-on: ubuntu-latest @@ -56,6 +57,7 @@ jobs: - gallery/verifier/Cargo.toml - sponsoredTransactions/backend/Cargo.toml - sponsoredTransactionsAuction/backend/Cargo.toml + - trackAndTrace/smart-contract/Cargo.toml steps: - name: Checkout @@ -75,3 +77,37 @@ jobs: with: command: clippy args: --manifest-path ${{ matrix.crates }} -- -D warnings + + test: + name: Running tests + runs-on: ubuntu-latest + needs: [lint_fmt, lint_clippy] + strategy: + matrix: + target: + - x86_64-unknown-linux-gnu + + lib-crates: + - trackAndTrace/smart-contract/Cargo.toml + + steps: + - name: Checkout sources + uses: actions/checkout@v2 + with: + submodules: recursive + + - name: Install toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ env.RUST_VERSION }} + target: ${{ matrix.target }} + override: true + + - name: Run cargo test + uses: actions-rs/cargo@v1 + with: + command: test + # Run all tests, including doc tests. + args: --manifest-path ${{ matrix.lib-crates }} --target=${{ matrix.target }} + diff --git a/.gitignore b/.gitignore index ba85f606..010e9558 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,7 @@ yarn-debug.log* yarn-error.log* target +/**/concordium-out dist gallery/public .eslintcache diff --git a/trackAndTrace/README.md b/trackAndTrace/README.md new file mode 100644 index 00000000..c2a56e9d --- /dev/null +++ b/trackAndTrace/README.md @@ -0,0 +1 @@ +## Track and Trace Project \ No newline at end of file diff --git a/trackAndTrace/rustfmt.toml b/trackAndTrace/rustfmt.toml new file mode 100644 index 00000000..812265ff --- /dev/null +++ b/trackAndTrace/rustfmt.toml @@ -0,0 +1,21 @@ +edition = "2021" +combine_control_expr = false +wrap_comments = true +brace_style = "PreferSameLine" +enum_discrim_align_threshold = 20 +fn_single_line = true +format_strings = true +format_macro_matchers = true +format_macro_bodies = true +imports_granularity = "Crate" +normalize_comments = true +reorder_impl_items = true +reorder_imports = true +struct_field_align_threshold = 20 +trailing_semicolon = true +type_punctuation_density = "Wide" +use_field_init_shorthand = true +use_try_shorthand = true +format_code_in_doc_comments = true +overflow_delimited_expr = true +normalize_doc_attributes = true diff --git a/trackAndTrace/smart-contract/Cargo.lock b/trackAndTrace/smart-contract/Cargo.lock new file mode 100644 index 00000000..504bc28d --- /dev/null +++ b/trackAndTrace/smart-contract/Cargo.lock @@ -0,0 +1,2750 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "addr2line" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +dependencies = [ + "gimli", +] + +[[package]] +name = "adler" +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 1.0.0", + "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.7.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a824f2aa7e75a0c98c5a504fceb80649e9c35265d44525b5f94de4771a395cd" +dependencies = [ + "getrandom", + "once_cell", + "version_check", +] + +[[package]] +name = "ahash" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +dependencies = [ + "cfg-if 1.0.0", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + +[[package]] +name = "android-tzdata" +version = "0.1.1" +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 = "anyhow" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" + +[[package]] +name = "ark-bls12-381" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools 0.10.5", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest", + "itertools 0.10.5", + "num-bigint", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + +[[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-trait" +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 = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "axum" +version = "0.6.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b829e4e32b91e643de6eafe82b1d90675f5874230191a4ffbc1b336dec4d6bf" +dependencies = [ + "async-trait", + "axum-core", + "bitflags", + "bytes", + "futures-util", + "http", + "http-body", + "hyper", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "rustversion", + "serde", + "sync_wrapper", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "759fa577a247914fd3f7f76d62972792636412fbfd634cd452f6a385a74d2d2c" +dependencies = [ + "async-trait", + "bytes", + "futures-util", + "http", + "http-body", + "mime", + "rustversion", + "tower-layer", + "tower-service", +] + +[[package]] +name = "backtrace" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +dependencies = [ + "addr2line", + "cc", + "cfg-if 1.0.0", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + +[[package]] +name = "base64" +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 = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitvec" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" +dependencies = [ + "funty", + "radium", + "tap", + "wyz", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[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 = "borsh" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f58b559fd6448c6e2fd0adb5720cd98a2506594cafa4737ff98c396f3e82f667" +dependencies = [ + "borsh-derive", + "cfg_aliases", +] + +[[package]] +name = "borsh-derive" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7aadb5b6ccbd078890f6d7003694e33816e6b784358f18e15e7e6d9f065a57cd" +dependencies = [ + "once_cell", + "proc-macro-crate 3.1.0", + "proc-macro2", + "quote", + "syn 2.0.48", + "syn_derive", +] + +[[package]] +name = "bs58" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" +dependencies = [ + "sha2", + "tinyvec", +] + +[[package]] +name = "bumpalo" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" + +[[package]] +name = "bytecheck" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6372023ac861f6e6dc89c8344a8f398fb42aaba2b5dbc649ca0c0e9dbcb627" +dependencies = [ + "bytecheck_derive", + "ptr_meta", + "simdutf8", +] + +[[package]] +name = "bytecheck_derive" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7ec4c6f261935ad534c0c22dbef2201b45918860eb1c574b972bd213a76af61" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" + +[[package]] +name = "cbc" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6" +dependencies = [ + "cipher", +] + +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + +[[package]] +name = "cfg-if" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + +[[package]] +name = "chrono" +version = "0.4.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41daef31d7a747c5c847246f36de49ced6f7403b4cdabc807a97b5cc184cda7a" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "wasm-bindgen", + "windows-targets 0.52.0", +] + +[[package]] +name = "cipher" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" +dependencies = [ + "crypto-common", + "inout", +] + +[[package]] +name = "concordium-cis2" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1861ee5cd523b0f1fcca1b2c04919dba79d7d8cf6a325edfc68f228964a3f4d4" +dependencies = [ + "concordium-std", + "primitive-types", +] + +[[package]] +name = "concordium-contracts-common" +version = "9.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27f49ffe8ff944ec174f597b3f0d1f84e77e6dd3e8eb2fad3bdd08c8d1dcf7c9" +dependencies = [ + "base64", + "bs58", + "chrono", + "concordium-contracts-common-derive", + "fnv", + "hashbrown 0.11.2", + "hex", + "num-bigint", + "num-integer", + "num-traits", + "rust_decimal", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "concordium-contracts-common-derive" +version = "4.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f9db2f3ebe6616b1658ec10acc3e9ca31f65824e3ab5ad88f3cf2532e25aed2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "concordium-rust-sdk" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d98ad09fd9f5496180d1fe79b4e71ab69a88d58f2c509ccaa47659ab712681db" +dependencies = [ + "aes-gcm", + "anyhow", + "chrono", + "concordium-smart-contract-engine", + "concordium_base", + "derive_more", + "ed25519-dalek", + "futures", + "hex", + "http", + "num", + "num-bigint", + "num-traits", + "prost", + "rand", + "rust_decimal", + "semver", + "serde", + "serde_json", + "sha2", + "thiserror", + "tokio", + "tokio-stream", + "tonic", + "tracing", +] + +[[package]] +name = "concordium-smart-contract-engine" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23751642d6672291e4feac02252f5f1d258cd3c093873a7f59f3d9a7cc165f82" +dependencies = [ + "anyhow", + "byteorder", + "concordium-contracts-common", + "concordium-wasm", + "derive_more", + "ed25519-zebra", + "futures", + "libc", + "num_enum", + "rand", + "secp256k1", + "serde", + "sha2", + "sha3", + "slab", + "thiserror", + "tinyvec", +] + +[[package]] +name = "concordium-smart-contract-testing" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "947f4357eb3da00b4de20e845e36e91e51914f4a624aaacba111504f08f6146a" +dependencies = [ + "anyhow", + "concordium-rust-sdk", + "num-bigint", + "num-integer", + "sha2", + "thiserror", + "tokio", +] + +[[package]] +name = "concordium-std" +version = "9.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db762bc94b386b711ed8ae4a786a1022a542d7741c76b45c4ce4eb92c80fe565" +dependencies = [ + "concordium-contracts-common", + "wee_alloc", +] + +[[package]] +name = "concordium-wasm" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26a581ef6ae1b23e149eaf5ed1e43c1da877ded9ae0de4989cd71b76d25c67d7" +dependencies = [ + "anyhow", + "concordium-contracts-common", + "derive_more", + "leb128", + "num_enum", +] + +[[package]] +name = "concordium_base" +version = "4.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b92eba25481b3cec616943c433d780d1ca6db02cf2bc9be8d8d192d54dedb8" +dependencies = [ + "aes", + "anyhow", + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", + "base64", + "bs58", + "byteorder", + "cbc", + "chrono", + "concordium-contracts-common", + "concordium_base_derive", + "curve25519-dalek", + "derive_more", + "ed25519-dalek", + "either", + "ff", + "hex", + "hmac", + "itertools 0.10.5", + "leb128", + "libc", + "nom", + "num", + "num-bigint", + "num-traits", + "pbkdf2", + "rand", + "rayon", + "rust_decimal", + "serde", + "serde_json", + "serde_with", + "sha2", + "sha3", + "subtle", + "thiserror", + "zeroize", +] + +[[package]] +name = "concordium_base_derive" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9a154e9a64d58d3e9f890c603df847b8685cfd0bac3fadd18498af539650bed" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[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-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + +[[package]] +name = "cpufeatures" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +dependencies = [ + "libc", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +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-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "rand_core", + "typenum", +] + +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89b8c6a2e4b1f45971ad09761aafb85514a84744b67a95e32c3cc1352d1f65c" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "group", + "platforms", + "rand_core", + "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.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0209d94da627ab5605dcccf08bb18afa5009cfbef48d8a8b7d7bdbc79be25c5e" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "177e3443818124b357d8e76f53be906d60937f0d3a90773a664fa63fa253e621" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.48", +] + +[[package]] +name = "darling_macro" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "der" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "deranged" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +dependencies = [ + "powerfmt", + "serde", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_more" +version = "0.99.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 1.0.109", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "pkcs8", + "serde", + "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", + "rand_core", + "serde", + "sha2", + "subtle", + "zeroize", +] + +[[package]] +name = "ed25519-zebra" +version = "4.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" +dependencies = [ + "curve25519-dalek", + "ed25519", + "hashbrown 0.14.3", + "hex", + "rand_core", + "serde", + "sha2", + "zeroize", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "equivalent" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "ff" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +dependencies = [ + "bitvec", + "rand_core", + "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.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcf0ed7fe52a17a03854ec54a9f76d6d84508d1c0e66bc1793301c73fc8493c" +dependencies = [ + "static_assertions", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" + +[[package]] +name = "futures-executor" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-macro" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "futures-sink" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" + +[[package]] +name = "futures-task" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" + +[[package]] +name = "futures-util" +version = "0.3.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +dependencies = [ + "cfg-if 1.0.0", + "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.28.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" + +[[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.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http", + "indexmap 2.1.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash 0.7.7", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash 0.8.7", +] + +[[package]] +name = "hashbrown" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash 0.8.7", + "allocator-api2", +] + +[[package]] +name = "hermit-abi" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "http" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" +dependencies = [ + "bytes", + "http", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "0.14.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +dependencies = [ + "bytes", + "futures-channel", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", + "want", +] + +[[package]] +name = "hyper-timeout" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" +dependencies = [ + "hyper", + "pin-project-lite", + "tokio", + "tokio-io-timeout", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" +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 = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[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", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +dependencies = [ + "equivalent", + "hashbrown 0.14.3", + "serde", +] + +[[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 = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "js-sys" +version = "0.3.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "leb128" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" + +[[package]] +name = "libc" +version = "0.2.152" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" + +[[package]] +name = "log" +version = "0.4.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" + +[[package]] +name = "matchit" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" + +[[package]] +name = "memchr" +version = "2.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" + +[[package]] +name = "memory_units" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" + +[[package]] +name = "mime" +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.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", +] + +[[package]] +name = "mio" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +dependencies = [ + "libc", + "wasi", + "windows-sys", +] + +[[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" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[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", +] + +[[package]] +name = "num-complex" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" +dependencies = [ + "num-traits", +] + +[[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-iter" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-bigint", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_cpus" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" +dependencies = [ + "hermit-abi", + "libc", +] + +[[package]] +name = "num_enum" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "object" +version = "0.32.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "password-hash" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" +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 = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest", + "hmac", + "password-hash", + "sha2", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pin-project" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "platforms" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "626dec3cac7cc0e1577a2ec3fc496277ec2baa084bebad95bb6fdbfae235f84c" + +[[package]] +name = "polyval" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d52cff9d1d4dee5fe6d03729099f4a310a41179e0a10dbf542039873f2e826fb" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "opaque-debug", + "universal-hash", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" + +[[package]] +name = "primitive-types" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e28720988bff275df1f51b171e1b2a18c30d194c4d2b61defdacecd625a5d94a" +dependencies = [ + "fixed-hash", + "uint", +] + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + +[[package]] +name = "proc-macro-crate" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" +dependencies = [ + "toml_edit 0.21.0", +] + +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + +[[package]] +name = "proc-macro2" +version = "1.0.78" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prost" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "146c289cda302b98a28d40c8b3b90498d6e526dd24ac2ecea73e4e491685b94a" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-derive" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efb6c9a1dd1def8e2124d17e83a20af56f1570d6c2d2bd9e266ccb768df3840e" +dependencies = [ + "anyhow", + "itertools 0.11.0", + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "ptr_meta" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0738ccf7ea06b608c10564b31debd4f5bc5e197fc8bfe088f68ae5ce81e7a4f1" +dependencies = [ + "ptr_meta_derive", +] + +[[package]] +name = "ptr_meta_derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16b845dbfca988fa33db069c0e230574d15a3088f147a87b64c7589eb662c9ac" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "quote" +version = "1.0.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rayon" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", +] + +[[package]] +name = "rend" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2571463863a6bd50c32f94402933f03457a3fbaf697a707c5be741e459f08fd" +dependencies = [ + "bytecheck", +] + +[[package]] +name = "rkyv" +version = "0.7.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "527a97cdfef66f65998b5f3b637c26f5a5ec09cc52a3f9932313ac645f4190f5" +dependencies = [ + "bitvec", + "bytecheck", + "bytes", + "hashbrown 0.12.3", + "ptr_meta", + "rend", + "rkyv_derive", + "seahash", + "tinyvec", + "uuid", +] + +[[package]] +name = "rkyv_derive" +version = "0.7.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5c462a1328c8e67e4d6dbad1eb0355dd43e8ab432c6e227a43657f16ade5033" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "rust_decimal" +version = "1.33.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06676aec5ccb8fc1da723cc8c0f9a46549f21ebb8753d3915c6c41db1e7f1dc4" +dependencies = [ + "arrayvec", + "borsh", + "bytes", + "num-traits", + "rand", + "rkyv", + "serde", + "serde_json", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + +[[package]] +name = "rustversion" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" + +[[package]] +name = "ryu" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" + +[[package]] +name = "seahash" +version = "4.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" + +[[package]] +name = "secp256k1" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "295642060261c80709ac034f52fca8e5a9fa2c7d341ded5cdb164b7c33768b2a" +dependencies = [ + "secp256k1-sys", +] + +[[package]] +name = "secp256k1-sys" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "152e20a0fd0519390fc43ab404663af8a0b794273d2a91d60ad4a39f13ffe110" +dependencies = [ + "cc", +] + +[[package]] +name = "semver" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" + +[[package]] +name = "serde" +version = "1.0.195" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.195" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "serde_json" +version = "1.0.111" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "3.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f5c9fdb6b00a489875b22efd4b78fe2b363b72265cc5f6eb2e2b9ee270e6140c" +dependencies = [ + "base64", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.1.0", + "serde", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbff351eb4b33600a2e138dfa0b10b65a238ea8ff8fb2387c422c5022a3e8298" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "sha2" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest", + "keccak", +] + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "rand_core", +] + +[[package]] +name = "simdutf8" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f27f6278552951f1f2b8cf9da965d10969b2efdea95a6ec47987ab46edfe263a" + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "socket2" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn_derive" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "thiserror" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +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.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" +dependencies = [ + "deranged", + "itoa", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" +dependencies = [ + "time-core", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" + +[[package]] +name = "tokio" +version = "1.35.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "pin-project-lite", + "socket2", + "windows-sys", +] + +[[package]] +name = "tokio-io-timeout" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" +dependencies = [ + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", + "tracing", +] + +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.1.0", + "toml_datetime", + "winnow", +] + +[[package]] +name = "toml_edit" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +dependencies = [ + "indexmap 2.1.0", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tonic" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d560933a0de61cf715926b9cac824d4c883c2c43142f787595e48280c40a1d0e" +dependencies = [ + "async-stream", + "async-trait", + "axum", + "base64", + "bytes", + "h2", + "http", + "http-body", + "hyper", + "hyper-timeout", + "percent-encoding", + "pin-project", + "prost", + "tokio", + "tokio-stream", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "indexmap 1.9.3", + "pin-project", + "pin-project-lite", + "rand", + "slab", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + +[[package]] +name = "tower-service" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" + +[[package]] +name = "tracing" +version = "0.1.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +dependencies = [ + "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.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +dependencies = [ + "once_cell", +] + +[[package]] +name = "track-and-trace" +version = "0.1.0" +dependencies = [ + "concordium-cis2", + "concordium-smart-contract-testing", + "concordium-std", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "typenum" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" + +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unicode-ident" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" + +[[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 = "uuid" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f00cc9702ca12d3c81455259621e676d0f7251cec66a21e98fe2e9a37db93b2a" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" +dependencies = [ + "cfg-if 1.0.0", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.48", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.90" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" + +[[package]] +name = "wee_alloc" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" +dependencies = [ + "cfg-if 0.1.10", + "libc", + "memory_units", + "winapi", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.0", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +dependencies = [ + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", +] + +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +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" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + +[[package]] +name = "windows_x86_64_msvc" +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.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7cf47b659b318dccbd69cc4797a39ae128f533dce7902a1096044d1967b9c16" +dependencies = [ + "memchr", +] + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[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", +] diff --git a/trackAndTrace/smart-contract/Cargo.toml b/trackAndTrace/smart-contract/Cargo.toml new file mode 100644 index 00000000..4655da33 --- /dev/null +++ b/trackAndTrace/smart-contract/Cargo.toml @@ -0,0 +1,27 @@ +[package] +name = "track-and-trace" +version = "0.1.0" +authors = ["Concordium "] +edition = "2021" +license = "MPL-2.0" +description = "A smart contract for tracking and tracing items on a supply chain." + +[features] +default = ["std", "wee_alloc"] +std = ["concordium-std/std", "concordium-cis2/std"] +wee_alloc = ["concordium-std/wee_alloc"] + +[dependencies] +concordium-std = { version = "9.0", default-features = false } +concordium-cis2 = { version = "6.0", default-features = false } + +[dev-dependencies] +concordium-smart-contract-testing = { version = "4.0" } + +[lib] +crate-type=["cdylib", "rlib"] + +[profile.release] +codegen-units = 1 +opt-level = "s" + diff --git a/trackAndTrace/smart-contract/README.md b/trackAndTrace/smart-contract/README.md new file mode 100644 index 00000000..5e876f6d --- /dev/null +++ b/trackAndTrace/smart-contract/README.md @@ -0,0 +1,31 @@ +# Track and Trace smart contract + +## Prerequisites + +`cargo/rustup` and `cargo-concordium` needs to be [set up](https://developer.concordium.software/en/mainnet/smart-contracts/guides/quick-start.html). + +## Build + +Run the following command to compile the smart contract into the wasm module `module.wasm.v1` with embedded schema: + +```bash +cargo concordium build --schema-embed --out concordium-out/module.wasm.v1 +``` + +### Building for deployment + +When building for deployment, the `--verifiable` option for `cargo concordium build` should be utilized: + +```bash +cargo concordium build --schema-embed --out concordium-out/module.wasm.v1 --verifiable docker.io/concordium/verifiable-sc:1.70.0 +``` + +Documentation on using verifiable builds is available [here](https://docs.rs/crate/cargo-concordium/latest). + +## Test + +Run the following command to run the unit and integration tests: + +```bash +cargo concordium test --out concordium-out/module.wasm.v1 +``` diff --git a/trackAndTrace/smart-contract/src/lib.rs b/trackAndTrace/smart-contract/src/lib.rs new file mode 100644 index 00000000..f9c0e508 --- /dev/null +++ b/trackAndTrace/smart-contract/src/lib.rs @@ -0,0 +1,698 @@ +//! # Implementation of a simple track-and-trace contract. +//! +//! ## Grant and Revoke roles: +//! The contract has access control roles. The available roles are ADMIN (can +//! grant/revoke roles, create a new item, and update the status of an item), +//! PRODUCER (can update the status of an item from `Produced` to `InTransit`), +//! TRANSPORTER (can update the status of an item from `InTransit` to +//! `InStore`), and SELLER (can update the status of an item from `InStore` to +//! `Sold`). Several addresses can have the same role and an address can have +//! several roles. +//! +//! ## State machine: +//! The track-and-trace contract is modeled based on a state machine. The flow +//! of the state machine is as follows: The ADMIN creates a new item with status +//! `Produced`. Each new item is assigned the `next_item_id`. The `next_item_id` +//! value is sequentially increased by 1 in the contract's state. The different +//! roles can update the item's status based on the rules of the state machine +//! as follows: Produced -> InTransit -> InStore -> Sold. The ADMIN role is an +//! exception and can set an item's status to any value at any time ignoring the +//! state machine rules. +#![cfg_attr(not(feature = "std"), no_std)] +use concordium_cis2::*; +use concordium_std::{collections::BTreeMap, *}; + +/// Event tags. +pub const ITEM_CREATED_EVENT_TAG: u8 = 0; +pub const ITEM_STATUS_CHANGED_EVENT_TAG: u8 = 1; +pub const GRANT_ROLE_EVENT_TAG: u8 = 2; +pub const REVOKE_ROLE_EVENT_TAG: u8 = 3; + +/// Custom type for the item id. +type ItemID = u64; + +/// Tagged events to be serialized for the event log. +#[derive(Debug, Serial, Deserial, PartialEq, Eq)] +pub enum Event { + /// The event tracks when an item is created. + ItemCreated(ItemCreatedEvent), + /// The event tracks when the item's status is updated. + ItemStatusChanged(ItemStatusChangedEvent), + /// The event tracks when a new role is granted to an address. + GrantRole(GrantRoleEvent), + /// The event tracks when a role is revoked from an address. + RevokeRole(RevokeRoleEvent), +} + +/// The ItemCreatedEvent is logged when an item is created. +#[derive(Serialize, SchemaType, Debug, PartialEq, Eq)] +pub struct ItemCreatedEvent { + /// The item's id. + pub item_id: ItemID, + /// The item's metadata_url. + pub metadata_url: Option, +} + +/// The ItemStatusChangedEvent is logged when the status of an item is updated. +#[derive(Serialize, SchemaType, Debug, PartialEq, Eq)] +pub struct ItemStatusChangedEvent { + /// The item's id. + pub item_id: ItemID, + /// The item's new status. + pub new_status: Status, + /// Any additional data encoded as generic bytes. Usecase-specific data can + /// be included here such as temperature, longitude, latitude, ... . + pub additional_data: AdditionalData, +} + +/// The GrantRoleEvent is logged when a new role is granted to an address. +#[derive(Serialize, SchemaType, Debug, PartialEq, Eq)] +pub struct GrantRoleEvent { + /// The address that has been its role granted. + pub address: Address, + /// The role that was granted to the above address. + pub role: Roles, +} + +/// The RevokeRoleEvent is logged when a role is revoked from an address. +#[derive(Serialize, SchemaType, Debug, PartialEq, Eq)] +pub struct RevokeRoleEvent { + /// Address that has been its role revoked. + pub address: Address, + /// The role that was revoked from the above address. + pub role: Roles, +} + +/// A struct containing a set of roles granted to an address. +#[derive(Serial, DeserialWithState, Deletable)] +#[concordium(state_parameter = "S")] +struct AddressRoleState { + /// Set of roles. + roles: StateSet, +} + +/// Enum of available roles in this contract. Several addresses can have the +/// same role and an address can have several roles. +#[derive(Serialize, PartialEq, Eq, Reject, SchemaType, Clone, Copy, Debug)] +pub enum Roles { + /// Admin role. + ADMIN, + /// Producer role. + PRODUCER, + /// Transporter role. + TRANSPORTER, + /// Seller role. + SELLER, +} + +/// Enum of the statuses that an item can have. +#[derive(Serialize, PartialEq, Eq, Reject, SchemaType, Clone, Copy, Debug)] +pub enum Status { + /// Item is produced. + Produced, + /// Item is in transit. + InTransit, + /// Item is in store. + InStore, + /// Item is sold. + Sold, +} + +impl Status { + fn new() -> Self { Status::Produced } +} + +// Implementing a custom schemaType for the `Event` struct containing all +// events. This custom implementation flattens the fields to avoid one +// level of nesting. Deriving the schemaType would result in e.g.: {"Nonce": +// [{...fields}] }. In contrast, this custom schemaType implementation results +// in e.g.: {"Nonce": {...fields} } +impl schema::SchemaType for Event { + fn get_type() -> schema::Type { + let mut event_map = BTreeMap::new(); + event_map.insert( + ITEM_CREATED_EVENT_TAG, + ( + "ItemCreated".to_string(), + schema::Fields::Named(vec![ + (String::from("itemId"), ItemID::get_type()), + ( + String::from("metadataURL"), + Option::::get_type(), + ), + ]), + ), + ); + event_map.insert( + ITEM_STATUS_CHANGED_EVENT_TAG, + ( + "ItemStatusChanged".to_string(), + schema::Fields::Named(vec![ + (String::from("itemId"), ItemID::get_type()), + (String::from("newStatus"), Status::get_type()), + (String::from("additionalData"), AdditionalData::get_type()), + ]), + ), + ); + event_map.insert( + GRANT_ROLE_EVENT_TAG, + ( + "GrantRole".to_string(), + schema::Fields::Named(vec![ + (String::from("address"), Address::get_type()), + (String::from("role"), Roles::get_type()), + ]), + ), + ); + event_map.insert( + REVOKE_ROLE_EVENT_TAG, + ( + "RevokeRole".to_string(), + schema::Fields::Named(vec![ + (String::from("address"), Address::get_type()), + (String::from("role"), Roles::get_type()), + ]), + ), + ); + schema::Type::TaggedEnum(event_map) + } +} + +/// A struct containing a state of one item. +#[derive(Debug, Serialize, SchemaType, Clone, PartialEq, Eq)] +pub struct ItemState { + /// The status of the item. + pub status: Status, + /// The metadata_url of the item. + pub metadata_url: Option, +} + +/// The state of the smart contract. +/// This state can be viewed by querying the node with the command +/// `concordium-client contract invoke` using the `view` function as entrypoint. +#[derive(Serial, DeserialWithState)] +#[concordium(state_parameter = "S")] +struct State { + /// The next item id that will be assigned to an item when the admin creates + /// it. This value is sequentially increased by 1. + next_item_id: ItemID, + /// A map containing all roles granted to addresses. + roles: StateMap, S>, + /// A map containing all items with their states. + items: StateMap, +} + +/// The different errors the contract can produce. +#[derive(Serialize, Debug, PartialEq, Eq, Reject, SchemaType)] +pub enum CustomContractError { + /// Failed parsing the parameter. + #[from(ParseError)] + ParseParams, // -1 + /// Failed logging because the log is full. + LogFull, // -2 + /// Failed logging because the log is malformed. + LogMalformed, // -3 + /// Failed because the actor is not authorized to invoke the entry point. + Unauthorized, // -4 + /// Failed to revoke role because it was not granted in the first place. + RoleWasNotGranted, // -5 + /// Failed to grant role because it was granted already in the first place. + RoleWasAlreadyGranted, // -6 + /// Item with given item id already exists in the state. + ItemAlreadyExists, // -7 + /// Item with given item id does not exist in the state. + ItemDoesNotExist, // -8 + /// The item is already in the final state and cannot be updated based on + /// the state machine rules. + FinalState, // -9 +} + +/// Mapping the logging errors to CustomContractError. +impl From for CustomContractError { + fn from(le: LogError) -> Self { + match le { + LogError::Full => Self::LogFull, + LogError::Malformed => Self::LogMalformed, + } + } +} + +/// Custom type for the contract result. +pub type ContractResult = Result; + +impl State { + /// Grant role to an address. + fn grant_role(&mut self, account: &Address, role: Roles, state_builder: &mut StateBuilder) { + self.roles + .entry(*account) + .or_insert_with(|| AddressRoleState { + roles: state_builder.new_set(), + }); + + self.roles.entry(*account).and_modify(|entry| { + entry.roles.insert(role); + }); + } + + /// Revoke role from an address. + fn revoke_role(&mut self, account: &Address, role: Roles) { + self.roles.entry(*account).and_modify(|entry| { + entry.roles.remove(&role); + }); + } + + /// Check if an address has a role. + fn has_role(&self, account: &Address, role: Roles) -> bool { + return match self.roles.get(account) { + None => false, + Some(roles) => roles.roles.contains(&role), + }; + } + + /// Change the item status to the given new status. The function reverts if + /// the item does not exist. + fn change_item_status( + &mut self, + item_index: ItemID, + new_state: Status, + ) -> Result<(), CustomContractError> { + let mut previous_state = self + .items + .entry(item_index) + .occupied_or(CustomContractError::ItemDoesNotExist)?; + + previous_state.status = new_state; + + Ok(()) + } +} + +/// Init function that creates a new contract. +#[init(contract = "track_and_trace", event = "Event", enable_logger)] +fn init( + ctx: &InitContext, + state_builder: &mut StateBuilder, + logger: &mut impl HasLogger, +) -> InitResult { + // Get the instantiater of this contract instance. + let invoker = Address::Account(ctx.init_origin()); + + // Creating `State` + let mut state = State { + next_item_id: 0u64, + roles: state_builder.new_map(), + items: state_builder.new_map(), + }; + + // Grant ADMIN role. + state.grant_role(&invoker, Roles::ADMIN, state_builder); + logger.log(&Event::GrantRole(GrantRoleEvent { + address: invoker, + role: Roles::ADMIN, + }))?; + + Ok(state) +} + +/// Return_value of the `view` function contains the content of the state. +#[derive(Serialize, SchemaType, PartialEq, Eq, Debug)] +pub struct ViewState { + /// The next item id that will be assigned to an item when the admin creates + /// it. + pub next_item_id: ItemID, + /// A vector containing all roles granted to addresses. + pub roles: Vec<(Address, Vec)>, + /// A vector containing all items with their states. + pub items: Vec<(ItemID, ItemState)>, +} + +/// View function for testing. This function reports on the entire state of the +/// contract for testing purposes. +#[receive( + contract = "track_and_trace", + name = "view", + return_value = "ViewState" +)] +fn contract_view(_ctx: &ReceiveContext, host: &Host) -> ReceiveResult { + let state = host.state(); + + let roles: Vec<(Address, Vec)> = state + .roles + .iter() + .map(|(key, value)| { + let mut roles_vec = Vec::new(); + for role in value.roles.iter() { + roles_vec.push(*role); + } + (*key, roles_vec) + }) + .collect(); + + let items: Vec<(ItemID, ItemState)> = state + .items + .iter() + .map(|(key, value)| (*key, (*value).clone())) + .collect(); + + Ok(ViewState { + roles, + items, + next_item_id: state.next_item_id, + }) +} + +/// Receive function for the ADMIN to create a new item. +/// +/// It rejects if: +/// - It fails to parse the parameter. +/// - The sender is not the ADMIN of the contract instance. +/// - The item already exists in the state which should technically not happen. +/// - It fails to log the `ItemCreatedEvent`. +#[receive( + contract = "track_and_trace", + name = "createItem", + parameter = "Option", + error = "CustomContractError", + mutable, + enable_logger +)] +fn create_item( + ctx: &ReceiveContext, + host: &mut Host, + logger: &mut impl HasLogger, +) -> Result<(), CustomContractError> { + // Parse the parameter. + let metadata_url: Option = ctx.parameter_cursor().get()?; + + // Check that only the ADMIN is authorized to create a new item. + ensure!( + host.state().has_role(&ctx.sender(), Roles::ADMIN), + CustomContractError::Unauthorized + ); + + // Get the next available item id. + let next_item_id = host.state().next_item_id; + // Increase the item id tracker in the state. + host.state_mut().next_item_id += 1; + + // Create the item in state. + let previous_item = host.state_mut().items.insert(next_item_id, ItemState { + metadata_url: metadata_url.clone(), + status: Status::new(), + }); + + ensure_eq!(previous_item, None, CustomContractError::ItemAlreadyExists); + + // Log an ItemCreatedEvent. + logger.log(&Event::ItemCreated(ItemCreatedEvent { + item_id: next_item_id, + metadata_url, + }))?; + + Ok(()) +} + +/// Partial parameter type for the contract function +/// `changeItemStatus/changeItemStatusByAdmin`. +#[derive(Serialize, SchemaType, Debug, PartialEq, Eq)] +pub struct AdditionalData { + /// Any additional data encoded as generic bytes. Usecase-specific data can + /// be included here such as temperature, longitude, latitude, ... . + pub bytes: Vec, +} + +/// The parameter type for the contract function `changeItemStatusByAdmin` which +/// updates the status of an item. +#[derive(Serialize, SchemaType)] +pub struct ChangeItemStatusParamsByAdmin { + /// The item's id. + pub item_id: ItemID, + /// The item's new status. + pub new_status: Status, + /// Any additional data encoded as generic bytes. Usecase-specific data can + /// be included here such as temperature, longitude, latitude, ... . + pub additional_data: AdditionalData, +} + +/// Receive function for the ADMIN to change the +/// status of an item. The ADMIN can set the item's status +/// to any value at any time. +/// +/// It rejects if: +/// - It fails to parse the parameter. +/// - Sender is not an authorized role. +/// - The item does not exist in the state. +/// - It fails to log the `ItemStatusChangedEvent`. +#[receive( + contract = "track_and_trace", + name = "changeItemStatusByAdmin", + parameter = "ChangeItemStatusParamsByAdmin", + error = "CustomContractError", + mutable, + enable_logger +)] +fn change_item_status_by_admin( + ctx: &ReceiveContext, + host: &mut Host, + logger: &mut impl HasLogger, +) -> Result<(), CustomContractError> { + // Parse the parameter. + let param: ChangeItemStatusParamsByAdmin = ctx.parameter_cursor().get()?; + + // Check that only the ADMIN is authorized. + ensure!( + host.state().has_role(&ctx.sender(), Roles::ADMIN), + CustomContractError::Unauthorized + ); + + // The admin can set the item's status to any value at any time. + host.state_mut() + .change_item_status(param.item_id, param.new_status)?; + + // Log an ItemStatusChangedEvent. + logger.log(&Event::ItemStatusChanged(ItemStatusChangedEvent { + item_id: param.item_id, + new_status: param.new_status, + additional_data: param.additional_data, + }))?; + + Ok(()) +} + +/// The parameter type for the contract function `changeItemStatus` which +/// updates the status of an item. +#[derive(Serialize, SchemaType)] +pub struct ChangeItemStatusParams { + /// The item's id. + pub item_id: ItemID, + /// Any additional data encoded as generic bytes. Usecase-specific data can + /// be included here such as temperature, longitude, latitude, ... . + pub additional_data: AdditionalData, +} + +/// Function to update the item's status based on the rules of the state +/// machine. +fn update_state_machine( + host: &mut Host, + sender: Address, + item_id: ItemID, +) -> Result { + // Get the item from the state. + let mut item = host + .state_mut() + .items + .entry(item_id) + .occupied_or(CustomContractError::ItemDoesNotExist)?; + + // Model the state transition based on the rules of the state machine. + match item.status { + Status::Produced => { + item.status = Status::InTransit; + drop(item); + + // Check that only the correct role is authorized. + ensure!( + host.state().has_role(&sender, Roles::PRODUCER), + CustomContractError::Unauthorized + ); + Ok(Status::InTransit) + } + Status::InTransit => { + item.status = Status::InStore; + drop(item); + + // Check that only the correct role is authorized. + ensure!( + host.state().has_role(&sender, Roles::TRANSPORTER), + CustomContractError::Unauthorized + ); + Ok(Status::InStore) + } + Status::InStore => { + item.status = Status::Sold; + drop(item); + + // Check that only the correct role is authorized. + ensure!( + host.state().has_role(&sender, Roles::SELLER), + CustomContractError::Unauthorized + ); + Ok(Status::Sold) + } + Status::Sold => bail!(CustomContractError::FinalState), + } +} + +/// Receive function for the other ROLES (all roles except for the ADMIN role) +/// to change the status of an item. The other ROLES can update the item's +/// status based on the rules of the state machine. +/// +/// It rejects if: +/// - It fails to parse the parameter. +/// - Sender is not an authorized role to update the item to the next state. +/// - The item does not exist in the state. +/// - The item is already in the `Sold` state (final state). +/// - It fails to log the `ItemStatusChangedEvent`. +#[receive( + contract = "track_and_trace", + name = "changeItemStatus", + parameter = "ChangeItemStatusParams", + error = "CustomContractError", + mutable, + enable_logger +)] +fn change_item_status( + ctx: &ReceiveContext, + host: &mut Host, + logger: &mut impl HasLogger, +) -> Result<(), CustomContractError> { + // Parse the parameter. + let param: ChangeItemStatusParams = ctx.parameter_cursor().get()?; + + let new_status = update_state_machine(host, ctx.sender(), param.item_id)?; + + // Log an ItemStatusChangedEvent. + logger.log(&Event::ItemStatusChanged(ItemStatusChangedEvent { + item_id: param.item_id, + new_status, + additional_data: param.additional_data, + }))?; + + Ok(()) +} + +/// The parameter for the contract function `grantRole` which grants a role to +/// an address. +#[derive(Serialize, SchemaType)] +pub struct GrantRoleParams { + /// The address that has been its role granted. + pub address: Address, + /// The role that has been granted to the above address. + pub role: Roles, +} + +/// Add role to an address. +/// +/// It rejects if: +/// - It fails to parse the parameter. +/// - The sender is not the ADMIN of the contract instance. +/// - The `address` is already holding the specified role to be granted. +#[receive( + contract = "track_and_trace", + name = "grantRole", + parameter = "GrantRoleParams", + error = "CustomContractError", + enable_logger, + mutable +)] +fn contract_grant_role( + ctx: &ReceiveContext, + host: &mut Host, + logger: &mut impl HasLogger, +) -> ContractResult<()> { + // Parse the parameter. + let params: GrantRoleParams = ctx.parameter_cursor().get()?; + + let (state, state_builder) = host.state_and_builder(); + + // Get the sender who invoked this contract function. + let sender = ctx.sender(); + // Check that only the ADMIN is authorized to grant roles. + ensure!( + state.has_role(&sender, Roles::ADMIN), + CustomContractError::Unauthorized + ); + + // Check that the `address` had previously not held the specified role. + ensure!( + !state.has_role(¶ms.address, params.role), + CustomContractError::RoleWasAlreadyGranted + ); + + // Grant role. + state.grant_role(¶ms.address, params.role, state_builder); + // Log a GrantRoleEvent. + logger.log(&Event::GrantRole(GrantRoleEvent { + address: params.address, + role: params.role, + }))?; + Ok(()) +} + +/// The parameter for the contract function `revokeRole` which revokes a role +/// from an address. +#[derive(Serialize, SchemaType)] +pub struct RevokeRoleParams { + /// The address that has been its role revoked. + pub address: Address, + /// The role that has been revoked from the above address. + pub role: Roles, +} + +/// Revoke role from an address. +/// +/// It rejects if: +/// - It fails to parse the parameter. +/// - The sender is not the ADMIN of the contract instance. +/// - The `address` does not hold the specified role to be revoked. +#[receive( + contract = "track_and_trace", + name = "revokeRole", + parameter = "RevokeRoleParams", + error = "CustomContractError", + enable_logger, + mutable +)] +fn contract_revoke_role( + ctx: &ReceiveContext, + host: &mut Host, + logger: &mut impl HasLogger, +) -> ContractResult<()> { + // Parse the parameter. + let params: RevokeRoleParams = ctx.parameter_cursor().get()?; + + let (state, _) = host.state_and_builder(); + + // Get the sender who invoked this contract function. + let sender = ctx.sender(); + // Check that only the ADMIN is authorized to revoke roles. + ensure!( + state.has_role(&sender, Roles::ADMIN), + CustomContractError::Unauthorized + ); + + // Check that the `address` had previously held the specified role. + ensure!( + state.has_role(¶ms.address, params.role), + CustomContractError::RoleWasNotGranted + ); + + // Revoke role. + state.revoke_role(¶ms.address, params.role); + // Log a RevokeRoleEvent. + logger.log(&Event::RevokeRole(RevokeRoleEvent { + address: params.address, + role: params.role, + }))?; + Ok(()) +} diff --git a/trackAndTrace/smart-contract/tests/tests.rs b/trackAndTrace/smart-contract/tests/tests.rs new file mode 100644 index 00000000..8c4c4288 --- /dev/null +++ b/trackAndTrace/smart-contract/tests/tests.rs @@ -0,0 +1,330 @@ +//! Tests for the track_and_trace smart contract. +use concordium_smart_contract_testing::*; +use concordium_std::MetadataUrl; +use track_and_trace::*; + +/// The test accounts. +const ADMIN: AccountAddress = AccountAddress([0; 32]); +const ADMIN_ADDR: Address = Address::Account(AccountAddress([0; 32])); +const PRODUCER: AccountAddress = AccountAddress([1; 32]); +const PRODUCER_ADDR: Address = Address::Account(AccountAddress([1; 32])); +const TRANSPORTER: AccountAddress = AccountAddress([2; 32]); +const TRANSPORTER_ADDR: Address = Address::Account(AccountAddress([2; 32])); +const SELLER: AccountAddress = AccountAddress([3; 32]); +const SELLER_ADDR: Address = Address::Account(AccountAddress([3; 32])); + +const SIGNER: Signer = Signer::with_one_key(); +const ACC_INITIAL_BALANCE: Amount = Amount::from_ccd(10000); + +// 1. Test that the ADMIN can create a new item. +// 2. Test that the PRODUCER can update the item status to `InTransit`. +// 3. Test that the SELLER can NOT update the item status to `InStore`. +// 4. Test that the ADMIN can update the item status to `Sold`. The ADMIN can +// update the item to any state, neglecting the rules of the state machine. +#[test] +fn test_create_item_and_update_item_status() { + let (mut chain, track_and_trace_contract_address) = initialize_chain_and_contract(); + + // Create the Parameter. + let metadata_url = Some(MetadataUrl { + url: "https://some.example/".to_string(), + hash: None, + }); + + // Check the ADMIN can create a new item. + let update = chain + .contract_update( + SIGNER, + ADMIN, + ADMIN_ADDR, + Energy::from(10000), + UpdateContractPayload { + amount: Amount::from_ccd(0), + address: track_and_trace_contract_address, + receive_name: OwnedReceiveName::new_unchecked( + "track_and_trace.createItem".to_string(), + ), + message: OwnedParameter::from_serial(&metadata_url) + .expect("Serialize parameter"), + }, + ) + .expect("Should be able to create item"); + + // Check that the events are logged. + let events = update + .events() + .flat_map(|(_addr, events)| events.iter().map(|e| e.parse().expect("Deserialize event"))) + .collect::>(); + + assert_eq!(events, [Event::ItemCreated(ItemCreatedEvent { + item_id: 0u64, + metadata_url: metadata_url.clone(), + })]); + + // Check contract state. + check_state( + &chain, + track_and_trace_contract_address, + Status::Produced, + metadata_url.clone(), + ); + + let parameter = ChangeItemStatusParams { + item_id: 0u64, + additional_data: AdditionalData { bytes: vec![] }, + }; + + // Check the PRODUCER can update the item based on the state machine rules. + let update = chain + .contract_update( + SIGNER, + PRODUCER, + PRODUCER_ADDR, + Energy::from(10000), + UpdateContractPayload { + amount: Amount::from_ccd(0), + address: track_and_trace_contract_address, + receive_name: OwnedReceiveName::new_unchecked( + "track_and_trace.changeItemStatus".to_string(), + ), + message: OwnedParameter::from_serial(¶meter).expect("Serialize parameter"), + }, + ) + .expect("Should be able update the state of the item"); + + // Check that the events are logged. + let events = update + .events() + .flat_map(|(_addr, events)| events.iter().map(|e| e.parse().expect("Deserialize event"))) + .collect::>(); + + assert_eq!(events, [Event::ItemStatusChanged(ItemStatusChangedEvent { + item_id: parameter.item_id, + new_status: Status::InTransit, + additional_data: parameter.additional_data, + })]); + + // Check contract state. + check_state( + &chain, + track_and_trace_contract_address, + Status::InTransit, + metadata_url.clone(), + ); + + let parameter = ChangeItemStatusParams { + item_id: 0u64, + additional_data: AdditionalData { bytes: vec![] }, + }; + + // Check the SELLER can NOT update the item because of the rules of the state + // machine. + let update = chain + .contract_update( + SIGNER, + SELLER, + SELLER_ADDR, + Energy::from(10000), + UpdateContractPayload { + amount: Amount::from_ccd(0), + address: track_and_trace_contract_address, + receive_name: OwnedReceiveName::new_unchecked( + "track_and_trace.changeItemStatus".to_string(), + ), + message: OwnedParameter::from_serial(¶meter).expect("Serialize parameter"), + }, + ) + .expect_err("Should expect error"); + + // Check that the correct error is returned. + let error: CustomContractError = update + .parse_return_value() + .expect("CustomContractError return value"); + assert_eq!(error, CustomContractError::Unauthorized); + + let parameter = ChangeItemStatusParamsByAdmin { + item_id: 0u64, + new_status: Status::Sold, + additional_data: AdditionalData { bytes: vec![] }, + }; + + // Check the ADMIN can update the item to any state. + let update = chain + .contract_update( + SIGNER, + ADMIN, + ADMIN_ADDR, + Energy::from(10000), + UpdateContractPayload { + amount: Amount::from_ccd(0), + address: track_and_trace_contract_address, + receive_name: OwnedReceiveName::new_unchecked( + "track_and_trace.changeItemStatusByAdmin".to_string(), + ), + message: OwnedParameter::from_serial(¶meter).expect("Serialize parameter"), + }, + ) + .expect("Should be able to update the state of the item"); + + // Check that the events are logged. + let events = update + .events() + .flat_map(|(_addr, events)| events.iter().map(|e| e.parse().expect("Deserialize event"))) + .collect::>(); + + assert_eq!(events, [Event::ItemStatusChanged(ItemStatusChangedEvent { + item_id: parameter.item_id, + new_status: parameter.new_status, + additional_data: parameter.additional_data, + })]); + + // Check contract state. + check_state( + &chain, + track_and_trace_contract_address, + parameter.new_status, + metadata_url, + ); +} + +// Invoke the `view` function and check that the contract state is as expected. +// Exactly one item is expected to be in the state. +fn check_state( + chain: &Chain, + track_and_trace_contract_address: ContractAddress, + status: Status, + metadata_url: Option, +) { + let invoke = chain + .contract_invoke( + ADMIN, + ADMIN_ADDR, + Energy::from(10000), + UpdateContractPayload { + amount: Amount::zero(), + receive_name: OwnedReceiveName::new_unchecked("track_and_trace.view".to_string()), + address: track_and_trace_contract_address, + message: OwnedParameter::empty(), + }, + ) + .expect("Invoke view"); + + let return_value: ViewState = invoke.parse_return_value().expect("ViewState return value"); + + // Check that the status of the item is correct. + assert_eq!(return_value, ViewState { + next_item_id: 1, + roles: vec![ + (ADMIN_ADDR, vec![Roles::ADMIN]), + (PRODUCER_ADDR, vec![Roles::PRODUCER]), + (TRANSPORTER_ADDR, vec![Roles::TRANSPORTER]), + (SELLER_ADDR, vec![Roles::SELLER]), + ], + items: vec![(0, ItemState { + status, + metadata_url + })], + }); +} + +/// Setup chain and contract. +fn initialize_chain_and_contract() -> (Chain, ContractAddress) { + let mut chain = Chain::builder() + .build() + .expect("Should be able to build chain"); + + // Create some accounts on the chain. + chain.create_account(Account::new(ADMIN, ACC_INITIAL_BALANCE)); + chain.create_account(Account::new(PRODUCER, ACC_INITIAL_BALANCE)); + chain.create_account(Account::new(TRANSPORTER, ACC_INITIAL_BALANCE)); + chain.create_account(Account::new(SELLER, ACC_INITIAL_BALANCE)); + + // Load and deploy the track_and_trace module. + let module = module_load_v1("./concordium-out/module.wasm.v1").expect("Module exists"); + let deployment = chain + .module_deploy_v1(SIGNER, ADMIN, module) + .expect("Deploy valid module"); + + // Initialize the track_and_trace contract. + let track_and_trace = chain + .contract_init(SIGNER, ADMIN, Energy::from(10000), InitContractPayload { + amount: Amount::zero(), + mod_ref: deployment.module_reference, + init_name: OwnedContractName::new_unchecked("init_track_and_trace".to_string()), + param: OwnedParameter::empty(), + }) + .expect("Initialize track_and_trace contract"); + + // Grant PRODUCER role + let grant_role_params = GrantRoleParams { + address: PRODUCER_ADDR, + role: Roles::PRODUCER, + }; + + let _update = chain + .contract_update( + SIGNER, + ADMIN, + ADMIN_ADDR, + Energy::from(10000), + UpdateContractPayload { + amount: Amount::zero(), + receive_name: OwnedReceiveName::new_unchecked( + "track_and_trace.grantRole".to_string(), + ), + address: track_and_trace.contract_address, + message: OwnedParameter::from_serial(&grant_role_params) + .expect("GrantRole params"), + }, + ) + .expect("PRODUCER should be granted role"); + + // Grant TRANSPORTER role + let grant_role_params = GrantRoleParams { + address: TRANSPORTER_ADDR, + role: Roles::TRANSPORTER, + }; + + let _update = chain + .contract_update( + SIGNER, + ADMIN, + ADMIN_ADDR, + Energy::from(10000), + UpdateContractPayload { + amount: Amount::zero(), + receive_name: OwnedReceiveName::new_unchecked( + "track_and_trace.grantRole".to_string(), + ), + address: track_and_trace.contract_address, + message: OwnedParameter::from_serial(&grant_role_params) + .expect("GrantRole params"), + }, + ) + .expect("TRANSPORTER should be granted role"); + + // Grant SELLER role + let grant_role_params = GrantRoleParams { + address: SELLER_ADDR, + role: Roles::SELLER, + }; + + let _update = chain + .contract_update( + SIGNER, + ADMIN, + ADMIN_ADDR, + Energy::from(10000), + UpdateContractPayload { + amount: Amount::zero(), + receive_name: OwnedReceiveName::new_unchecked( + "track_and_trace.grantRole".to_string(), + ), + address: track_and_trace.contract_address, + message: OwnedParameter::from_serial(&grant_role_params) + .expect("GrantRole params"), + }, + ) + .expect("SELLER should be granted role"); + (chain, track_and_trace.contract_address) +}