From c54e8402287b3a893ddba1c2a081c09b3d5e747f Mon Sep 17 00:00:00 2001 From: Linguists <95207870+linguists@users.noreply.github.com> Date: Mon, 12 May 2025 13:41:54 +0800 Subject: [PATCH 01/16] feat: initial commit --- .github/workflows/deploy-production.yml | 27 + .github/workflows/deploy-staging.yml | 56 + .github/workflows/test.yml | 32 + .github/workflows/undeploy-staging.yml | 25 + .gitignore | 18 +- Cargo.lock | 4503 +++++++++++++++++++++++ Cargo.toml | 55 + README.md | 34 +- rust-toolchain.toml | 4 + src/lib.rs | 55 + src/voting.rs | 360 ++ tests/test_basics.rs | 30 + 12 files changed, 5180 insertions(+), 19 deletions(-) create mode 100644 .github/workflows/deploy-production.yml create mode 100644 .github/workflows/deploy-staging.yml create mode 100644 .github/workflows/test.yml create mode 100644 .github/workflows/undeploy-staging.yml create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 rust-toolchain.toml create mode 100644 src/lib.rs create mode 100644 src/voting.rs create mode 100644 tests/test_basics.rs diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml new file mode 100644 index 0000000..07ba5a6 --- /dev/null +++ b/.github/workflows/deploy-production.yml @@ -0,0 +1,27 @@ +name: Deploy to production +on: + push: + branches: [main] + +jobs: + test: + uses: ./.github/workflows/test.yml + + deploy-staging: + name: Deploy to production + needs: [test] + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install cargo-near CLI + run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/download/cargo-near-v0.14.2/cargo-near-installer.sh | sh + - name: Deploy to production + run: | + cargo near deploy build-reproducible-wasm "${{ vars.NEAR_CONTRACT_PRODUCTION_ACCOUNT_ID }}" \ + without-init-call \ + network-config "${{ vars.NEAR_CONTRACT_PRODUCTION_NETWORK }}" \ + sign-with-plaintext-private-key \ + --signer-public-key "${{ vars.NEAR_CONTRACT_PRODUCTION_ACCOUNT_PUBLIC_KEY }}" \ + --signer-private-key "${{ secrets.NEAR_CONTRACT_PRODUCTION_ACCOUNT_PRIVATE_KEY }}" \ + send diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml new file mode 100644 index 0000000..9832a2a --- /dev/null +++ b/.github/workflows/deploy-staging.yml @@ -0,0 +1,56 @@ +name: Deploy to staging +on: + pull_request: + +jobs: + test: + uses: ./.github/workflows/test.yml + + deploy-staging: + name: Deploy to staging subaccount + permissions: + pull-requests: write + needs: [test] + runs-on: ubuntu-latest + env: + NEAR_CONTRACT_PR_STAGING_ACCOUNT_ID: gh-${{ github.event.number }}.${{ vars.NEAR_CONTRACT_STAGING_ACCOUNT_ID }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install near CLI + run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/near-cli-rs/releases/download/v0.11.1/near-cli-rs-installer.sh | sh + - name: Create staging account + if: github.event.action == 'opened' || github.event.action == 'reopened' + run: | + near account create-account fund-myself "${{ env.NEAR_CONTRACT_PR_STAGING_ACCOUNT_ID }}" '10 NEAR' \ + use-manually-provided-public-key "${{ vars.NEAR_CONTRACT_STAGING_ACCOUNT_PUBLIC_KEY }}" \ + sign-as "${{ vars.NEAR_CONTRACT_STAGING_ACCOUNT_ID }}" \ + network-config "${{ vars.NEAR_CONTRACT_STAGING_NETWORK }}" \ + sign-with-plaintext-private-key \ + --signer-public-key "${{ vars.NEAR_CONTRACT_STAGING_ACCOUNT_PUBLIC_KEY }}" \ + --signer-private-key "${{ secrets.NEAR_CONTRACT_STAGING_ACCOUNT_PRIVATE_KEY }}" \ + send + + - name: Install cargo-near CLI + run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/download/cargo-near-v0.14.2/cargo-near-installer.sh | sh + - name: Deploy to staging + # `--skip-git-remote-check` was used + # as pull request git refs `refs/pull/NUMBER/merge` are somewhat harder to access and live only as long as PRs do + # + # WASM reproducibility check akin to SourceScan won't be available for staging contracts, deployed from PRs + run: | + cargo near deploy build-reproducible-wasm --skip-git-remote-check "${{ env.NEAR_CONTRACT_PR_STAGING_ACCOUNT_ID }}" \ + without-init-call \ + network-config "${{ vars.NEAR_CONTRACT_STAGING_NETWORK }}" \ + sign-with-plaintext-private-key \ + --signer-public-key "${{ vars.NEAR_CONTRACT_STAGING_ACCOUNT_PUBLIC_KEY }}" \ + --signer-private-key "${{ secrets.NEAR_CONTRACT_STAGING_ACCOUNT_PRIVATE_KEY }}" \ + send + + - name: Comment on pull request + env: + GH_TOKEN: ${{ github.token }} + run: | + gh pr comment "${{ github.event.number }}" --body "Staging contract is deployed to ["'`'"${{ env.NEAR_CONTRACT_PR_STAGING_ACCOUNT_ID }}"'`'" account](https://explorer.${{ vars.NEAR_CONTRACT_STAGING_NETWORK }}.near.org/accounts/${{ env.NEAR_CONTRACT_PR_STAGING_ACCOUNT_ID }})" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..7f847af --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,32 @@ +name: Test +on: + workflow_call: + +jobs: + code-formatting: + name: Code Formatting + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - run: cargo fmt --check + + code-linter: + name: Code Linter + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Run cargo clippy + run: | + rustup component add clippy + cargo clippy --all-features --workspace --tests -- --warn clippy::all --warn clippy::nursery + + tests: + name: Tests + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Run cargo test + run: cargo test diff --git a/.github/workflows/undeploy-staging.yml b/.github/workflows/undeploy-staging.yml new file mode 100644 index 0000000..f7d3186 --- /dev/null +++ b/.github/workflows/undeploy-staging.yml @@ -0,0 +1,25 @@ +name: Undeploy staging +on: + pull_request: + types: [closed] + +jobs: + cleanup-staging: + name: Cleanup staging account + runs-on: ubuntu-latest + env: + NEAR_CONTRACT_PR_STAGING_ACCOUNT_ID: gh-${{ github.event.number }}.${{ vars.NEAR_CONTRACT_STAGING_ACCOUNT_ID }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install near CLI + run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/near-cli-rs/releases/download/v0.11.1/near-cli-rs-installer.sh | sh + - name: Remove staging account + run: | + near account delete-account "${{ env.NEAR_CONTRACT_PR_STAGING_ACCOUNT_ID }}" \ + beneficiary "${{ vars.NEAR_CONTRACT_STAGING_ACCOUNT_ID }}" \ + network-config "${{ vars.NEAR_CONTRACT_STAGING_NETWORK }}" \ + sign-with-plaintext-private-key \ + --signer-public-key "${{ vars.NEAR_CONTRACT_STAGING_ACCOUNT_PUBLIC_KEY }}" \ + --signer-private-key "${{ secrets.NEAR_CONTRACT_STAGING_ACCOUNT_PRIVATE_KEY }}" \ + send diff --git a/.gitignore b/.gitignore index 0104787..ea8c4bf 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1 @@ -# Generated by Cargo -# will have compiled files and executables -debug/ -target/ - -# These are backup files generated by rustfmt -**/*.rs.bk - -# MSVC Windows builds of rustc generate these, which store debugging information -*.pdb - -# RustRover -# JetBrains specific template is maintained in a separate JetBrains.gitignore that can -# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore -# and can be added to the global gitignore or merged into this file. For a more nuclear -# option (not recommended) you can uncomment the following to ignore the entire idea folder. -#.idea/ \ No newline at end of file +/target diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..7c491b7 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,4503 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "Inflector" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" +dependencies = [ + "lazy_static", + "regex", +] + +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli 0.31.1", +] + +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if 1.0.0", + "cipher", + "cpufeatures", +] + +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "allocator-api2" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" + +[[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 = "anstyle" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" + +[[package]] +name = "anyhow" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" + +[[package]] +name = "arbitrary" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" +dependencies = [ + "derive_arbitrary", +] + +[[package]] +name = "arrayvec" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" + +[[package]] +name = "async-trait" +version = "0.1.88" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" + +[[package]] +name = "backtrace" +version = "0.3.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" +dependencies = [ + "addr2line", + "cfg-if 1.0.0", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets 0.52.6", +] + +[[package]] +name = "base64" +version = "0.21.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64ct" +version = "1.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89e25b6adfb930f02d1981565a6e5d9c547ac15a96606256d3b59040e5cd4ca3" + +[[package]] +name = "binary-install" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93bff426ff93f3610dd2b946f3eb8cb2d1285ca8682834d43be531a3f93db2ff" +dependencies = [ + "anyhow", + "dirs-next", + "flate2", + "fs2", + "hex", + "is_executable", + "siphasher 0.3.11", + "tar", + "ureq", + "zip 0.6.6", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" + +[[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 = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest", +] + +[[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 = "blst" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47c79a94619fade3c0b887670333513a67ac28a6a7e653eb260bf0d4103db38d" +dependencies = [ + "cc", + "glob", + "threadpool", + "zeroize", +] + +[[package]] +name = "bon" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97493a391b4b18ee918675fb8663e53646fd09321c58b46afa04e8ce2499c869" +dependencies = [ + "bon-macros", + "rustversion", +] + +[[package]] +name = "bon-macros" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2af3eac944c12cdf4423eab70d310da0a8e5851a18ffb192c0a5e3f7ae1663" +dependencies = [ + "darling", + "ident_case", + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "borsh" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad8646f98db542e39fc66e68a20b2144f6a732636df7c2354e74645faaa433ce" +dependencies = [ + "borsh-derive", + "cfg_aliases", +] + +[[package]] +name = "borsh-derive" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdd1d3c0c2f5833f22386f252fe8ed005c7f59fdcddeef025c01b4c3b9fd9ac3" +dependencies = [ + "once_cell", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "brownstone" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "030ea61398f34f1395ccbeb046fb68c87b631d1f34567fed0f0f11fa35d18d8d" +dependencies = [ + "arrayvec", +] + +[[package]] +name = "bs58" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" + +[[package]] +name = "bs58" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf88ba1141d185c399bee5288d850d63b8369520c1eafc32a0430b5b6c287bf4" +dependencies = [ + "tinyvec", +] + +[[package]] +name = "bumpalo" +version = "3.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + +[[package]] +name = "bytes" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" + +[[package]] +name = "bytesize" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e93abca9e28e0a1b9877922aacb20576e05d4679ffa78c3d6dc22a26a216659" +dependencies = [ + "serde", +] + +[[package]] +name = "bzip2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" +dependencies = [ + "bzip2-sys", + "libc", +] + +[[package]] +name = "bzip2-sys" +version = "0.1.13+1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225bff33b2141874fe80d71e07d6eec4f85c5c216453dd96388240f96e1acc14" +dependencies = [ + "cc", + "pkg-config", +] + +[[package]] +name = "camino" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-near-build" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1621369df7842f8fcaefab24e9f922f86ec24da22d80e3c44183c3717a885dce" +dependencies = [ + "bon", + "bs58 0.5.1", + "camino", + "cargo_metadata", + "colored", + "dunce", + "eyre", + "hex", + "humantime", + "indenter", + "libloading", + "near-abi", + "rustc_version", + "schemars", + "serde_json", + "sha2", + "symbolic-debuginfo", + "tempfile", + "tracing", + "wasm-opt", + "zstd 0.13.3", +] + +[[package]] +name = "cargo-platform" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror 1.0.69", +] + +[[package]] +name = "cc" +version = "1.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32db95edf998450acc7881c932f94cd9b05c87b4b2599e8bab064753da4acfd1" +dependencies = [ + "jobserver", + "libc", + "shlex", +] + +[[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.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + +[[package]] +name = "chrono" +version = "0.4.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "serde", + "wasm-bindgen", + "windows-link", +] + +[[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 = "clap" +version = "4.5.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed93b9805f8ba930df42c2590f05453d5ec36cbb85d018868a5b24d31f6ac000" +dependencies = [ + "clap_builder", +] + +[[package]] +name = "clap_builder" +version = "4.5.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "379026ff283facf611b0ea629334361c4211d1b12ee01024eec1591133b04120" +dependencies = [ + "anstyle", + "clap_lex", + "strsim", +] + +[[package]] +name = "clap_lex" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" + +[[package]] +name = "codespan-reporting" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe6d2e5af09e8c8ad56c969f2157a3d4238cebc7c55f0a517728c38f7b200f81" +dependencies = [ + "serde", + "termcolor", + "unicode-width", +] + +[[package]] +name = "colored" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" +dependencies = [ + "lazy_static", + "windows-sys 0.59.0", +] + +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + +[[package]] +name = "convert_case" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb4a24b1aaf0fd0ce8b45161144d6f42cd91677fd5940fd431183eb023b3a2b8" + +[[package]] +name = "core-foundation" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +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.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crunchy" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "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.101", +] + +[[package]] +name = "cxx" +version = "1.0.158" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a71ea7f29c73f7ffa64c50b83c9fe4d3a6d4be89a86b009eb80d5a6d3429d741" +dependencies = [ + "cc", + "cxxbridge-cmd", + "cxxbridge-flags", + "cxxbridge-macro", + "foldhash", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.158" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36a8232661d66dcf713394726157d3cfe0a89bfc85f52d6e9f9bbc2306797fe7" +dependencies = [ + "cc", + "codespan-reporting", + "proc-macro2", + "quote", + "scratch", + "syn 2.0.101", +] + +[[package]] +name = "cxxbridge-cmd" +version = "1.0.158" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f44296c8693e9ea226a48f6a122727f77aa9e9e338380cb021accaeeb7ee279" +dependencies = [ + "clap", + "codespan-reporting", + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.158" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c42f69c181c176981ae44ba9876e2ea41ce8e574c296b38d06925ce9214fb8e4" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.158" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8faff5d4467e0709448187df29ccbf3b0982cc426ee444a193f87b11afb565a8" +dependencies = [ + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.101", +] + +[[package]] +name = "darling" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.101", +] + +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "debugid" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6ee87af31d84ef885378aebca32be3d682b0e0dc119d5b4860a2c5bb5046730" +dependencies = [ + "uuid", +] + +[[package]] +name = "deranged" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +dependencies = [ + "powerfmt", + "serde", +] + +[[package]] +name = "derive_arbitrary" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "derive_more" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[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 = "dirs-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +dependencies = [ + "cfg-if 1.0.0", + "dirs-sys-next", +] + +[[package]] +name = "dirs-sys-next" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "dmsort" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0bc8fbe9441c17c9f46f75dfe27fa1ddb6c68a461ccaed0481419219d4f10d3" + +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + +[[package]] +name = "dyn-clone" +version = "1.0.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c7a8fb8a9fbf66c1f703fe16184d10ca0ee9d23be5b4436400408ba54a95005" + +[[package]] +name = "easy-ext" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53aff6fdc1b181225acdcb5b14c47106726fd8e486707315b1b138baed68ee31" + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" +dependencies = [ + "curve25519-dalek", + "ed25519", + "rand_core", + "sha2", + "subtle", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "elementtree" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6319c9433cf1e95c60c8533978bccf0614f27f03bb4e514253468eeeaa7fe3" +dependencies = [ + "string_cache", + "xml-rs", +] + +[[package]] +name = "encoding_rs" +version = "0.8.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "enum-map" +version = "2.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6866f3bfdf8207509a033af1a75a7b08abda06bbaaeae6669323fd5a097df2e9" +dependencies = [ + "enum-map-derive", +] + +[[package]] +name = "enum-map-derive" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" +dependencies = [ + "libc", + "windows-sys 0.59.0", +] + +[[package]] +name = "eyre" +version = "0.6.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" +dependencies = [ + "indenter", + "once_cell", +] + +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + +[[package]] +name = "fastrand" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" + +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "filetime" +version = "0.2.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "libredox", + "windows-sys 0.59.0", +] + +[[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 = "flate2" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ced92e76e966ca2fd84c8f7aa01a4aea65b0eb6648d72f7c8f3e2764a67fece" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "fluent-uri" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17c704e9dbe1ddd863da1e6ff3567795087b1eb201ce80d8fa81162e1516500d" +dependencies = [ + "bitflags 1.3.2", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + +[[package]] +name = "form_urlencoded" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "fs2" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" +dependencies = [ + "libc", + "winapi", +] + +[[package]] +name = "funty" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" + +[[package]] +name = "futures-channel" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" +dependencies = [ + "futures-core", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[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.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", +] + +[[package]] +name = "gimli" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +dependencies = [ + "fallible-iterator", + "stable_deref_trait", +] + +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + +[[package]] +name = "glob" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "goblin" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7666983ed0dd8d21a6f6576ee00053ca0926fb281a5522577a4dbd0f1b54143" +dependencies = [ + "log", + "plain", + "scroll 0.11.0", +] + +[[package]] +name = "h2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9421a676d1b147b16b82c9225157dc629087ef8ec4d5e2960f9437a90dac0a5" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http", + "indexmap 2.9.0", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3" +dependencies = [ + "allocator-api2", + "equivalent", + "foldhash", +] + +[[package]] +name = "heck" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "home" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "http" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "humantime" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b112acc8b3adf4b107a8ec20977da0273a8c386765a3ec0229bd500a1443f9f" + +[[package]] +name = "hyper" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "h2", + "http", + "http-body", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" +dependencies = [ + "futures-util", + "http", + "hyper", + "hyper-util", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497bbc33a26fdd4af9ed9c70d63f61cf56a938375fbb32df34db9b1cd6d643f2" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "libc", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "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 = "icu_collections" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" +dependencies = [ + "displaydoc", + "potential_utf", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" + +[[package]] +name = "icu_properties" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2549ca8c7241c82f59c80ba2a6f415d931c5b58d24fb8412caa1a1f02c49139a" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "potential_utf", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8197e866e47b68f8f7d95249e172903bec06004b18b2937f1095d40a0c57de04" + +[[package]] +name = "icu_provider" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" +dependencies = [ + "displaydoc", + "icu_locale_core", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indent_write" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0cfe9645a18782869361d9c8732246be7b410ad4e919d3609ebabdac00ba12c3" + +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + +[[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.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" +dependencies = [ + "equivalent", + "hashbrown 0.15.3", + "serde", +] + +[[package]] +name = "inout" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" +dependencies = [ + "generic-array", +] + +[[package]] +name = "ipnet" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" + +[[package]] +name = "is_executable" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "302d553b8abc8187beb7d663e34c065ac4570b273bc9511a50e940e99409c577" +dependencies = [ + "winapi", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "jobserver" +version = "0.1.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a" +dependencies = [ + "getrandom 0.3.3", + "libc", +] + +[[package]] +name = "joinery" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72167d68f5fce3b8655487b8038691a3c9984ee769590f93f2a631f4ad64e4f5" + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "json-patch" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b1fb8864823fad91877e6caea0baca82e49e8db50f8e5c9f9a453e27d3330fc" +dependencies = [ + "jsonptr", + "serde", + "serde_json", + "thiserror 1.0.69", +] + +[[package]] +name = "json_comments" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dbbfed4e59ba9750e15ba154fdfd9329cee16ff3df539c2666b70f58cc32105" + +[[package]] +name = "jsonptr" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c6e529149475ca0b2820835d3dce8fcc41c6b943ca608d32f35b449255e4627" +dependencies = [ + "fluent-uri", + "serde", + "serde_json", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin", +] + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.172" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" + +[[package]] +name = "libloading" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a793df0d7afeac54f95b471d3af7f0d4fb975699f972341a4b76988d49cdf0c" +dependencies = [ + "cfg-if 1.0.0", + "windows-targets 0.53.0", +] + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.9.0", + "libc", + "redox_syscall", +] + +[[package]] +name = "link-cplusplus" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a6f6da007f968f9def0d65a05b187e2960183de70c160204ecfccf0ee330212" +dependencies = [ + "cc", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" + +[[package]] +name = "linux-raw-sys" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" + +[[package]] +name = "litemap" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +dependencies = [ + "autocfg", + "scopeguard", +] + +[[package]] +name = "log" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" + +[[package]] +name = "lru" +version = "0.12.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" +dependencies = [ + "hashbrown 0.15.3", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[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.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" +dependencies = [ + "adler2", +] + +[[package]] +name = "mio" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +dependencies = [ + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.52.0", +] + +[[package]] +name = "native-tls" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" +dependencies = [ + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + +[[package]] +name = "near-abi" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c49593c9e94454a2368a4c0a511bf4bf1413aff4d23f16e1d8f4e64b5215351" +dependencies = [ + "borsh", + "schemars", + "semver", + "serde", +] + +[[package]] +name = "near-abi-client" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879ac02b2e8d6498294adce1de7a2424a5474b35a73e9262c851be39c89d7f92" +dependencies = [ + "anyhow", + "convert_case", + "near-abi-client-impl", + "near-abi-client-macros", + "prettyplease", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "near-abi-client-impl" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1139e8a6f60fd8ed1c53c700b67bcecbf6deb4b1f47bbe9a9d5eea760d8a8e91" +dependencies = [ + "anyhow", + "near-abi", + "near_schemafy_lib", + "proc-macro2", + "quote", + "schemars", + "serde_json", +] + +[[package]] +name = "near-abi-client-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebaf2aae80086b310bf96e657bbee0c599c3452afd35e72999f8d6764d6b1899" +dependencies = [ + "near-abi-client-impl", + "syn 1.0.109", +] + +[[package]] +name = "near-account-id" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ed69d94899cfdfba16182bd681ad9e6b7f888e29532b04c56da9ae05a4c5bc4" +dependencies = [ + "borsh", + "serde", +] + +[[package]] +name = "near-chain-configs" +version = "0.29.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82d98e77d25ba905d16e91179a33e215da3226d62fadf73c471ef88a9b9d58c2" +dependencies = [ + "anyhow", + "bytesize", + "chrono", + "derive_more", + "near-config-utils", + "near-crypto", + "near-parameters", + "near-primitives", + "near-time", + "num-rational", + "serde", + "serde_json", + "sha2", + "smart-default", + "time", + "tracing", +] + +[[package]] +name = "near-config-utils" +version = "0.29.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b992cca8d3b00f34b37f638c9632a97b734656151294e7a29b60b93b8a92948" +dependencies = [ + "anyhow", + "json_comments", + "thiserror 2.0.12", + "tracing", +] + +[[package]] +name = "near-crypto" +version = "0.29.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "938773caf4ce15aa435d422fd5823e5302a260c93dbd070281eecae74f1a2559" +dependencies = [ + "blake2", + "borsh", + "bs58 0.4.0", + "curve25519-dalek", + "derive_more", + "ed25519-dalek", + "hex", + "near-account-id", + "near-config-utils", + "near-schema-checker-lib", + "near-stdx", + "primitive-types", + "rand", + "secp256k1", + "serde", + "serde_json", + "subtle", + "thiserror 2.0.12", +] + +[[package]] +name = "near-fmt" +version = "0.29.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0599477a38b5596c283212d4db8eb11c6cc33fb43d02002db9cd3f141ba735f1" +dependencies = [ + "near-primitives-core", +] + +[[package]] +name = "near-gas" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180edcc7dc2fac41f93570d0c7b759c1b6d492f6ad093d749d644a40b4310a97" +dependencies = [ + "borsh", + "schemars", + "serde", +] + +[[package]] +name = "near-jsonrpc-client" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "752aa5d0080f6c3bad8ba349046069a406e7536ab101d6cfc7db3e157144b921" +dependencies = [ + "borsh", + "lazy_static", + "log", + "near-chain-configs", + "near-crypto", + "near-jsonrpc-primitives", + "near-primitives", + "reqwest", + "serde", + "serde_json", + "thiserror 2.0.12", +] + +[[package]] +name = "near-jsonrpc-primitives" +version = "0.29.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f003113d08e1f0ab9e6335efb1f7167662954804274653904ef57a9b5f8e687" +dependencies = [ + "arbitrary", + "near-chain-configs", + "near-crypto", + "near-primitives", + "near-schema-checker-lib", + "serde", + "serde_json", + "thiserror 2.0.12", + "time", +] + +[[package]] +name = "near-parameters" +version = "0.29.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbfe696b28e2406001d4d5be14414a32c91f9c7202ae631367a6b22288ccad8d" +dependencies = [ + "borsh", + "enum-map", + "near-account-id", + "near-primitives-core", + "near-schema-checker-lib", + "num-rational", + "serde", + "serde_repr", + "serde_yaml", + "strum 0.24.1", + "thiserror 2.0.12", +] + +[[package]] +name = "near-primitives" +version = "0.29.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd5009712faf116cdadda4c1636daf04f0f53a5537555f38ded2736f2d9e0cac" +dependencies = [ + "arbitrary", + "base64 0.21.7", + "bitvec", + "borsh", + "bytes", + "bytesize", + "cfg-if 1.0.0", + "chrono", + "derive_more", + "easy-ext", + "enum-map", + "hex", + "itertools", + "near-crypto", + "near-fmt", + "near-parameters", + "near-primitives-core", + "near-schema-checker-lib", + "near-stdx", + "near-time", + "num-rational", + "ordered-float", + "primitive-types", + "rand", + "rand_chacha", + "serde", + "serde_json", + "serde_with", + "sha3", + "smart-default", + "strum 0.24.1", + "thiserror 2.0.12", + "tracing", + "zstd 0.13.3", +] + +[[package]] +name = "near-primitives-core" +version = "0.29.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "afc441b97a25a22b2344944962dba34bea9bfc732c6ce3a23728593e82166ae6" +dependencies = [ + "arbitrary", + "base64 0.21.7", + "borsh", + "bs58 0.4.0", + "derive_more", + "enum-map", + "near-account-id", + "near-schema-checker-lib", + "num-rational", + "serde", + "serde_repr", + "sha2", + "thiserror 2.0.12", +] + +[[package]] +name = "near-sandbox-utils" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65921a949220d53f4e346694f7ecae018320003d88582d4bbe45da26c5c35aa7" +dependencies = [ + "anyhow", + "binary-install", + "fs2", + "home", + "tokio", +] + +[[package]] +name = "near-schema-checker-core" +version = "0.29.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00d54cd2888814fc2398316ec6d870754d7dd08704233bda770a75360afc8a7b" + +[[package]] +name = "near-schema-checker-lib" +version = "0.29.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "311745157f685c26e05ca8532efbfcc09f63ab9fc7d94b824b2c75946ef37197" +dependencies = [ + "near-schema-checker-core", + "near-schema-checker-macro", +] + +[[package]] +name = "near-schema-checker-macro" +version = "0.29.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "515c63689e1e7940ac34629ad9d16ba8fd6bea58ad8ddbd4acf705d6149f3c77" + +[[package]] +name = "near-sdk" +version = "5.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad9bb847fb4458b00b64e28c4a7adac5d0658603d988c4b4d12eb18104767b80" +dependencies = [ + "base64 0.22.1", + "borsh", + "bs58 0.5.1", + "near-account-id", + "near-crypto", + "near-gas", + "near-parameters", + "near-primitives", + "near-primitives-core", + "near-sdk-macros", + "near-sys", + "near-token", + "near-vm-runner", + "once_cell", + "serde", + "serde_json", + "wee_alloc", +] + +[[package]] +name = "near-sdk-macros" +version = "5.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0562cf707a41f2f71976f2baa48989369175a96e75b65a4297c815f49327bde" +dependencies = [ + "Inflector", + "darling", + "proc-macro2", + "quote", + "serde", + "serde_json", + "strum 0.26.3", + "strum_macros 0.26.4", + "syn 2.0.101", +] + +[[package]] +name = "near-stdx" +version = "0.29.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf9306662fe8ced267a85aa1d3fc9205f1968d88b9ddbb9a03c657da8457533" + +[[package]] +name = "near-sys" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ee6acd2229cde1f13daabca434022900ab371d2c19de6be6a5a0497dc942ef7" + +[[package]] +name = "near-time" +version = "0.29.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40a8ffbee0028f08220c46d864d81ac780f2805ab3156b044ee04a927005a84f" +dependencies = [ + "serde", + "time", +] + +[[package]] +name = "near-token" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd3e60aa26a74dc514b1b6408fdd06cefe2eb0ff029020956c1c6517594048fd" +dependencies = [ + "borsh", + "serde", +] + +[[package]] +name = "near-vm-runner" +version = "0.29.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fca3f18ed6a87b334b93b53e4c2c98cf185fd1fde5a4b538980508fb7e51b147" +dependencies = [ + "blst", + "borsh", + "bytesize", + "ed25519-dalek", + "enum-map", + "lru", + "near-crypto", + "near-parameters", + "near-primitives-core", + "near-schema-checker-lib", + "near-stdx", + "num-rational", + "rayon", + "ripemd", + "rustix 0.38.44", + "serde", + "serde_repr", + "sha2", + "sha3", + "strum 0.24.1", + "tempfile", + "thiserror 2.0.12", + "tracing", + "zeropool-bn", +] + +[[package]] +name = "near-workspaces" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c43e44fc77e3491076daaec62c9be3a1b4d63c299702569b5eca3dd2057f8330" +dependencies = [ + "async-trait", + "base64 0.22.1", + "bs58 0.5.1", + "cargo-near-build", + "chrono", + "fs2", + "json-patch", + "libc", + "near-abi-client", + "near-account-id", + "near-crypto", + "near-gas", + "near-jsonrpc-client", + "near-jsonrpc-primitives", + "near-primitives", + "near-sandbox-utils", + "near-token", + "rand", + "reqwest", + "serde", + "serde_json", + "sha2", + "tempfile", + "thiserror 1.0.69", + "tokio", + "tokio-retry", + "tracing", + "url", +] + +[[package]] +name = "near_schemafy_core" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42d7a1f809a319578773329389529dbf8c8f0abfbb05a429b37f437105f7caf6" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "near_schemafy_lib" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39ccae55df51adaa1a4e567b7a79ab4380826a695121cebf41f518076d8c3dd" +dependencies = [ + "Inflector", + "near_schemafy_core", + "proc-macro2", + "quote", + "serde", + "serde_derive", + "serde_json", + "syn 1.0.109", + "uriparse", +] + +[[package]] +name = "new_debug_unreachable" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" + +[[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 = "nom-supreme" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aadc66631948f6b65da03be4c4cd8bd104d481697ecbb9bbd65719b1ec60bc9f" +dependencies = [ + "brownstone", + "indent_write", + "joinery", + "memchr", + "nom", +] + +[[package]] +name = "num-bigint" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" +dependencies = [ + "autocfg", + "num-bigint", + "num-integer", + "num-traits", + "serde", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +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 = "object" +version = "0.36.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +dependencies = [ + "memchr", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "openssl" +version = "0.10.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fedfea7d58a1f73118430a55da6a286e7b044961736ce96a16a17068ea25e5da" +dependencies = [ + "bitflags 2.9.0", + "cfg-if 1.0.0", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "openssl-probe" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" + +[[package]] +name = "openssl-sys" +version = "0.9.108" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e145e1651e858e820e4860f7b9c5e169bc1d8ce1c86043be79fa7b7634821847" +dependencies = [ + "cc", + "libc", + "pkg-config", + "vcpkg", +] + +[[package]] +name = "ordered-float" +version = "4.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bb71e1b3fa6ca1c61f383464aaf2bb0e2f8e772a1f01d486832464de363b951" +dependencies = [ + "borsh", + "num-traits", + "rand", + "serde", +] + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" +dependencies = [ + "lock_api", + "parking_lot_core", +] + +[[package]] +name = "parking_lot_core" +version = "0.9.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "redox_syscall", + "smallvec", + "windows-targets 0.52.6", +] + +[[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 = "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 = "pdb" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13f4d162ecaaa1467de5afbe62d597757b674b51da8bb4e587430c5fdb2af7aa" +dependencies = [ + "fallible-iterator", + "scroll 0.10.2", + "uuid", +] + +[[package]] +name = "percent-encoding" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "phf_shared" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" +dependencies = [ + "siphasher 1.0.1", +] + +[[package]] +name = "pin-project" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" + +[[package]] +name = "plain" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" + +[[package]] +name = "potential_utf" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +dependencies = [ + "zerovec", +] + +[[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.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "precomputed-hash" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" + +[[package]] +name = "prettyplease" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" +dependencies = [ + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "primitive-types" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05e4722c697a58a99d5d06a08c30821d7c082a4632198de1eaa5a6c22ef42373" +dependencies = [ + "fixed-hash", + "uint", +] + +[[package]] +name = "proc-macro-crate" +version = "3.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" +dependencies = [ + "toml_edit", +] + +[[package]] +name = "proc-macro2" +version = "1.0.95" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + +[[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", + "serde", +] + +[[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 0.2.16", + "serde", +] + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +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 = "redox_syscall" +version = "0.5.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928fca9cf2aa042393a8325b9ead81d2f0df4cb12e1e24cef072922ccd99c5af" +dependencies = [ + "bitflags 2.9.0", +] + +[[package]] +name = "redox_users" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +dependencies = [ + "getrandom 0.2.16", + "libredox", + "thiserror 1.0.69", +] + +[[package]] +name = "regex" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" + +[[package]] +name = "reqwest" +version = "0.12.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d19c46a6fdd48bc4dab94b6103fccc55d34c67cc0ad04653aad4ea2a07cd7bbb" +dependencies = [ + "base64 0.22.1", + "bytes", + "encoding_rs", + "futures-core", + "futures-util", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-rustls", + "hyper-tls", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "system-configuration", + "tokio", + "tokio-native-tls", + "tower", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows-registry", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if 1.0.0", + "getrandom 0.2.16", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "ripemd" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" +dependencies = [ + "digest", +] + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hex" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "0.38.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" +dependencies = [ + "bitflags 2.9.0", + "errno", + "libc", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +dependencies = [ + "bitflags 2.9.0", + "errno", + "libc", + "linux-raw-sys 0.9.4", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustls" +version = "0.23.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "730944ca083c1c233a75c09f199e973ca499344a2b7ba9e755c457e86fb4a321" +dependencies = [ + "log", + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-pemfile" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" +dependencies = [ + "zeroize", +] + +[[package]] +name = "rustls-webpki" +version = "0.103.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4a72fe2bcf7a6ac6fd7d0b9e5cb68aeb7d4c0a0271730218b3e92d43b4eb435" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "schannel" +version = "0.1.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" +dependencies = [ + "windows-sys 0.59.0", +] + +[[package]] +name = "schemars" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" +dependencies = [ + "dyn-clone", + "schemars_derive", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 2.0.101", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + +[[package]] +name = "scratch" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f6280af86e5f559536da57a45ebc84948833b3bee313a7dd25232e09c878a52" + +[[package]] +name = "scroll" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fda28d4b4830b807a8b43f7b0e6b5df875311b3e7621d84577188c175b6ec1ec" + +[[package]] +name = "scroll" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04c565b551bafbef4157586fa379538366e4385d42082f255bfd96e4fe8519da" +dependencies = [ + "scroll_derive", +] + +[[package]] +name = "scroll_derive" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "secp256k1" +version = "0.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" +dependencies = [ + "rand", + "secp256k1-sys", +] + +[[package]] +name = "secp256k1-sys" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70a129b9e9efbfb223753b9163c4ab3b13cff7fd9c7f010fbac25ab4099fa07e" +dependencies = [ + "cc", +] + +[[package]] +name = "security-framework" +version = "2.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" +dependencies = [ + "bitflags 2.9.0", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" +dependencies = [ + "serde", +] + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "serde_derive_internals" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "serde_json" +version = "1.0.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "serde_urlencoded" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" +dependencies = [ + "form_urlencoded", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6b6f7f2fcb69f747921f79f3926bd1e203fce4fef62c268dd3abfb6d86029aa" +dependencies = [ + "base64 0.22.1", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.9.0", + "serde", + "serde_derive", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d00caa5193a3c8362ac2b73be6b9e768aa5a4b2f721d8f4b339600c3cb51f8e" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "serde_yaml" +version = "0.9.34+deprecated" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" +dependencies = [ + "indexmap 2.9.0", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + +[[package]] +name = "sha1" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +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 = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" +dependencies = [ + "libc", +] + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "siphasher" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" + +[[package]] +name = "slab" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" +dependencies = [ + "autocfg", +] + +[[package]] +name = "smallvec" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" + +[[package]] +name = "smart-default" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eb01866308440fc64d6c44d9e86c5cc17adfe33c4d6eed55da9145044d0ffc1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "socket2" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f5fd57c80058a56cf5c777ab8a126398ece8e442983605d280a44ce79d0edef" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "string_cache" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf776ba3fa74f83bf4b63c3dcbbf82173db2632ed8452cb2d891d33f459de70f" +dependencies = [ + "new_debug_unreachable", + "parking_lot", + "phf_shared", + "precomputed-hash", + "serde", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +dependencies = [ + "strum_macros 0.24.3", +] + +[[package]] +name = "strum" +version = "0.26.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.109", +] + +[[package]] +name = "strum_macros" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.101", +] + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "symbolic-common" +version = "8.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f551f902d5642e58039aee6a9021a61037926af96e071816361644983966f540" +dependencies = [ + "debugid", + "memmap2", + "stable_deref_trait", + "uuid", +] + +[[package]] +name = "symbolic-debuginfo" +version = "8.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1165dabf9fc1d6bb6819c2c0e27c8dd0e3068d2c53cf186d319788e96517f0d6" +dependencies = [ + "bitvec", + "dmsort", + "elementtree", + "fallible-iterator", + "flate2", + "gimli 0.26.2", + "goblin", + "lazy_static", + "lazycell", + "nom", + "nom-supreme", + "parking_lot", + "pdb", + "regex", + "scroll 0.11.0", + "serde", + "serde_json", + "smallvec", + "symbolic-common", + "thiserror 1.0.69", + "wasmparser", + "zip 0.5.13", +] + +[[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.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" +dependencies = [ + "futures-core", +] + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "system-configuration" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +dependencies = [ + "bitflags 2.9.0", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "tar" +version = "0.4.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d863878d212c87a19c1a610eb53bb01fe12951c0501cf5a0d65f724914a667a" +dependencies = [ + "filetime", + "libc", + "xattr", +] + +[[package]] +name = "tempfile" +version = "3.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" +dependencies = [ + "fastrand", + "getrandom 0.3.3", + "once_cell", + "rustix 1.0.7", + "windows-sys 0.59.0", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl 1.0.69", +] + +[[package]] +name = "thiserror" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" +dependencies = [ + "thiserror-impl 2.0.12", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "thiserror-impl" +version = "2.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + +[[package]] +name = "time" +version = "0.3.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" + +[[package]] +name = "time-macros" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tinyvec" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" +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.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2513ca694ef9ede0fb23fe71a4ee4107cb102b9dc1930f6d0fd77aae068ae165" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.52.0", +] + +[[package]] +name = "tokio-macros" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "tokio-native-tls" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +dependencies = [ + "native-tls", + "tokio", +] + +[[package]] +name = "tokio-retry" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f57eb36ecbe0fc510036adff84824dd3c24bb781e21bfa67b69d556aa85214f" +dependencies = [ + "pin-project", + "rand", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "toml_datetime" +version = "0.6.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3da5db5a963e24bc68be8b17b6fa82814bb22ee8660f192bb182771d498f09a3" + +[[package]] +name = "toml_edit" +version = "0.22.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "310068873db2c5b3e7659d2cc35d21855dbafa50d1ce336397c666e3cb08137e" +dependencies = [ + "indexmap 2.9.0", + "toml_datetime", + "winnow", +] + +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper", + "tokio", + "tower-layer", + "tower-service", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "tracing-core" +version = "0.1.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +dependencies = [ + "once_cell", +] + +[[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.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[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.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "unicode-width" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" + +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "ureq" +version = "2.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" +dependencies = [ + "base64 0.22.1", + "flate2", + "log", + "once_cell", + "rustls", + "rustls-pki-types", + "url", + "webpki-roots 0.26.11", +] + +[[package]] +name = "uriparse" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0200d0fc04d809396c2ad43f3c95da3582a2556eba8d453c1087f4120ee352ff" +dependencies = [ + "fnv", + "lazy_static", +] + +[[package]] +name = "url" +version = "2.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "uuid" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" + +[[package]] +name = "validator-voting" +version = "0.1.0" +dependencies = [ + "near-sdk", + "near-workspaces", + "serde_json", + "tokio", +] + +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[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 = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if 1.0.0", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn 2.0.101", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-futures" +version = "0.4.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" +dependencies = [ + "cfg-if 1.0.0", + "js-sys", + "once_cell", + "wasm-bindgen", + "web-sys", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-opt" +version = "0.116.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd87a4c135535ffed86123b6fb0f0a5a0bc89e50416c942c5f0662c645f679c" +dependencies = [ + "anyhow", + "libc", + "strum 0.24.1", + "strum_macros 0.24.3", + "tempfile", + "thiserror 1.0.69", + "wasm-opt-cxx-sys", + "wasm-opt-sys", +] + +[[package]] +name = "wasm-opt-cxx-sys" +version = "0.116.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c57b28207aa724318fcec6575fe74803c23f6f266fce10cbc9f3f116762f12e" +dependencies = [ + "anyhow", + "cxx", + "cxx-build", + "wasm-opt-sys", +] + +[[package]] +name = "wasm-opt-sys" +version = "0.116.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a1cce564dc768dacbdb718fc29df2dba80bd21cb47d8f77ae7e3d95ceb98cbe" +dependencies = [ + "anyhow", + "cc", + "cxx", + "cxx-build", +] + +[[package]] +name = "wasmparser" +version = "0.83.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "718ed7c55c2add6548cca3ddd6383d738cd73b892df400e96b9aa876f0141d7a" + +[[package]] +name = "web-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "webpki-roots" +version = "0.26.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" +dependencies = [ + "webpki-roots 1.0.0", +] + +[[package]] +name = "webpki-roots" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2853738d1cc4f2da3a225c18ec6c3721abb31961096e9dbf5ab35fa88b19cfdb" +dependencies = [ + "rustls-pki-types", +] + +[[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-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" +dependencies = [ + "windows-sys 0.59.0", +] + +[[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.61.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings 0.4.0", +] + +[[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "windows-link" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" + +[[package]] +name = "windows-registry" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3" +dependencies = [ + "windows-result", + "windows-strings 0.3.1", + "windows-targets 0.53.0", +] + +[[package]] +name = "windows-result" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2ba9642430ee452d5a7aa78d72907ebe8cfda358e8cb7918a2050581322f97" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", +] + +[[package]] +name = "windows-targets" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + +[[package]] +name = "winnow" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06928c8748d81b05c9be96aad92e1b6ff01833332f281e8cfca3be4b35fc9ec" +dependencies = [ + "memchr", +] + +[[package]] +name = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags 2.9.0", +] + +[[package]] +name = "writeable" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" + +[[package]] +name = "wyz" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" +dependencies = [ + "tap", +] + +[[package]] +name = "xattr" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d65cbf2f12c15564212d48f4e3dfb87923d25d611f2aed18f4cb23f0413d89e" +dependencies = [ + "libc", + "rustix 1.0.7", +] + +[[package]] +name = "xml-rs" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a62ce76d9b56901b19a74f19431b0d8b3bc7ca4ad685a746dfd78ca8f4fc6bda" + +[[package]] +name = "yoke" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "zerofrom" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +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.101", +] + +[[package]] +name = "zeropool-bn" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e61de68ede9ffdd69c01664f65a178c5188b73f78faa21f0936016a888ff7c" +dependencies = [ + "byteorder", + "crunchy", + "lazy_static", + "rand", + "rustc-hex", +] + +[[package]] +name = "zerotrie" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "zip" +version = "0.5.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93ab48844d61251bb3835145c521d88aa4031d7139e8485990f60ca911fa0815" +dependencies = [ + "byteorder", + "crc32fast", + "flate2", + "thiserror 1.0.69", +] + +[[package]] +name = "zip" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" +dependencies = [ + "aes", + "byteorder", + "bzip2", + "constant_time_eq", + "crc32fast", + "crossbeam-utils", + "flate2", + "hmac", + "pbkdf2", + "sha1", + "time", + "zstd 0.11.2+zstd.1.5.2", +] + +[[package]] +name = "zstd" +version = "0.11.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" +dependencies = [ + "zstd-safe 5.0.2+zstd.1.5.2", +] + +[[package]] +name = "zstd" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" +dependencies = [ + "zstd-safe 7.2.4", +] + +[[package]] +name = "zstd-safe" +version = "5.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-safe" +version = "7.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d" +dependencies = [ + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.15+zstd.1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb81183ddd97d0c74cedf1d50d85c8d08c1b8b68ee863bdee9e706eedba1a237" +dependencies = [ + "cc", + "pkg-config", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..c176431 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,55 @@ +[package] +name = "validator-voting" +description = "NEAR Validator Voting Contract" +version = "0.1.0" +edition = "2021" +# TODO: Fill out the repository field to help NEAR ecosystem tools to discover your project. +# NEP-0330 is automatically implemented for all contracts built with https://github.com/near/cargo-near. +# Link to the repository will be available via `contract_source_metadata` view-function. +repository = "https://github.com//" + +[lib] +crate-type = ["cdylib", "rlib"] + +# fields to configure build with WASM reproducibility, according to specs +# in https://github.com/near/NEPs/blob/master/neps/nep-0330.md +[package.metadata.near.reproducible_build] +# docker image, descriptor of build environment +image = "sourcescan/cargo-near:0.14.1-rust-1.86.0" +# tag after colon above serves only descriptive purpose; image is identified by digest +image_digest = "sha256:eaac91be3119cc7c136b6f375f2d3e092001f717ed6151ccc9d5348c2d6a640c" +# list of environment variables names, whose values, if set, will be used as external build parameters +# in a reproducible manner +# supported by `sourcescan/cargo-near:0.10.1-rust-1.82.0` image or later images +passed_env = [] +# build command inside of docker container +# if docker image from default gallery is used https://hub.docker.com/r/sourcescan/cargo-near/tags, +# the command may be any combination of flags of `cargo-near`, +# supported by respective version of binary inside the container besides `--no-locked` flag +container_build_command = [ + "cargo", + "near", + "build", + "non-reproducible-wasm", + "--locked", +] + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[dependencies] +near-sdk = "5.12.0" + +[dev-dependencies] +near-sdk = { version = "5.12.0", features = ["unit-testing"] } +near-workspaces = { version = "0.18", features = ["unstable"] } +tokio = { version = "1.12.0", features = ["full"] } +serde_json = "1" + +[profile.release] +codegen-units = 1 +# Tell `rustc` to optimize for small code size. +opt-level = "z" +lto = true +debug = false +panic = "abort" +# Opt into extra safety checks on arithmetic operations https://stackoverflow.com/a/64136471/249801 +overflow-checks = true diff --git a/README.md b/README.md index 2899d07..725caf6 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,32 @@ -# validator-voting-contract -NEAR Validator Voting Contract +# NEAR Validator Voting + +The purpose of this contract is for validators to vote on any specific proposal. Validators can call `vote` function to vote for yes or no with the staked amount on the validator. If there are more than 2/3 of the stake at any given moment voting for yes, the voting is done. After the voting is finished, no one can further modify the contract. The voting contract is recommended to be pinged every epoch to make sure the latest stake is updated in the contract. + +## Build + +Install [`cargo-near`](https://github.com/near/cargo-near) and run: + +```bash +cargo near build +``` + +## Test + +```bash +cargo test +``` + +## Deploy + +Deployment is automated with GitHub Actions CI/CD pipeline. +To deploy manually, install [`cargo-near`](https://github.com/near/cargo-near) and run: + +```bash +cargo near deploy build-reproducible-wasm +``` + +## Tools + +- [cargo-near](https://github.com/near/cargo-near) - NEAR smart contract development toolkit for Rust +- [near CLI](https://near.cli.rs) - Interact with NEAR blockchain from command line +- [NEAR Rust SDK Documentation](https://docs.near.org/sdk/rust/introduction) diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..a82ade3 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,4 @@ +[toolchain] +channel = "stable" +components = ["rustfmt"] +targets = ["wasm32-unknown-unknown"] diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 0000000..af8a6b3 --- /dev/null +++ b/src/lib.rs @@ -0,0 +1,55 @@ +// Find all our documentation at https://docs.near.org +use near_sdk::{log, near}; + +// Define the contract structure +#[near(contract_state)] +pub struct Contract { + greeting: String, +} + +// Define the default, which automatically initializes the contract +impl Default for Contract { + fn default() -> Self { + Self { + greeting: "Hello".to_string(), + } + } +} + +// Implement the contract structure +#[near] +impl Contract { + // Public method - returns the greeting saved, defaulting to DEFAULT_GREETING + pub fn get_greeting(&self) -> String { + self.greeting.clone() + } + + // Public method - accepts a greeting, such as "howdy", and records it + pub fn set_greeting(&mut self, greeting: String) { + log!("Saving greeting: {greeting}"); + self.greeting = greeting; + } +} + +/* + * The rest of this file holds the inline tests for the code above + * Learn more about Rust tests: https://doc.rust-lang.org/book/ch11-01-writing-tests.html + */ +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn get_default_greeting() { + let contract = Contract::default(); + // this test did not call set_greeting so should return the default "Hello" greeting + assert_eq!(contract.get_greeting(), "Hello"); + } + + #[test] + fn set_then_get_greeting() { + let mut contract = Contract::default(); + contract.set_greeting("howdy".to_string()); + assert_eq!(contract.get_greeting(), "howdy"); + } +} diff --git a/src/voting.rs b/src/voting.rs new file mode 100644 index 0000000..f79ad09 --- /dev/null +++ b/src/voting.rs @@ -0,0 +1,360 @@ +use near_sdk::borsh::{self, BorshDeserialize, BorshSerialize}; +use near_sdk::json_types::{U128, U64}; +use near_sdk::{env, near_bindgen, AccountId, Balance, EpochHeight}; +use std::collections::HashMap; + +#[global_allocator] +static ALLOC: near_sdk::wee_alloc::WeeAlloc = near_sdk::wee_alloc::WeeAlloc::INIT; + +type WrappedTimestamp = U64; + +/// Voting contract for unlocking transfers. Once the majority of the stake holders agree to +/// unlock transfer, the time will be recorded and the voting ends. +#[near_bindgen] +#[derive(BorshDeserialize, BorshSerialize)] +pub struct VotingContract { + /// How much each validator votes + votes: HashMap, + /// Total voted balance so far. + total_voted_stake: Balance, + /// When the voting ended. `None` means the poll is still open. + result: Option, + /// Epoch height when the contract is touched last time. + last_epoch_height: EpochHeight, +} + +impl Default for VotingContract { + fn default() -> Self { + env::panic(b"Voting contract should be initialized before usage") + } +} + +#[near_bindgen] +impl VotingContract { + #[init] + pub fn new() -> Self { + assert!(!env::state_exists(), "The contract is already initialized"); + VotingContract { + votes: HashMap::new(), + total_voted_stake: 0, + result: None, + last_epoch_height: 0, + } + } + + /// Ping to update the votes according to current stake of validators. + pub fn ping(&mut self) { + assert!(self.result.is_none(), "Voting has already ended"); + let cur_epoch_height = env::epoch_height(); + if cur_epoch_height != self.last_epoch_height { + let votes = std::mem::take(&mut self.votes); + self.total_voted_stake = 0; + for (account_id, _) in votes { + let account_current_stake = env::validator_stake(&account_id); + self.total_voted_stake += account_current_stake; + if account_current_stake > 0 { + self.votes.insert(account_id, account_current_stake); + } + } + self.check_result(); + self.last_epoch_height = cur_epoch_height; + } + } + + /// Check whether the voting has ended. + fn check_result(&mut self) { + assert!( + self.result.is_none(), + "check result is called after result is already set" + ); + let total_stake = env::validator_total_stake(); + if self.total_voted_stake > 2 * total_stake / 3 { + self.result = Some(U64::from(env::block_timestamp())); + } + } + + /// Method for validators to vote or withdraw the vote. + /// Votes for if `is_vote` is true, or withdraws the vote if `is_vote` is false. + pub fn vote(&mut self, is_vote: bool) { + self.ping(); + if self.result.is_some() { + return; + } + let account_id = env::predecessor_account_id(); + let account_stake = if is_vote { + let stake = env::validator_stake(&account_id); + assert!(stake > 0, "{} is not a validator", account_id); + stake + } else { + 0 + }; + let voted_stake = self.votes.remove(&account_id).unwrap_or_default(); + assert!( + voted_stake <= self.total_voted_stake, + "invariant: voted stake {} is more than total voted stake {}", + voted_stake, + self.total_voted_stake + ); + self.total_voted_stake = self.total_voted_stake + account_stake - voted_stake; + if account_stake > 0 { + self.votes.insert(account_id, account_stake); + self.check_result(); + } + } + + /// Get the timestamp of when the voting finishes. `None` means the voting hasn't ended yet. + pub fn get_result(&self) -> Option { + self.result.clone() + } + + /// Returns current a pair of `total_voted_stake` and the total stake. + /// Note: as a view method, it doesn't recompute the active stake. May need to call `ping` to + /// update the active stake. + pub fn get_total_voted_stake(&self) -> (U128, U128) { + ( + self.total_voted_stake.into(), + env::validator_total_stake().into(), + ) + } + + /// Returns all active votes. + /// Note: as a view method, it doesn't recompute the active stake. May need to call `ping` to + /// update the active stake. + pub fn get_votes(&self) -> HashMap { + self.votes + .iter() + .map(|(account_id, stake)| (account_id.clone(), (*stake).into())) + .collect() + } +} + +#[cfg(not(target_arch = "wasm32"))] +#[cfg(test)] +mod tests { + use super::*; + use near_sdk::MockedBlockchain; + use near_sdk::{testing_env, VMContext}; + use std::collections::HashMap; + use std::iter::FromIterator; + + fn get_context(predecessor_account_id: AccountId) -> VMContext { + get_context_with_epoch_height(predecessor_account_id, 0) + } + + fn get_context_with_epoch_height( + predecessor_account_id: AccountId, + epoch_height: EpochHeight, + ) -> VMContext { + VMContext { + current_account_id: "alice_near".to_string(), + signer_account_id: "bob_near".to_string(), + signer_account_pk: vec![0, 1, 2], + predecessor_account_id, + input: vec![], + block_index: 0, + block_timestamp: 0, + account_balance: 0, + account_locked_balance: 0, + storage_usage: 1000, + attached_deposit: 0, + prepaid_gas: 2 * 10u64.pow(14), + random_seed: vec![0, 1, 2], + is_view: false, + output_data_receivers: vec![], + epoch_height, + } + } + + #[test] + #[should_panic(expected = "is not a validator")] + fn test_nonvalidator_cannot_vote() { + let context = get_context("bob.near".to_string()); + let validators = HashMap::from_iter( + vec![ + ("alice_near".to_string(), 100), + ("bob_near".to_string(), 100), + ] + .into_iter(), + ); + testing_env!(context, Default::default(), Default::default(), validators); + let mut contract = VotingContract::new(); + contract.vote(true); + } + + #[test] + #[should_panic(expected = "Voting has already ended")] + fn test_vote_again_after_voting_ends() { + let context = get_context("alice.near".to_string()); + let validators = HashMap::from_iter(vec![("alice.near".to_string(), 100)].into_iter()); + testing_env!(context, Default::default(), Default::default(), validators); + let mut contract = VotingContract::new(); + contract.vote(true); + assert!(contract.result.is_some()); + contract.vote(true); + } + + #[test] + fn test_voting_simple() { + let context = get_context("test0".to_string()); + let validators = (0..10) + .map(|i| (format!("test{}", i), 10)) + .collect::>(); + testing_env!( + context, + Default::default(), + Default::default(), + validators.clone() + ); + let mut contract = VotingContract::new(); + + for i in 0..7 { + let mut context = get_context(format!("test{}", i)); + testing_env!( + context.clone(), + Default::default(), + Default::default(), + validators.clone() + ); + contract.vote(true); + context.is_view = true; + testing_env!( + context, + Default::default(), + Default::default(), + validators.clone() + ); + assert_eq!( + contract.get_total_voted_stake(), + (U128::from(10 * (i + 1)), U128::from(100)) + ); + assert_eq!( + contract.get_votes(), + (0..=i) + .map(|i| (format!("test{}", i), U128::from(10))) + .collect::>() + ); + assert_eq!(contract.votes.len() as u128, i + 1); + if i < 6 { + assert!(contract.result.is_none()); + } else { + assert!(contract.result.is_some()); + } + } + } + + #[test] + fn test_voting_with_epoch_change() { + let validators = (0..10) + .map(|i| (format!("test{}", i), 10)) + .collect::>(); + let context = get_context("test0".to_string()); + testing_env!( + context, + Default::default(), + Default::default(), + validators.clone() + ); + let mut contract = VotingContract::new(); + + for i in 0..7 { + let context = get_context_with_epoch_height(format!("test{}", i), i); + testing_env!( + context, + Default::default(), + Default::default(), + validators.clone() + ); + contract.vote(true); + assert_eq!(contract.votes.len() as u64, i + 1); + if i < 6 { + assert!(contract.result.is_none()); + } else { + assert!(contract.result.is_some()); + } + } + } + + #[test] + fn test_validator_stake_change() { + let mut validators = HashMap::from_iter(vec![ + ("test1".to_string(), 40), + ("test2".to_string(), 10), + ("test3".to_string(), 10), + ]); + let context = get_context_with_epoch_height("test1".to_string(), 1); + testing_env!( + context, + Default::default(), + Default::default(), + validators.clone() + ); + + let mut contract = VotingContract::new(); + contract.vote(true); + validators.insert("test1".to_string(), 50); + let context = get_context_with_epoch_height("test2".to_string(), 2); + testing_env!( + context, + Default::default(), + Default::default(), + validators.clone() + ); + contract.ping(); + assert!(contract.result.is_some()); + } + + #[test] + fn test_withdraw_votes() { + let validators = + HashMap::from_iter(vec![("test1".to_string(), 10), ("test2".to_string(), 10)]); + let context = get_context_with_epoch_height("test1".to_string(), 1); + testing_env!( + context, + Default::default(), + Default::default(), + validators.clone() + ); + let mut contract = VotingContract::new(); + contract.vote(true); + assert_eq!(contract.votes.len(), 1); + let context = get_context_with_epoch_height("test1".to_string(), 2); + testing_env!( + context, + Default::default(), + Default::default(), + validators.clone() + ); + contract.vote(false); + assert!(contract.votes.is_empty()); + } + + #[test] + fn test_validator_kick_out() { + let mut validators = HashMap::from_iter(vec![ + ("test1".to_string(), 40), + ("test2".to_string(), 10), + ("test3".to_string(), 10), + ]); + let context = get_context_with_epoch_height("test1".to_string(), 1); + testing_env!( + context, + Default::default(), + Default::default(), + validators.clone() + ); + + let mut contract = VotingContract::new(); + contract.vote(true); + assert_eq!((contract.get_total_voted_stake().0).0, 40); + validators.remove(&"test1".to_string()); + let context = get_context_with_epoch_height("test2".to_string(), 2); + testing_env!( + context, + Default::default(), + Default::default(), + validators.clone() + ); + contract.ping(); + assert_eq!((contract.get_total_voted_stake().0).0, 0); + } +} diff --git a/tests/test_basics.rs b/tests/test_basics.rs new file mode 100644 index 0000000..0f7f130 --- /dev/null +++ b/tests/test_basics.rs @@ -0,0 +1,30 @@ +use serde_json::json; + +#[tokio::test] +async fn test_contract_is_operational() -> Result<(), Box> { + let contract_wasm = near_workspaces::compile_project("./").await?; + + test_basics_on(&contract_wasm).await?; + Ok(()) +} + +async fn test_basics_on(contract_wasm: &[u8]) -> Result<(), Box> { + let sandbox = near_workspaces::sandbox().await?; + let contract = sandbox.dev_deploy(contract_wasm).await?; + + let user_account = sandbox.dev_create_account().await?; + + let outcome = user_account + .call(contract.id(), "set_greeting") + .args_json(json!({"greeting": "Hello World!"})) + .transact() + .await?; + assert!(outcome.is_success(), "{:#?}", outcome.into_result().unwrap_err()); + + let user_message_outcome = contract.view("get_greeting").args_json(json!({})).await?; + assert_eq!(user_message_outcome.json::()?, "Hello World!"); + + Ok(()) +} + + From 031b25481bbba04b4484af6ebe8f4324f41c059a Mon Sep 17 00:00:00 2001 From: Linguists <95207870+linguists@users.noreply.github.com> Date: Mon, 12 May 2025 15:54:56 +0800 Subject: [PATCH 02/16] feat: validator voting --- Cargo.lock | 2534 ++---------------------------------------- Cargo.toml | 2 +- src/lib.rs | 258 ++++- tests/test_basics.rs | 40 +- 4 files changed, 352 insertions(+), 2482 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7c491b7..6ad186e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,16 +1,12 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "Inflector" version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -dependencies = [ - "lazy_static", - "regex", -] [[package]] name = "addr2line" @@ -18,7 +14,7 @@ version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ - "gimli 0.31.1", + "gimli", ] [[package]] @@ -27,26 +23,6 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" -[[package]] -name = "aes" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" -dependencies = [ - "cfg-if 1.0.0", - "cipher", - "cpufeatures", -] - -[[package]] -name = "aho-corasick" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" -dependencies = [ - "memchr", -] - [[package]] name = "allocator-api2" version = "0.2.21" @@ -68,12 +44,6 @@ dependencies = [ "libc", ] -[[package]] -name = "anstyle" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" - [[package]] name = "anyhow" version = "1.0.98" @@ -89,29 +59,6 @@ dependencies = [ "derive_arbitrary", ] -[[package]] -name = "arrayvec" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" - -[[package]] -name = "async-trait" -version = "0.1.88" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.101", -] - -[[package]] -name = "atomic-waker" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" - [[package]] name = "autocfg" version = "1.4.0" @@ -130,7 +77,7 @@ dependencies = [ "miniz_oxide", "object", "rustc-demangle", - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -145,36 +92,6 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" -[[package]] -name = "base64ct" -version = "1.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89e25b6adfb930f02d1981565a6e5d9c547ac15a96606256d3b59040e5cd4ca3" - -[[package]] -name = "binary-install" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93bff426ff93f3610dd2b946f3eb8cb2d1285ca8682834d43be531a3f93db2ff" -dependencies = [ - "anyhow", - "dirs-next", - "flate2", - "fs2", - "hex", - "is_executable", - "siphasher 0.3.11", - "tar", - "ureq", - "zip 0.6.6", -] - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - [[package]] name = "bitflags" version = "2.9.0" @@ -223,29 +140,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "bon" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97493a391b4b18ee918675fb8663e53646fd09321c58b46afa04e8ce2499c869" -dependencies = [ - "bon-macros", - "rustversion", -] - -[[package]] -name = "bon-macros" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2af3eac944c12cdf4423eab70d310da0a8e5851a18ffb192c0a5e3f7ae1663" -dependencies = [ - "darling", - "ident_case", - "proc-macro2", - "quote", - "syn 2.0.101", -] - [[package]] name = "borsh" version = "1.5.7" @@ -269,15 +163,6 @@ dependencies = [ "syn 2.0.101", ] -[[package]] -name = "brownstone" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "030ea61398f34f1395ccbeb046fb68c87b631d1f34567fed0f0f11fa35d18d8d" -dependencies = [ - "arrayvec", -] - [[package]] name = "bs58" version = "0.4.0" @@ -320,87 +205,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bzip2" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" -dependencies = [ - "bzip2-sys", - "libc", -] - -[[package]] -name = "bzip2-sys" -version = "0.1.13+1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225bff33b2141874fe80d71e07d6eec4f85c5c216453dd96388240f96e1acc14" -dependencies = [ - "cc", - "pkg-config", -] - -[[package]] -name = "camino" -version = "1.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-near-build" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1621369df7842f8fcaefab24e9f922f86ec24da22d80e3c44183c3717a885dce" -dependencies = [ - "bon", - "bs58 0.5.1", - "camino", - "cargo_metadata", - "colored", - "dunce", - "eyre", - "hex", - "humantime", - "indenter", - "libloading", - "near-abi", - "rustc_version", - "schemars", - "serde_json", - "sha2", - "symbolic-debuginfo", - "tempfile", - "tracing", - "wasm-opt", - "zstd 0.13.3", -] - -[[package]] -name = "cargo-platform" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", - "thiserror 1.0.69", -] - [[package]] name = "cc" version = "1.2.22" @@ -438,92 +242,11 @@ checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" dependencies = [ "android-tzdata", "iana-time-zone", - "js-sys", "num-traits", "serde", - "wasm-bindgen", "windows-link", ] -[[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 = "clap" -version = "4.5.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed93b9805f8ba930df42c2590f05453d5ec36cbb85d018868a5b24d31f6ac000" -dependencies = [ - "clap_builder", -] - -[[package]] -name = "clap_builder" -version = "4.5.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "379026ff283facf611b0ea629334361c4211d1b12ee01024eec1591133b04120" -dependencies = [ - "anstyle", - "clap_lex", - "strsim", -] - -[[package]] -name = "clap_lex" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" - -[[package]] -name = "codespan-reporting" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe6d2e5af09e8c8ad56c969f2157a3d4238cebc7c55f0a517728c38f7b200f81" -dependencies = [ - "serde", - "termcolor", - "unicode-width", -] - -[[package]] -name = "colored" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" -dependencies = [ - "lazy_static", - "windows-sys 0.59.0", -] - -[[package]] -name = "constant_time_eq" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" - -[[package]] -name = "convert_case" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb4a24b1aaf0fd0ce8b45161144d6f42cd91677fd5940fd431183eb023b3a2b8" - -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -539,15 +262,6 @@ dependencies = [ "libc", ] -[[package]] -name = "crc32fast" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" -dependencies = [ - "cfg-if 1.0.0", -] - [[package]] name = "crossbeam-deque" version = "0.8.6" @@ -616,65 +330,6 @@ dependencies = [ "syn 2.0.101", ] -[[package]] -name = "cxx" -version = "1.0.158" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a71ea7f29c73f7ffa64c50b83c9fe4d3a6d4be89a86b009eb80d5a6d3429d741" -dependencies = [ - "cc", - "cxxbridge-cmd", - "cxxbridge-flags", - "cxxbridge-macro", - "foldhash", - "link-cplusplus", -] - -[[package]] -name = "cxx-build" -version = "1.0.158" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36a8232661d66dcf713394726157d3cfe0a89bfc85f52d6e9f9bbc2306797fe7" -dependencies = [ - "cc", - "codespan-reporting", - "proc-macro2", - "quote", - "scratch", - "syn 2.0.101", -] - -[[package]] -name = "cxxbridge-cmd" -version = "1.0.158" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f44296c8693e9ea226a48f6a122727f77aa9e9e338380cb021accaeeb7ee279" -dependencies = [ - "clap", - "codespan-reporting", - "proc-macro2", - "quote", - "syn 2.0.101", -] - -[[package]] -name = "cxxbridge-flags" -version = "1.0.158" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f69c181c176981ae44ba9876e2ea41ce8e574c296b38d06925ce9214fb8e4" - -[[package]] -name = "cxxbridge-macro" -version = "1.0.158" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8faff5d4467e0709448187df29ccbf3b0982cc426ee444a193f87b11afb565a8" -dependencies = [ - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.101", -] - [[package]] name = "darling" version = "0.20.11" @@ -710,15 +365,6 @@ dependencies = [ "syn 2.0.101", ] -[[package]] -name = "debugid" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ee87af31d84ef885378aebca32be3d682b0e0dc119d5b4860a2c5bb5046730" -dependencies = [ - "uuid", -] - [[package]] name = "deranged" version = "0.4.0" @@ -771,56 +417,6 @@ dependencies = [ "subtle", ] -[[package]] -name = "dirs-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" -dependencies = [ - "cfg-if 1.0.0", - "dirs-sys-next", -] - -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - -[[package]] -name = "displaydoc" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.101", -] - -[[package]] -name = "dmsort" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0bc8fbe9441c17c9f46f75dfe27fa1ddb6c68a461ccaed0481419219d4f10d3" - -[[package]] -name = "dunce" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" - -[[package]] -name = "dyn-clone" -version = "1.0.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c7a8fb8a9fbf66c1f703fe16184d10ca0ee9d23be5b4436400408ba54a95005" - [[package]] name = "easy-ext" version = "0.2.9" @@ -844,7 +440,6 @@ checksum = "4a3daa8e81a3963a60642bcc1f90a670680bd4a77535faa384e9d1c79d620871" dependencies = [ "curve25519-dalek", "ed25519", - "rand_core", "sha2", "subtle", ] @@ -856,31 +451,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] -name = "elementtree" -version = "0.7.0" +name = "enum-map" +version = "2.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6319c9433cf1e95c60c8533978bccf0614f27f03bb4e514253468eeeaa7fe3" +checksum = "6866f3bfdf8207509a033af1a75a7b08abda06bbaaeae6669323fd5a097df2e9" dependencies = [ - "string_cache", - "xml-rs", -] - -[[package]] -name = "encoding_rs" -version = "0.8.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "enum-map" -version = "2.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6866f3bfdf8207509a033af1a75a7b08abda06bbaaeae6669323fd5a097df2e9" -dependencies = [ - "enum-map-derive", + "enum-map-derive", ] [[package]] @@ -910,22 +486,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "eyre" -version = "0.6.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd915d99f24784cdc19fd37ef22b97e3ff0ae756c7e492e9fbfe897d61e2aec" -dependencies = [ - "indenter", - "once_cell", -] - -[[package]] -name = "fallible-iterator" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" - [[package]] name = "fastrand" version = "2.3.0" @@ -938,18 +498,6 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" -[[package]] -name = "filetime" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "libredox", - "windows-sys 0.59.0", -] - [[package]] name = "fixed-hash" version = "0.7.0" @@ -959,25 +507,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "flate2" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ced92e76e966ca2fd84c8f7aa01a4aea65b0eb6648d72f7c8f3e2764a67fece" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[package]] -name = "fluent-uri" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17c704e9dbe1ddd863da1e6ff3567795087b1eb201ce80d8fa81162e1516500d" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "fnv" version = "1.0.7" @@ -990,85 +519,12 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - -[[package]] -name = "form_urlencoded" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "fs2" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9564fc758e15025b46aa6643b1b77d047d1a56a1aea6e01002ac0c7026876213" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "funty" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" -[[package]] -name = "futures-channel" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" -dependencies = [ - "futures-core", -] - -[[package]] -name = "futures-core" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" - -[[package]] -name = "futures-sink" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" - -[[package]] -name = "futures-task" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" - -[[package]] -name = "futures-util" -version = "0.3.31" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" -dependencies = [ - "futures-core", - "futures-task", - "pin-project-lite", - "pin-utils", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -1079,17 +535,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "getrandom" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi 0.11.0+wasi-snapshot-preview1", -] - [[package]] name = "getrandom" version = "0.3.3" @@ -1102,16 +547,6 @@ dependencies = [ "wasi 0.14.2+wasi-0.2.4", ] -[[package]] -name = "gimli" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" -dependencies = [ - "fallible-iterator", - "stable_deref_trait", -] - [[package]] name = "gimli" version = "0.31.1" @@ -1124,36 +559,6 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" -[[package]] -name = "goblin" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7666983ed0dd8d21a6f6576ee00053ca0926fb281a5522577a4dbd0f1b54143" -dependencies = [ - "log", - "plain", - "scroll 0.11.0", -] - -[[package]] -name = "h2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9421a676d1b147b16b82c9225157dc629087ef8ec4d5e2960f9437a90dac0a5" -dependencies = [ - "atomic-waker", - "bytes", - "fnv", - "futures-core", - "futures-sink", - "http", - "indexmap 2.9.0", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "hashbrown" version = "0.12.3" @@ -1198,143 +603,6 @@ dependencies = [ "serde", ] -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest", -] - -[[package]] -name = "home" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "http" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" -dependencies = [ - "bytes", - "http", -] - -[[package]] -name = "http-body-util" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" -dependencies = [ - "bytes", - "futures-core", - "http", - "http-body", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" - -[[package]] -name = "humantime" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b112acc8b3adf4b107a8ec20977da0273a8c386765a3ec0229bd500a1443f9f" - -[[package]] -name = "hyper" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "itoa", - "pin-project-lite", - "smallvec", - "tokio", - "want", -] - -[[package]] -name = "hyper-rustls" -version = "0.27.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" -dependencies = [ - "futures-util", - "http", - "hyper", - "hyper-util", - "rustls", - "rustls-pki-types", - "tokio", - "tokio-rustls", - "tower-service", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", -] - -[[package]] -name = "hyper-util" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497bbc33a26fdd4af9ed9c70d63f61cf56a938375fbb32df34db9b1cd6d643f2" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "http", - "http-body", - "hyper", - "libc", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", -] - [[package]] name = "iana-time-zone" version = "0.1.63" @@ -1359,131 +627,12 @@ dependencies = [ "cc", ] -[[package]] -name = "icu_collections" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" -dependencies = [ - "displaydoc", - "potential_utf", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locale_core" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_normalizer" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" - -[[package]] -name = "icu_properties" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2549ca8c7241c82f59c80ba2a6f415d931c5b58d24fb8412caa1a1f02c49139a" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_locale_core", - "icu_properties_data", - "icu_provider", - "potential_utf", - "zerotrie", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8197e866e47b68f8f7d95249e172903bec06004b18b2937f1095d40a0c57de04" - -[[package]] -name = "icu_provider" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" -dependencies = [ - "displaydoc", - "icu_locale_core", - "stable_deref_trait", - "tinystr", - "writeable", - "yoke", - "zerofrom", - "zerotrie", - "zerovec", -] - [[package]] name = "ident_case" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" -[[package]] -name = "idna" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" -dependencies = [ - "idna_adapter", - "smallvec", - "utf8_iter", -] - -[[package]] -name = "idna_adapter" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" -dependencies = [ - "icu_normalizer", - "icu_properties", -] - -[[package]] -name = "indent_write" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cfe9645a18782869361d9c8732246be7b410ad4e919d3609ebabdac00ba12c3" - -[[package]] -name = "indenter" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" - [[package]] name = "indexmap" version = "1.9.3" @@ -1491,43 +640,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown 0.12.3", - "serde", -] - -[[package]] -name = "indexmap" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" -dependencies = [ - "equivalent", - "hashbrown 0.15.3", - "serde", -] - -[[package]] -name = "inout" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879f10e63c20629ecabbb64a8010319738c66a5cd0c29b02d63d272b03751d01" -dependencies = [ - "generic-array", + "hashbrown 0.12.3", + "serde", ] [[package]] -name = "ipnet" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" - -[[package]] -name = "is_executable" -version = "0.1.2" +name = "indexmap" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "302d553b8abc8187beb7d663e34c065ac4570b273bc9511a50e940e99409c577" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ - "winapi", + "equivalent", + "hashbrown 0.15.3", + "serde", ] [[package]] @@ -1551,16 +676,10 @@ version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a" dependencies = [ - "getrandom 0.3.3", + "getrandom", "libc", ] -[[package]] -name = "joinery" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72167d68f5fce3b8655487b8038691a3c9984ee769590f93f2a631f4ad64e4f5" - [[package]] name = "js-sys" version = "0.3.77" @@ -1571,35 +690,12 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "json-patch" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b1fb8864823fad91877e6caea0baca82e49e8db50f8e5c9f9a453e27d3330fc" -dependencies = [ - "jsonptr", - "serde", - "serde_json", - "thiserror 1.0.69", -] - [[package]] name = "json_comments" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9dbbfed4e59ba9750e15ba154fdfd9329cee16ff3df539c2666b70f58cc32105" -[[package]] -name = "jsonptr" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c6e529149475ca0b2820835d3dce8fcc41c6b943ca608d32f35b449255e4627" -dependencies = [ - "fluent-uri", - "serde", - "serde_json", -] - [[package]] name = "keccak" version = "0.1.5" @@ -1618,48 +714,12 @@ dependencies = [ "spin", ] -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - [[package]] name = "libc" version = "0.2.172" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" -[[package]] -name = "libloading" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a793df0d7afeac54f95b471d3af7f0d4fb975699f972341a4b76988d49cdf0c" -dependencies = [ - "cfg-if 1.0.0", - "windows-targets 0.53.0", -] - -[[package]] -name = "libredox" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" -dependencies = [ - "bitflags 2.9.0", - "libc", - "redox_syscall", -] - -[[package]] -name = "link-cplusplus" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a6f6da007f968f9def0d65a05b187e2960183de70c160204ecfccf0ee330212" -dependencies = [ - "cc", -] - [[package]] name = "linux-raw-sys" version = "0.4.15" @@ -1672,12 +732,6 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" -[[package]] -name = "litemap" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" - [[package]] name = "lock_api" version = "0.4.12" @@ -1709,33 +763,12 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" -[[package]] -name = "memmap2" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" -dependencies = [ - "libc", -] - [[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.8.8" @@ -1756,75 +789,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "native-tls" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - -[[package]] -name = "near-abi" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c49593c9e94454a2368a4c0a511bf4bf1413aff4d23f16e1d8f4e64b5215351" -dependencies = [ - "borsh", - "schemars", - "semver", - "serde", -] - -[[package]] -name = "near-abi-client" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879ac02b2e8d6498294adce1de7a2424a5474b35a73e9262c851be39c89d7f92" -dependencies = [ - "anyhow", - "convert_case", - "near-abi-client-impl", - "near-abi-client-macros", - "prettyplease", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "near-abi-client-impl" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1139e8a6f60fd8ed1c53c700b67bcecbf6deb4b1f47bbe9a9d5eea760d8a8e91" -dependencies = [ - "anyhow", - "near-abi", - "near_schemafy_lib", - "proc-macro2", - "quote", - "schemars", - "serde_json", -] - -[[package]] -name = "near-abi-client-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebaf2aae80086b310bf96e657bbee0c599c3452afd35e72999f8d6764d6b1899" -dependencies = [ - "near-abi-client-impl", - "syn 1.0.109", -] - [[package]] name = "near-account-id" version = "1.1.1" @@ -1835,30 +799,6 @@ dependencies = [ "serde", ] -[[package]] -name = "near-chain-configs" -version = "0.29.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82d98e77d25ba905d16e91179a33e215da3226d62fadf73c471ef88a9b9d58c2" -dependencies = [ - "anyhow", - "bytesize", - "chrono", - "derive_more", - "near-config-utils", - "near-crypto", - "near-parameters", - "near-primitives", - "near-time", - "num-rational", - "serde", - "serde_json", - "sha2", - "smart-default", - "time", - "tracing", -] - [[package]] name = "near-config-utils" version = "0.29.2" @@ -1867,7 +807,7 @@ checksum = "6b992cca8d3b00f34b37f638c9632a97b734656151294e7a29b60b93b8a92948" dependencies = [ "anyhow", "json_comments", - "thiserror 2.0.12", + "thiserror", "tracing", ] @@ -1889,12 +829,11 @@ dependencies = [ "near-schema-checker-lib", "near-stdx", "primitive-types", - "rand", "secp256k1", "serde", "serde_json", "subtle", - "thiserror 2.0.12", + "thiserror", ] [[package]] @@ -1913,44 +852,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "180edcc7dc2fac41f93570d0c7b759c1b6d492f6ad093d749d644a40b4310a97" dependencies = [ "borsh", - "schemars", - "serde", -] - -[[package]] -name = "near-jsonrpc-client" -version = "0.16.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "752aa5d0080f6c3bad8ba349046069a406e7536ab101d6cfc7db3e157144b921" -dependencies = [ - "borsh", - "lazy_static", - "log", - "near-chain-configs", - "near-crypto", - "near-jsonrpc-primitives", - "near-primitives", - "reqwest", - "serde", - "serde_json", - "thiserror 2.0.12", -] - -[[package]] -name = "near-jsonrpc-primitives" -version = "0.29.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f003113d08e1f0ab9e6335efb1f7167662954804274653904ef57a9b5f8e687" -dependencies = [ - "arbitrary", - "near-chain-configs", - "near-crypto", - "near-primitives", - "near-schema-checker-lib", "serde", - "serde_json", - "thiserror 2.0.12", - "time", ] [[package]] @@ -1969,7 +871,7 @@ dependencies = [ "serde_repr", "serde_yaml", "strum 0.24.1", - "thiserror 2.0.12", + "thiserror", ] [[package]] @@ -2001,17 +903,15 @@ dependencies = [ "num-rational", "ordered-float", "primitive-types", - "rand", - "rand_chacha", "serde", "serde_json", "serde_with", "sha3", "smart-default", "strum 0.24.1", - "thiserror 2.0.12", + "thiserror", "tracing", - "zstd 0.13.3", + "zstd", ] [[package]] @@ -2032,20 +932,7 @@ dependencies = [ "serde", "serde_repr", "sha2", - "thiserror 2.0.12", -] - -[[package]] -name = "near-sandbox-utils" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65921a949220d53f4e346694f7ecae018320003d88582d4bbe45da26c5c35aa7" -dependencies = [ - "anyhow", - "binary-install", - "fs2", - "home", - "tokio", + "thiserror", ] [[package]] @@ -2131,141 +1018,49 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "40a8ffbee0028f08220c46d864d81ac780f2805ab3156b044ee04a927005a84f" dependencies = [ "serde", - "time", -] - -[[package]] -name = "near-token" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd3e60aa26a74dc514b1b6408fdd06cefe2eb0ff029020956c1c6517594048fd" -dependencies = [ - "borsh", - "serde", -] - -[[package]] -name = "near-vm-runner" -version = "0.29.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fca3f18ed6a87b334b93b53e4c2c98cf185fd1fde5a4b538980508fb7e51b147" -dependencies = [ - "blst", - "borsh", - "bytesize", - "ed25519-dalek", - "enum-map", - "lru", - "near-crypto", - "near-parameters", - "near-primitives-core", - "near-schema-checker-lib", - "near-stdx", - "num-rational", - "rayon", - "ripemd", - "rustix 0.38.44", - "serde", - "serde_repr", - "sha2", - "sha3", - "strum 0.24.1", - "tempfile", - "thiserror 2.0.12", - "tracing", - "zeropool-bn", -] - -[[package]] -name = "near-workspaces" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43e44fc77e3491076daaec62c9be3a1b4d63c299702569b5eca3dd2057f8330" -dependencies = [ - "async-trait", - "base64 0.22.1", - "bs58 0.5.1", - "cargo-near-build", - "chrono", - "fs2", - "json-patch", - "libc", - "near-abi-client", - "near-account-id", - "near-crypto", - "near-gas", - "near-jsonrpc-client", - "near-jsonrpc-primitives", - "near-primitives", - "near-sandbox-utils", - "near-token", - "rand", - "reqwest", - "serde", - "serde_json", - "sha2", - "tempfile", - "thiserror 1.0.69", - "tokio", - "tokio-retry", - "tracing", - "url", -] - -[[package]] -name = "near_schemafy_core" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42d7a1f809a319578773329389529dbf8c8f0abfbb05a429b37f437105f7caf6" -dependencies = [ - "serde", - "serde_json", -] - -[[package]] -name = "near_schemafy_lib" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c39ccae55df51adaa1a4e567b7a79ab4380826a695121cebf41f518076d8c3dd" -dependencies = [ - "Inflector", - "near_schemafy_core", - "proc-macro2", - "quote", - "serde", - "serde_derive", - "serde_json", - "syn 1.0.109", - "uriparse", + "time", ] [[package]] -name = "new_debug_unreachable" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" - -[[package]] -name = "nom" -version = "7.1.3" +name = "near-token" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +checksum = "cd3e60aa26a74dc514b1b6408fdd06cefe2eb0ff029020956c1c6517594048fd" dependencies = [ - "memchr", - "minimal-lexical", + "borsh", + "serde", ] [[package]] -name = "nom-supreme" -version = "0.6.0" +name = "near-vm-runner" +version = "0.29.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aadc66631948f6b65da03be4c4cd8bd104d481697ecbb9bbd65719b1ec60bc9f" +checksum = "fca3f18ed6a87b334b93b53e4c2c98cf185fd1fde5a4b538980508fb7e51b147" dependencies = [ - "brownstone", - "indent_write", - "joinery", - "memchr", - "nom", + "blst", + "borsh", + "bytesize", + "ed25519-dalek", + "enum-map", + "lru", + "near-crypto", + "near-parameters", + "near-primitives-core", + "near-schema-checker-lib", + "near-stdx", + "num-rational", + "rayon", + "ripemd", + "rustix 0.38.44", + "serde", + "serde_repr", + "sha2", + "sha3", + "strum 0.24.1", + "tempfile", + "thiserror", + "tracing", + "zeropool-bn", ] [[package]] @@ -2341,50 +1136,6 @@ version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" -[[package]] -name = "openssl" -version = "0.10.72" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fedfea7d58a1f73118430a55da6a286e7b044961736ce96a16a17068ea25e5da" -dependencies = [ - "bitflags 2.9.0", - "cfg-if 1.0.0", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.101", -] - -[[package]] -name = "openssl-probe" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" - -[[package]] -name = "openssl-sys" -version = "0.9.108" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e145e1651e858e820e4860f7b9c5e169bc1d8ce1c86043be79fa7b7634821847" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "ordered-float" version = "4.6.0" @@ -2417,76 +1168,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-targets 0.52.6", -] - -[[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 = "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 = "pdb" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13f4d162ecaaa1467de5afbe62d597757b674b51da8bb4e587430c5fdb2af7aa" -dependencies = [ - "fallible-iterator", - "scroll 0.10.2", - "uuid", -] - -[[package]] -name = "percent-encoding" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" - -[[package]] -name = "phf_shared" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" -dependencies = [ - "siphasher 1.0.1", -] - -[[package]] -name = "pin-project" -version = "1.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.101", + "windows-targets", ] [[package]] @@ -2495,64 +1177,18 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - [[package]] name = "pkg-config" version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" -[[package]] -name = "plain" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" - -[[package]] -name = "potential_utf" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" -dependencies = [ - "zerovec", -] - [[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.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" -dependencies = [ - "zerocopy", -] - -[[package]] -name = "precomputed-hash" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" - -[[package]] -name = "prettyplease" -version = "0.1.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8646e95016a7a6c4adea95bafa8a16baab64b583356217f2c85db4a39d9a86" -dependencies = [ - "proc-macro2", - "syn 1.0.109", -] - [[package]] name = "primitive-types" version = "0.10.1" @@ -2608,29 +1244,16 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "libc", - "rand_chacha", "rand_core", "serde", ] -[[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 0.2.16", "serde", ] @@ -2660,105 +1283,7 @@ version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "928fca9cf2aa042393a8325b9ead81d2f0df4cb12e1e24cef072922ccd99c5af" dependencies = [ - "bitflags 2.9.0", -] - -[[package]] -name = "redox_users" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" -dependencies = [ - "getrandom 0.2.16", - "libredox", - "thiserror 1.0.69", -] - -[[package]] -name = "regex" -version = "1.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - -[[package]] -name = "regex-automata" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" - -[[package]] -name = "reqwest" -version = "0.12.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d19c46a6fdd48bc4dab94b6103fccc55d34c67cc0ad04653aad4ea2a07cd7bbb" -dependencies = [ - "base64 0.22.1", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "http-body-util", - "hyper", - "hyper-rustls", - "hyper-tls", - "hyper-util", - "ipnet", - "js-sys", - "log", - "mime", - "native-tls", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls-pemfile", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper", - "system-configuration", - "tokio", - "tokio-native-tls", - "tower", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "windows-registry", -] - -[[package]] -name = "ring" -version = "0.17.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" -dependencies = [ - "cc", - "cfg-if 1.0.0", - "getrandom 0.2.16", - "libc", - "untrusted", - "windows-sys 0.52.0", + "bitflags", ] [[package]] @@ -2797,7 +1322,7 @@ version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.9.0", + "bitflags", "errno", "libc", "linux-raw-sys 0.4.15", @@ -2810,139 +1335,30 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" dependencies = [ - "bitflags 2.9.0", + "bitflags", "errno", "libc", "linux-raw-sys 0.9.4", "windows-sys 0.59.0", ] -[[package]] -name = "rustls" -version = "0.23.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "730944ca083c1c233a75c09f199e973ca499344a2b7ba9e755c457e86fb4a321" -dependencies = [ - "log", - "once_cell", - "ring", - "rustls-pki-types", - "rustls-webpki", - "subtle", - "zeroize", -] - -[[package]] -name = "rustls-pemfile" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" -dependencies = [ - "rustls-pki-types", -] - -[[package]] -name = "rustls-pki-types" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" -dependencies = [ - "zeroize", -] - -[[package]] -name = "rustls-webpki" -version = "0.103.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a72fe2bcf7a6ac6fd7d0b9e5cb68aeb7d4c0a0271730218b3e92d43b4eb435" -dependencies = [ - "ring", - "rustls-pki-types", - "untrusted", -] - [[package]] name = "rustversion" version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" - -[[package]] -name = "ryu" -version = "1.0.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" - -[[package]] -name = "schannel" -version = "0.1.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" -dependencies = [ - "windows-sys 0.59.0", -] - -[[package]] -name = "schemars" -version = "0.8.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fbf2ae1b8bc8e02df939598064d22402220cd5bbcca1c76f7d6a310974d5615" -dependencies = [ - "dyn-clone", - "schemars_derive", - "serde", - "serde_json", -] - -[[package]] -name = "schemars_derive" -version = "0.8.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32e265784ad618884abaea0600a9adf15393368d840e0222d101a072f3f7534d" -dependencies = [ - "proc-macro2", - "quote", - "serde_derive_internals", - "syn 2.0.101", -] - -[[package]] -name = "scopeguard" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" - -[[package]] -name = "scratch" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f6280af86e5f559536da57a45ebc84948833b3bee313a7dd25232e09c878a52" - -[[package]] -name = "scroll" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda28d4b4830b807a8b43f7b0e6b5df875311b3e7621d84577188c175b6ec1ec" +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" [[package]] -name = "scroll" -version = "0.11.0" +name = "ryu" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04c565b551bafbef4157586fa379538366e4385d42082f255bfd96e4fe8519da" -dependencies = [ - "scroll_derive", -] +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] -name = "scroll_derive" -version = "0.11.1" +name = "scopeguard" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.101", -] +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "secp256k1" @@ -2950,7 +1366,6 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" dependencies = [ - "rand", "secp256k1-sys", ] @@ -2963,37 +1378,11 @@ dependencies = [ "cc", ] -[[package]] -name = "security-framework" -version = "2.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" -dependencies = [ - "bitflags 2.9.0", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "semver" version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" -dependencies = [ - "serde", -] [[package]] name = "serde" @@ -3015,17 +1404,6 @@ dependencies = [ "syn 2.0.101", ] -[[package]] -name = "serde_derive_internals" -version = "0.29.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.101", -] - [[package]] name = "serde_json" version = "1.0.140" @@ -3049,18 +1427,6 @@ dependencies = [ "syn 2.0.101", ] -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - [[package]] name = "serde_with" version = "3.12.0" @@ -3104,17 +1470,6 @@ dependencies = [ "unsafe-libyaml", ] -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "digest", -] - [[package]] name = "sha2" version = "0.10.9" @@ -3157,27 +1512,6 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" -[[package]] -name = "siphasher" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" - -[[package]] -name = "siphasher" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" - -[[package]] -name = "slab" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" -dependencies = [ - "autocfg", -] - [[package]] name = "smallvec" version = "1.15.0" @@ -3211,31 +1545,12 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - [[package]] name = "static_assertions" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "string_cache" -version = "0.8.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf776ba3fa74f83bf4b63c3dcbbf82173db2632ed8452cb2d891d33f459de70f" -dependencies = [ - "new_debug_unreachable", - "parking_lot", - "phf_shared", - "precomputed-hash", - "serde", -] - [[package]] name = "strsim" version = "0.11.1" @@ -3289,48 +1604,6 @@ version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" -[[package]] -name = "symbolic-common" -version = "8.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f551f902d5642e58039aee6a9021a61037926af96e071816361644983966f540" -dependencies = [ - "debugid", - "memmap2", - "stable_deref_trait", - "uuid", -] - -[[package]] -name = "symbolic-debuginfo" -version = "8.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1165dabf9fc1d6bb6819c2c0e27c8dd0e3068d2c53cf186d319788e96517f0d6" -dependencies = [ - "bitvec", - "dmsort", - "elementtree", - "fallible-iterator", - "flate2", - "gimli 0.26.2", - "goblin", - "lazy_static", - "lazycell", - "nom", - "nom-supreme", - "parking_lot", - "pdb", - "regex", - "scroll 0.11.0", - "serde", - "serde_json", - "smallvec", - "symbolic-common", - "thiserror 1.0.69", - "wasmparser", - "zip 0.5.13", -] - [[package]] name = "syn" version = "1.0.109" @@ -3353,64 +1626,12 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "sync_wrapper" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" -dependencies = [ - "futures-core", -] - -[[package]] -name = "synstructure" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.101", -] - -[[package]] -name = "system-configuration" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" -dependencies = [ - "bitflags 2.9.0", - "core-foundation", - "system-configuration-sys", -] - -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "tap" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" -[[package]] -name = "tar" -version = "0.4.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d863878d212c87a19c1a610eb53bb01fe12951c0501cf5a0d65f724914a667a" -dependencies = [ - "filetime", - "libc", - "xattr", -] - [[package]] name = "tempfile" version = "3.20.0" @@ -3418,48 +1639,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" dependencies = [ "fastrand", - "getrandom 0.3.3", + "getrandom", "once_cell", "rustix 1.0.7", "windows-sys 0.59.0", ] -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl 1.0.69", -] - [[package]] name = "thiserror" version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" dependencies = [ - "thiserror-impl 2.0.12", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.101", + "thiserror-impl", ] [[package]] @@ -3513,16 +1705,6 @@ dependencies = [ "time-core", ] -[[package]] -name = "tinystr" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" -dependencies = [ - "displaydoc", - "zerovec", -] - [[package]] name = "tinyvec" version = "1.9.0" @@ -3567,50 +1749,6 @@ dependencies = [ "syn 2.0.101", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - -[[package]] -name = "tokio-retry" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f57eb36ecbe0fc510036adff84824dd3c24bb781e21bfa67b69d556aa85214f" -dependencies = [ - "pin-project", - "rand", - "tokio", -] - -[[package]] -name = "tokio-rustls" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" -dependencies = [ - "rustls", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", -] - [[package]] name = "toml_datetime" version = "0.6.9" @@ -3628,33 +1766,6 @@ dependencies = [ "winnow", ] -[[package]] -name = "tower" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" -dependencies = [ - "futures-core", - "futures-util", - "pin-project-lite", - "sync_wrapper", - "tokio", - "tower-layer", - "tower-service", -] - -[[package]] -name = "tower-layer" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" - -[[package]] -name = "tower-service" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" - [[package]] name = "tracing" version = "0.1.41" @@ -3671,150 +1782,66 @@ name = "tracing-attributes" version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.101", -] - -[[package]] -name = "tracing-core" -version = "0.1.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" -dependencies = [ - "once_cell", -] - -[[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.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" - -[[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.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" - -[[package]] -name = "unicode-width" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" - -[[package]] -name = "unsafe-libyaml" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" - -[[package]] -name = "untrusted" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] [[package]] -name = "ureq" -version = "2.12.1" +name = "tracing-core" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d1a66277ed75f640d608235660df48c8e3c19f3b4edb6a263315626cc3c01d" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ - "base64 0.22.1", - "flate2", - "log", "once_cell", - "rustls", - "rustls-pki-types", - "url", - "webpki-roots 0.26.11", ] [[package]] -name = "uriparse" -version = "0.6.4" +name = "typenum" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0200d0fc04d809396c2ad43f3c95da3582a2556eba8d453c1087f4120ee352ff" -dependencies = [ - "fnv", - "lazy_static", -] +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] -name = "url" -version = "2.5.4" +name = "uint" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", - "serde", + "byteorder", + "crunchy", + "hex", + "static_assertions", ] [[package]] -name = "utf8_iter" -version = "1.0.4" +name = "unicode-ident" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] -name = "uuid" -version = "0.8.2" +name = "unsafe-libyaml" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" [[package]] name = "validator-voting" version = "0.1.0" dependencies = [ "near-sdk", - "near-workspaces", "serde_json", "tokio", ] -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "version_check" version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" -[[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" @@ -3856,19 +1883,6 @@ dependencies = [ "wasm-bindgen-shared", ] -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" -dependencies = [ - "cfg-if 1.0.0", - "js-sys", - "once_cell", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "wasm-bindgen-macro" version = "0.2.100" @@ -3901,80 +1915,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "wasm-opt" -version = "0.116.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd87a4c135535ffed86123b6fb0f0a5a0bc89e50416c942c5f0662c645f679c" -dependencies = [ - "anyhow", - "libc", - "strum 0.24.1", - "strum_macros 0.24.3", - "tempfile", - "thiserror 1.0.69", - "wasm-opt-cxx-sys", - "wasm-opt-sys", -] - -[[package]] -name = "wasm-opt-cxx-sys" -version = "0.116.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c57b28207aa724318fcec6575fe74803c23f6f266fce10cbc9f3f116762f12e" -dependencies = [ - "anyhow", - "cxx", - "cxx-build", - "wasm-opt-sys", -] - -[[package]] -name = "wasm-opt-sys" -version = "0.116.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a1cce564dc768dacbdb718fc29df2dba80bd21cb47d8f77ae7e3d95ceb98cbe" -dependencies = [ - "anyhow", - "cc", - "cxx", - "cxx-build", -] - -[[package]] -name = "wasmparser" -version = "0.83.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718ed7c55c2add6548cca3ddd6383d738cd73b892df400e96b9aa876f0141d7a" - -[[package]] -name = "web-sys" -version = "0.3.77" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "webpki-roots" -version = "0.26.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" -dependencies = [ - "webpki-roots 1.0.0", -] - -[[package]] -name = "webpki-roots" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2853738d1cc4f2da3a225c18ec6c3721abb31961096e9dbf5ab35fa88b19cfdb" -dependencies = [ - "rustls-pki-types", -] - [[package]] name = "wee_alloc" version = "0.4.5" @@ -4003,15 +1943,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" -dependencies = [ - "windows-sys 0.59.0", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -4028,7 +1959,7 @@ dependencies = [ "windows-interface", "windows-link", "windows-result", - "windows-strings 0.4.0", + "windows-strings", ] [[package]] @@ -4059,17 +1990,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" -[[package]] -name = "windows-registry" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3" -dependencies = [ - "windows-result", - "windows-strings 0.3.1", - "windows-targets 0.53.0", -] - [[package]] name = "windows-result" version = "0.3.2" @@ -4079,15 +1999,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "windows-strings" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319" -dependencies = [ - "windows-link", -] - [[package]] name = "windows-strings" version = "0.4.0" @@ -4103,7 +2014,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -4112,7 +2023,7 @@ version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -4121,30 +2032,14 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm 0.52.6", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" -dependencies = [ - "windows_aarch64_gnullvm 0.53.0", - "windows_aarch64_msvc 0.53.0", - "windows_i686_gnu 0.53.0", - "windows_i686_gnullvm 0.53.0", - "windows_i686_msvc 0.53.0", - "windows_x86_64_gnu 0.53.0", - "windows_x86_64_gnullvm 0.53.0", - "windows_x86_64_msvc 0.53.0", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] @@ -4153,96 +2048,48 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" - [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_aarch64_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" - [[package]] name = "windows_i686_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" -[[package]] -name = "windows_i686_gnu" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" - [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" - [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_i686_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" - [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" -[[package]] -name = "windows_x86_64_gnu" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" - [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "windows_x86_64_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" - [[package]] name = "winnow" version = "0.7.10" @@ -4258,15 +2105,9 @@ version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" dependencies = [ - "bitflags 2.9.0", + "bitflags", ] -[[package]] -name = "writeable" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" - [[package]] name = "wyz" version = "0.5.1" @@ -4276,87 +2117,6 @@ dependencies = [ "tap", ] -[[package]] -name = "xattr" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d65cbf2f12c15564212d48f4e3dfb87923d25d611f2aed18f4cb23f0413d89e" -dependencies = [ - "libc", - "rustix 1.0.7", -] - -[[package]] -name = "xml-rs" -version = "0.8.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62ce76d9b56901b19a74f19431b0d8b3bc7ca4ad685a746dfd78ca8f4fc6bda" - -[[package]] -name = "yoke" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" -dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.101", - "synstructure", -] - -[[package]] -name = "zerocopy" -version = "0.8.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.8.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.101", -] - -[[package]] -name = "zerofrom" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.101", - "synstructure", -] - [[package]] name = "zeroize" version = "1.8.1" @@ -4390,97 +2150,13 @@ dependencies = [ "rustc-hex", ] -[[package]] -name = "zerotrie" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", -] - -[[package]] -name = "zerovec" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.101", -] - -[[package]] -name = "zip" -version = "0.5.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ab48844d61251bb3835145c521d88aa4031d7139e8485990f60ca911fa0815" -dependencies = [ - "byteorder", - "crc32fast", - "flate2", - "thiserror 1.0.69", -] - -[[package]] -name = "zip" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261" -dependencies = [ - "aes", - "byteorder", - "bzip2", - "constant_time_eq", - "crc32fast", - "crossbeam-utils", - "flate2", - "hmac", - "pbkdf2", - "sha1", - "time", - "zstd 0.11.2+zstd.1.5.2", -] - -[[package]] -name = "zstd" -version = "0.11.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" -dependencies = [ - "zstd-safe 5.0.2+zstd.1.5.2", -] - [[package]] name = "zstd" version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" dependencies = [ - "zstd-safe 7.2.4", -] - -[[package]] -name = "zstd-safe" -version = "5.0.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" -dependencies = [ - "libc", - "zstd-sys", + "zstd-safe", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index c176431..5502275 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,7 +40,7 @@ near-sdk = "5.12.0" [dev-dependencies] near-sdk = { version = "5.12.0", features = ["unit-testing"] } -near-workspaces = { version = "0.18", features = ["unstable"] } +# near-workspaces = { version = "0.18", features = ["unstable"] } tokio = { version = "1.12.0", features = ["full"] } serde_json = "1" diff --git a/src/lib.rs b/src/lib.rs index af8a6b3..5a57a4a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,55 +1,249 @@ -// Find all our documentation at https://docs.near.org -use near_sdk::{log, near}; +use near_sdk::{near, env, require, Timestamp, AccountId, EpochHeight}; +use std::collections::HashMap; +use near_sdk::json_types::U128; -// Define the contract structure +type Balance = u128; + +/// Voting contract for any specific proposal. Once the majority of the stake holders agree to +/// the proposal, the time will be recorded and the voting ends. #[near(contract_state)] +#[derive(Default)] pub struct Contract { - greeting: String, -} - -// Define the default, which automatically initializes the contract -impl Default for Contract { - fn default() -> Self { - Self { - greeting: "Hello".to_string(), - } - } + proposal: String, + deadline_timestamp_ms: Timestamp, + votes: HashMap, + total_voted_stake: Balance, + result: Option, + last_epoch_height: EpochHeight, } // Implement the contract structure #[near] impl Contract { - // Public method - returns the greeting saved, defaulting to DEFAULT_GREETING - pub fn get_greeting(&self) -> String { - self.greeting.clone() + #[init] + #[private] + pub fn new(proposal: String, deadline_timestamp_ms: Timestamp) -> Self { + require!(!proposal.is_empty(), "Proposal cannot be empty"); + require!(deadline_timestamp_ms > env::block_timestamp_ms(), "Deadline must be in the future"); + Contract { + proposal, + deadline_timestamp_ms, + votes: HashMap::new(), + total_voted_stake: 0, + result: None, + last_epoch_height: 0, + } } - // Public method - accepts a greeting, such as "howdy", and records it - pub fn set_greeting(&mut self, greeting: String) { - log!("Saving greeting: {greeting}"); - self.greeting = greeting; + /// Ping to update the votes according to current stake of validators. + pub fn ping(&mut self) { + require!(self.result.is_none(), "Voting has already ended"); + let cur_epoch_height = env::epoch_height(); + if cur_epoch_height != self.last_epoch_height { + let votes = std::mem::take(&mut self.votes); + self.total_voted_stake = 0; + for (account_id, _) in votes { + let account_current_stake = env::validator_stake(&account_id).as_yoctonear(); + self.total_voted_stake += account_current_stake; + if account_current_stake > 0 { + self.votes.insert(account_id, account_current_stake); + } + } + self.check_result(); + self.last_epoch_height = cur_epoch_height; + } + } + + /// Check whether the voting has ended. + fn check_result(&mut self) { + require!( + self.result.is_none(), + "check result is called after result is already set" + ); + let total_stake = env::validator_total_stake().as_yoctonear(); + if self.total_voted_stake > total_stake * 2 / 3 { + self.result = Some(env::block_timestamp_ms()); + } + } + + /// Method for validators to vote or withdraw the vote. + /// Votes for if `is_vote` is true, or withdraws the vote if `is_vote` is false. + pub fn vote(&mut self, is_vote: bool) { + require!( + env::block_timestamp_ms() < self.deadline_timestamp_ms, + "Voting deadline has already passed" + ); + require!(self.result.is_none(), "Voting has already completed"); + + self.ping(); + let account_id = env::predecessor_account_id(); + let account_stake = if is_vote { + let stake = env::validator_stake(&account_id).as_yoctonear(); + require!(stake > 0, format!("{} is not a validator", account_id)); + stake + } else { + 0 + }; + let voted_stake = self.votes.remove(&account_id).unwrap_or_default(); + require!( + voted_stake <= self.total_voted_stake, + format!("invariant: voted stake {} is more than total voted stake {}", voted_stake, self.total_voted_stake) + ); + self.total_voted_stake = self.total_voted_stake + account_stake - voted_stake; + if account_stake > 0 { + self.votes.insert(account_id, account_stake); + self.check_result(); + } + } + + /// Returns current a pair of `total_voted_stake` and the total stake. + /// Note: as a view method, it doesn't recompute the active stake. May need to call `ping` to + /// update the active stake. + pub fn get_total_voted_stake(&self) -> (U128, U128) { + ( + self.total_voted_stake.into(), + env::validator_total_stake().as_yoctonear().into(), + ) + } + + /// Returns all active votes. + /// Note: as a view method, it doesn't recompute the active stake. May need to call `ping` to + /// update the active stake. + pub fn get_votes(&self) -> HashMap { + self.votes + .iter() + .map(|(account_id, stake)| (account_id.clone(), (*stake).into())) + .collect() + } + + /// Get the timestamp of when the voting finishes. `None` means the voting hasn't ended yet. + pub fn get_result(&self) -> Option { + self.result + } + + /// Returns the deadline timestamp in milliseconds. + pub fn get_deadline_timestamp(&self) -> Timestamp { + self.deadline_timestamp_ms + } + + /// Returns the proposal. + pub fn get_proposal(&self) -> String { + self.proposal.clone() } } -/* - * The rest of this file holds the inline tests for the code above - * Learn more about Rust tests: https://doc.rust-lang.org/book/ch11-01-writing-tests.html - */ + #[cfg(test)] mod tests { use super::*; + use near_sdk::test_utils::{VMContextBuilder, accounts}; + use near_sdk::{env, testing_env, test_vm_config, RuntimeFeesConfig, NearToken, Gas}; + + fn validators() -> HashMap { + (0..10).map(|i| (format!("validator-{}", i), NearToken::from_yoctonear(10))).collect::>() + } + + fn validator(id: u64) -> AccountId { + format!("validator-{}", id).parse().unwrap() + } + + fn get_context(predecessor_account_id: &AccountId) -> VMContextBuilder { + get_context_with_epoch_height(predecessor_account_id, 0) + } + + fn get_context_with_epoch_height( + predecessor_account_id: &AccountId, + epoch_height: EpochHeight, + ) -> VMContextBuilder { + VMContextBuilder::new() + .current_account_id(accounts(0).clone()) + .signer_account_id(accounts(1).clone()) + // .signer_account_pk(vec![0, 1, 2]) + .predecessor_account_id(predecessor_account_id.clone()) + // .block_index(0) + // .block_timestamp(0) + // .account_balance(0) + // .account_locked_balance(0) + .storage_usage(1000) + // .attached_deposit(0) + .prepaid_gas(Gas::from_tgas(200)) + // .random_seed(vec![0, 1, 2]) + .is_view(false) + // .output_data_receivers(vec![]) + .epoch_height(epoch_height) + .clone() + } + + fn setup() -> (Contract, VMContextBuilder) { + let mut context = VMContextBuilder::new(); + + let contract = Contract::new( + "Test proposal".to_string(), + env::block_timestamp_ms() + 1000, // 1 second deadline + ); + + (contract, context) + } + + #[test] + #[should_panic(expected = "is not a validator")] + fn test_nonvalidator_cannot_vote() { + let context = get_context(&validator(3)); + let validators = HashMap::from_iter( + vec![ + (validator(0).to_string(), NearToken::from_yoctonear(100)), + (validator(1).to_string(), NearToken::from_yoctonear(100)), + ] + .into_iter(), + ); + testing_env!(context.build(), test_vm_config(), RuntimeFeesConfig::test(), validators); + let mut contract = Contract::new("Test proposal".to_string(), env::block_timestamp_ms() + 1000); + contract.vote(true); + } + + #[test] + fn test_get_proposal() { + let (contract, _) = setup(); + assert_eq!(contract.get_proposal(), "Test proposal"); + } + + #[test] + fn test_get_deadline_timestamp() { + let (contract, _) = setup(); + assert_eq!(contract.get_deadline_timestamp(), env::block_timestamp_ms() + 1000); + } + + #[test] + #[should_panic(expected = "Proposal cannot be empty")] + fn test_empty_proposal() { + let mut context = VMContextBuilder::new(); + testing_env!(context.build()); + Contract::new("".to_string(), env::block_timestamp_ms() + 1000); + } #[test] - fn get_default_greeting() { - let contract = Contract::default(); - // this test did not call set_greeting so should return the default "Hello" greeting - assert_eq!(contract.get_greeting(), "Hello"); + #[should_panic(expected = "Deadline must be in the future")] + fn test_past_deadline() { + let mut context = VMContextBuilder::new(); + testing_env!(context.build()); + Contract::new("Test proposal".to_string(), env::block_timestamp_ms()); } #[test] - fn set_then_get_greeting() { - let mut contract = Contract::default(); - contract.set_greeting("howdy".to_string()); - assert_eq!(contract.get_greeting(), "howdy"); + #[should_panic(expected = "Voting deadline has already passed")] + fn test_vote_after_deadline() { + let (mut contract, mut context) = setup(); + + // Move time past deadline + testing_env!(context + .block_timestamp(env::block_timestamp_ms() + 2000 * 1_000_000) + .predecessor_account_id(validator(0)) + .build(), + test_vm_config(), + RuntimeFeesConfig::test(), + validators() + ); + + contract.vote(true); } } diff --git a/tests/test_basics.rs b/tests/test_basics.rs index 0f7f130..c9ef9f6 100644 --- a/tests/test_basics.rs +++ b/tests/test_basics.rs @@ -1,30 +1,30 @@ use serde_json::json; -#[tokio::test] -async fn test_contract_is_operational() -> Result<(), Box> { - let contract_wasm = near_workspaces::compile_project("./").await?; +// #[tokio::test] +// async fn test_contract_is_operational() -> Result<(), Box> { +// let contract_wasm = near_workspaces::compile_project("./").await?; - test_basics_on(&contract_wasm).await?; - Ok(()) -} +// test_basics_on(&contract_wasm).await?; +// Ok(()) +// } -async fn test_basics_on(contract_wasm: &[u8]) -> Result<(), Box> { - let sandbox = near_workspaces::sandbox().await?; - let contract = sandbox.dev_deploy(contract_wasm).await?; +// async fn test_basics_on(contract_wasm: &[u8]) -> Result<(), Box> { +// let sandbox = near_workspaces::sandbox().await?; +// let contract = sandbox.dev_deploy(contract_wasm).await?; - let user_account = sandbox.dev_create_account().await?; +// let user_account = sandbox.dev_create_account().await?; - let outcome = user_account - .call(contract.id(), "set_greeting") - .args_json(json!({"greeting": "Hello World!"})) - .transact() - .await?; - assert!(outcome.is_success(), "{:#?}", outcome.into_result().unwrap_err()); +// let outcome = user_account +// .call(contract.id(), "set_greeting") +// .args_json(json!({"greeting": "Hello World!"})) +// .transact() +// .await?; +// assert!(outcome.is_success(), "{:#?}", outcome.into_result().unwrap_err()); - let user_message_outcome = contract.view("get_greeting").args_json(json!({})).await?; - assert_eq!(user_message_outcome.json::()?, "Hello World!"); +// let user_message_outcome = contract.view("get_greeting").args_json(json!({})).await?; +// assert_eq!(user_message_outcome.json::()?, "Hello World!"); - Ok(()) -} +// Ok(()) +// } From ef1cd4eb6d94ab57036e56832f8ba7c62e54b8a3 Mon Sep 17 00:00:00 2001 From: Linguists <95207870+linguists@users.noreply.github.com> Date: Mon, 12 May 2025 16:15:45 +0800 Subject: [PATCH 03/16] test: add unit tests --- src/lib.rs | 132 +++++++++++++++- src/voting.rs | 360 ------------------------------------------- tests/test_basics.rs | 2 +- 3 files changed, 130 insertions(+), 364 deletions(-) delete mode 100644 src/voting.rs diff --git a/src/lib.rs b/src/lib.rs index 5a57a4a..8ad01ba 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -175,7 +175,7 @@ mod tests { } fn setup() -> (Contract, VMContextBuilder) { - let mut context = VMContextBuilder::new(); + let context = VMContextBuilder::new(); let contract = Contract::new( "Test proposal".to_string(), @@ -201,6 +201,132 @@ mod tests { contract.vote(true); } + #[test] + #[should_panic(expected = "Voting has already completed")] + fn test_vote_again_after_voting_ends() { + // Setup validator and context + let validator_id = validator(0); + let context = get_context(&validator_id); + let validators = HashMap::from_iter(vec![(validator_id.to_string(), NearToken::from_yoctonear(100))].into_iter()); + testing_env!(context.build(), test_vm_config(), RuntimeFeesConfig::test(), validators); + let mut contract = Contract::new("Test proposal".to_string(), env::block_timestamp_ms() + 1000); + contract.vote(true); + assert!(contract.get_result().is_some()); + contract.vote(true); // Should panic because voting has ended + } + + #[test] + fn test_voting_simple() { + let validators: HashMap = (0..10) + .map(|i| (format!("validator-{}", i), NearToken::from_yoctonear(10))) + .collect(); + let context = get_context(&validator(0)); + testing_env!(context.build(), test_vm_config(), RuntimeFeesConfig::test(), validators.clone()); + let mut contract = Contract::new("Test proposal".to_string(), env::block_timestamp_ms() + 1000); + + for i in 0..7 { + let voter = validator(i); + let context = get_context(&voter); + testing_env!(context.build(), test_vm_config(), RuntimeFeesConfig::test(), validators.clone()); + contract.vote(true); + // Simulate view context (not strictly necessary for this contract, but for parity with original) + // let mut context = get_context(&voter); + // context.is_view = true; + // testing_env!(context.build(), test_vm_config(), RuntimeFeesConfig::test(), validators.clone()); + assert_eq!( + contract.get_total_voted_stake(), + (U128::from(10 * (i + 1) as u128), U128::from(100)) + ); + let expected_votes: HashMap = (0..=i) + .map(|j| (validator(j), U128::from(10))) + .collect(); + assert_eq!(contract.get_votes(), expected_votes); + assert_eq!(contract.get_votes().len() as u64, i + 1); + if i < 6 { + assert!(contract.get_result().is_none()); + } else { + assert!(contract.get_result().is_some()); + } + } + } + + #[test] + fn test_voting_with_epoch_change() { + let validators: HashMap = (0..10) + .map(|i| (format!("validator-{}", i), NearToken::from_yoctonear(10))) + .collect(); + let context = get_context(&validator(0)); + testing_env!(context.build(), test_vm_config(), RuntimeFeesConfig::test(), validators.clone()); + let mut contract = Contract::new("Test proposal".to_string(), env::block_timestamp_ms() + 1000); + + for i in 0..7 { + let voter = validator(i); + let context = get_context_with_epoch_height(&voter, i); + testing_env!(context.build(), test_vm_config(), RuntimeFeesConfig::test(), validators.clone()); + contract.vote(true); + assert_eq!(contract.get_votes().len() as u64, i + 1); + if i < 6 { + assert!(contract.get_result().is_none()); + } else { + assert!(contract.get_result().is_some()); + } + } + } + + #[test] + fn test_validator_stake_change() { + let mut validators: HashMap = HashMap::from_iter(vec![ + (validator(1).to_string(), NearToken::from_yoctonear(40)), + (validator(2).to_string(), NearToken::from_yoctonear(10)), + (validator(3).to_string(), NearToken::from_yoctonear(10)), + ]); + let context = get_context_with_epoch_height(&validator(1), 1); + testing_env!(context.build(), test_vm_config(), RuntimeFeesConfig::test(), validators.clone()); + let mut contract = Contract::new("Test proposal".to_string(), env::block_timestamp_ms() + 1000); + contract.vote(true); + validators.insert(validator(1).to_string(), NearToken::from_yoctonear(50)); + let context = get_context_with_epoch_height(&validator(2), 2); + testing_env!(context.build(), test_vm_config(), RuntimeFeesConfig::test(), validators.clone()); + contract.ping(); + assert!(contract.get_result().is_some()); + } + + #[test] + fn test_withdraw_votes() { + let validators: HashMap = HashMap::from_iter(vec![ + (validator(1).to_string(), NearToken::from_yoctonear(10)), + (validator(2).to_string(), NearToken::from_yoctonear(10)), + ]); + let context = get_context_with_epoch_height(&validator(1), 1); + testing_env!(context.build(), test_vm_config(), RuntimeFeesConfig::test(), validators.clone()); + let mut contract = Contract::new("Test proposal".to_string(), env::block_timestamp_ms() + 1000); + contract.vote(true); + assert_eq!(contract.get_votes().len(), 1); + let context = get_context_with_epoch_height(&validator(1), 2); + testing_env!(context.build(), test_vm_config(), RuntimeFeesConfig::test(), validators.clone()); + contract.vote(false); + assert!(contract.get_votes().is_empty()); + } + + #[test] + fn test_validator_kick_out() { + let mut validators: HashMap = HashMap::from_iter(vec![ + (validator(1).to_string(), NearToken::from_yoctonear(40)), + (validator(2).to_string(), NearToken::from_yoctonear(10)), + (validator(3).to_string(), NearToken::from_yoctonear(10)), + ]); + let context = get_context_with_epoch_height(&validator(1), 1); + testing_env!(context.build(), test_vm_config(), RuntimeFeesConfig::test(), validators.clone()); + let mut contract = Contract::new("Test proposal".to_string(), env::block_timestamp_ms() + 1000); + contract.vote(true); + assert_eq!((contract.get_total_voted_stake().0).0, 40); + validators.remove(&validator(1).to_string()); + let context = get_context_with_epoch_height(&validator(2), 2); + testing_env!(context.build(), test_vm_config(), RuntimeFeesConfig::test(), validators.clone()); + contract.ping(); + assert_eq!((contract.get_total_voted_stake().0).0, 0); + } + #[test] fn test_get_proposal() { let (contract, _) = setup(); @@ -216,7 +342,7 @@ mod tests { #[test] #[should_panic(expected = "Proposal cannot be empty")] fn test_empty_proposal() { - let mut context = VMContextBuilder::new(); + let context = VMContextBuilder::new(); testing_env!(context.build()); Contract::new("".to_string(), env::block_timestamp_ms() + 1000); } @@ -224,7 +350,7 @@ mod tests { #[test] #[should_panic(expected = "Deadline must be in the future")] fn test_past_deadline() { - let mut context = VMContextBuilder::new(); + let context = VMContextBuilder::new(); testing_env!(context.build()); Contract::new("Test proposal".to_string(), env::block_timestamp_ms()); } diff --git a/src/voting.rs b/src/voting.rs deleted file mode 100644 index f79ad09..0000000 --- a/src/voting.rs +++ /dev/null @@ -1,360 +0,0 @@ -use near_sdk::borsh::{self, BorshDeserialize, BorshSerialize}; -use near_sdk::json_types::{U128, U64}; -use near_sdk::{env, near_bindgen, AccountId, Balance, EpochHeight}; -use std::collections::HashMap; - -#[global_allocator] -static ALLOC: near_sdk::wee_alloc::WeeAlloc = near_sdk::wee_alloc::WeeAlloc::INIT; - -type WrappedTimestamp = U64; - -/// Voting contract for unlocking transfers. Once the majority of the stake holders agree to -/// unlock transfer, the time will be recorded and the voting ends. -#[near_bindgen] -#[derive(BorshDeserialize, BorshSerialize)] -pub struct VotingContract { - /// How much each validator votes - votes: HashMap, - /// Total voted balance so far. - total_voted_stake: Balance, - /// When the voting ended. `None` means the poll is still open. - result: Option, - /// Epoch height when the contract is touched last time. - last_epoch_height: EpochHeight, -} - -impl Default for VotingContract { - fn default() -> Self { - env::panic(b"Voting contract should be initialized before usage") - } -} - -#[near_bindgen] -impl VotingContract { - #[init] - pub fn new() -> Self { - assert!(!env::state_exists(), "The contract is already initialized"); - VotingContract { - votes: HashMap::new(), - total_voted_stake: 0, - result: None, - last_epoch_height: 0, - } - } - - /// Ping to update the votes according to current stake of validators. - pub fn ping(&mut self) { - assert!(self.result.is_none(), "Voting has already ended"); - let cur_epoch_height = env::epoch_height(); - if cur_epoch_height != self.last_epoch_height { - let votes = std::mem::take(&mut self.votes); - self.total_voted_stake = 0; - for (account_id, _) in votes { - let account_current_stake = env::validator_stake(&account_id); - self.total_voted_stake += account_current_stake; - if account_current_stake > 0 { - self.votes.insert(account_id, account_current_stake); - } - } - self.check_result(); - self.last_epoch_height = cur_epoch_height; - } - } - - /// Check whether the voting has ended. - fn check_result(&mut self) { - assert!( - self.result.is_none(), - "check result is called after result is already set" - ); - let total_stake = env::validator_total_stake(); - if self.total_voted_stake > 2 * total_stake / 3 { - self.result = Some(U64::from(env::block_timestamp())); - } - } - - /// Method for validators to vote or withdraw the vote. - /// Votes for if `is_vote` is true, or withdraws the vote if `is_vote` is false. - pub fn vote(&mut self, is_vote: bool) { - self.ping(); - if self.result.is_some() { - return; - } - let account_id = env::predecessor_account_id(); - let account_stake = if is_vote { - let stake = env::validator_stake(&account_id); - assert!(stake > 0, "{} is not a validator", account_id); - stake - } else { - 0 - }; - let voted_stake = self.votes.remove(&account_id).unwrap_or_default(); - assert!( - voted_stake <= self.total_voted_stake, - "invariant: voted stake {} is more than total voted stake {}", - voted_stake, - self.total_voted_stake - ); - self.total_voted_stake = self.total_voted_stake + account_stake - voted_stake; - if account_stake > 0 { - self.votes.insert(account_id, account_stake); - self.check_result(); - } - } - - /// Get the timestamp of when the voting finishes. `None` means the voting hasn't ended yet. - pub fn get_result(&self) -> Option { - self.result.clone() - } - - /// Returns current a pair of `total_voted_stake` and the total stake. - /// Note: as a view method, it doesn't recompute the active stake. May need to call `ping` to - /// update the active stake. - pub fn get_total_voted_stake(&self) -> (U128, U128) { - ( - self.total_voted_stake.into(), - env::validator_total_stake().into(), - ) - } - - /// Returns all active votes. - /// Note: as a view method, it doesn't recompute the active stake. May need to call `ping` to - /// update the active stake. - pub fn get_votes(&self) -> HashMap { - self.votes - .iter() - .map(|(account_id, stake)| (account_id.clone(), (*stake).into())) - .collect() - } -} - -#[cfg(not(target_arch = "wasm32"))] -#[cfg(test)] -mod tests { - use super::*; - use near_sdk::MockedBlockchain; - use near_sdk::{testing_env, VMContext}; - use std::collections::HashMap; - use std::iter::FromIterator; - - fn get_context(predecessor_account_id: AccountId) -> VMContext { - get_context_with_epoch_height(predecessor_account_id, 0) - } - - fn get_context_with_epoch_height( - predecessor_account_id: AccountId, - epoch_height: EpochHeight, - ) -> VMContext { - VMContext { - current_account_id: "alice_near".to_string(), - signer_account_id: "bob_near".to_string(), - signer_account_pk: vec![0, 1, 2], - predecessor_account_id, - input: vec![], - block_index: 0, - block_timestamp: 0, - account_balance: 0, - account_locked_balance: 0, - storage_usage: 1000, - attached_deposit: 0, - prepaid_gas: 2 * 10u64.pow(14), - random_seed: vec![0, 1, 2], - is_view: false, - output_data_receivers: vec![], - epoch_height, - } - } - - #[test] - #[should_panic(expected = "is not a validator")] - fn test_nonvalidator_cannot_vote() { - let context = get_context("bob.near".to_string()); - let validators = HashMap::from_iter( - vec![ - ("alice_near".to_string(), 100), - ("bob_near".to_string(), 100), - ] - .into_iter(), - ); - testing_env!(context, Default::default(), Default::default(), validators); - let mut contract = VotingContract::new(); - contract.vote(true); - } - - #[test] - #[should_panic(expected = "Voting has already ended")] - fn test_vote_again_after_voting_ends() { - let context = get_context("alice.near".to_string()); - let validators = HashMap::from_iter(vec![("alice.near".to_string(), 100)].into_iter()); - testing_env!(context, Default::default(), Default::default(), validators); - let mut contract = VotingContract::new(); - contract.vote(true); - assert!(contract.result.is_some()); - contract.vote(true); - } - - #[test] - fn test_voting_simple() { - let context = get_context("test0".to_string()); - let validators = (0..10) - .map(|i| (format!("test{}", i), 10)) - .collect::>(); - testing_env!( - context, - Default::default(), - Default::default(), - validators.clone() - ); - let mut contract = VotingContract::new(); - - for i in 0..7 { - let mut context = get_context(format!("test{}", i)); - testing_env!( - context.clone(), - Default::default(), - Default::default(), - validators.clone() - ); - contract.vote(true); - context.is_view = true; - testing_env!( - context, - Default::default(), - Default::default(), - validators.clone() - ); - assert_eq!( - contract.get_total_voted_stake(), - (U128::from(10 * (i + 1)), U128::from(100)) - ); - assert_eq!( - contract.get_votes(), - (0..=i) - .map(|i| (format!("test{}", i), U128::from(10))) - .collect::>() - ); - assert_eq!(contract.votes.len() as u128, i + 1); - if i < 6 { - assert!(contract.result.is_none()); - } else { - assert!(contract.result.is_some()); - } - } - } - - #[test] - fn test_voting_with_epoch_change() { - let validators = (0..10) - .map(|i| (format!("test{}", i), 10)) - .collect::>(); - let context = get_context("test0".to_string()); - testing_env!( - context, - Default::default(), - Default::default(), - validators.clone() - ); - let mut contract = VotingContract::new(); - - for i in 0..7 { - let context = get_context_with_epoch_height(format!("test{}", i), i); - testing_env!( - context, - Default::default(), - Default::default(), - validators.clone() - ); - contract.vote(true); - assert_eq!(contract.votes.len() as u64, i + 1); - if i < 6 { - assert!(contract.result.is_none()); - } else { - assert!(contract.result.is_some()); - } - } - } - - #[test] - fn test_validator_stake_change() { - let mut validators = HashMap::from_iter(vec![ - ("test1".to_string(), 40), - ("test2".to_string(), 10), - ("test3".to_string(), 10), - ]); - let context = get_context_with_epoch_height("test1".to_string(), 1); - testing_env!( - context, - Default::default(), - Default::default(), - validators.clone() - ); - - let mut contract = VotingContract::new(); - contract.vote(true); - validators.insert("test1".to_string(), 50); - let context = get_context_with_epoch_height("test2".to_string(), 2); - testing_env!( - context, - Default::default(), - Default::default(), - validators.clone() - ); - contract.ping(); - assert!(contract.result.is_some()); - } - - #[test] - fn test_withdraw_votes() { - let validators = - HashMap::from_iter(vec![("test1".to_string(), 10), ("test2".to_string(), 10)]); - let context = get_context_with_epoch_height("test1".to_string(), 1); - testing_env!( - context, - Default::default(), - Default::default(), - validators.clone() - ); - let mut contract = VotingContract::new(); - contract.vote(true); - assert_eq!(contract.votes.len(), 1); - let context = get_context_with_epoch_height("test1".to_string(), 2); - testing_env!( - context, - Default::default(), - Default::default(), - validators.clone() - ); - contract.vote(false); - assert!(contract.votes.is_empty()); - } - - #[test] - fn test_validator_kick_out() { - let mut validators = HashMap::from_iter(vec![ - ("test1".to_string(), 40), - ("test2".to_string(), 10), - ("test3".to_string(), 10), - ]); - let context = get_context_with_epoch_height("test1".to_string(), 1); - testing_env!( - context, - Default::default(), - Default::default(), - validators.clone() - ); - - let mut contract = VotingContract::new(); - contract.vote(true); - assert_eq!((contract.get_total_voted_stake().0).0, 40); - validators.remove(&"test1".to_string()); - let context = get_context_with_epoch_height("test2".to_string(), 2); - testing_env!( - context, - Default::default(), - Default::default(), - validators.clone() - ); - contract.ping(); - assert_eq!((contract.get_total_voted_stake().0).0, 0); - } -} diff --git a/tests/test_basics.rs b/tests/test_basics.rs index c9ef9f6..211bdb0 100644 --- a/tests/test_basics.rs +++ b/tests/test_basics.rs @@ -1,4 +1,4 @@ -use serde_json::json; +// use serde_json::json; // #[tokio::test] // async fn test_contract_is_operational() -> Result<(), Box> { From 2c9f9518e04310de824e724cacbf02d70edae91a Mon Sep 17 00:00:00 2001 From: Linguists <95207870+linguists@users.noreply.github.com> Date: Tue, 13 May 2025 12:04:25 +0800 Subject: [PATCH 04/16] fix: disallow ping after deadline --- src/lib.rs | 64 +++++++++++++++++++++++++++++------------------------- 1 file changed, 34 insertions(+), 30 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 8ad01ba..0dc81ac 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -35,8 +35,42 @@ impl Contract { } } + /// Method for validators to vote or withdraw the vote. + /// Votes for if `is_vote` is true, or withdraws the vote if `is_vote` is false. + pub fn vote(&mut self, is_vote: bool) { + require!( + env::block_timestamp_ms() < self.deadline_timestamp_ms, + "Voting deadline has already passed" + ); + require!(self.result.is_none(), "Voting has already completed"); + + self.ping(); + let account_id = env::predecessor_account_id(); + let account_stake = if is_vote { + let stake = env::validator_stake(&account_id).as_yoctonear(); + require!(stake > 0, format!("{} is not a validator", account_id)); + stake + } else { + 0 + }; + let voted_stake = self.votes.remove(&account_id).unwrap_or_default(); + require!( + voted_stake <= self.total_voted_stake, + format!("invariant: voted stake {} is more than total voted stake {}", voted_stake, self.total_voted_stake) + ); + self.total_voted_stake = self.total_voted_stake + account_stake - voted_stake; + if account_stake > 0 { + self.votes.insert(account_id, account_stake); + self.check_result(); + } + } + /// Ping to update the votes according to current stake of validators. pub fn ping(&mut self) { + require!( + env::block_timestamp_ms() < self.deadline_timestamp_ms, + "Voting deadline has already passed" + ); require!(self.result.is_none(), "Voting has already ended"); let cur_epoch_height = env::epoch_height(); if cur_epoch_height != self.last_epoch_height { @@ -66,36 +100,6 @@ impl Contract { } } - /// Method for validators to vote or withdraw the vote. - /// Votes for if `is_vote` is true, or withdraws the vote if `is_vote` is false. - pub fn vote(&mut self, is_vote: bool) { - require!( - env::block_timestamp_ms() < self.deadline_timestamp_ms, - "Voting deadline has already passed" - ); - require!(self.result.is_none(), "Voting has already completed"); - - self.ping(); - let account_id = env::predecessor_account_id(); - let account_stake = if is_vote { - let stake = env::validator_stake(&account_id).as_yoctonear(); - require!(stake > 0, format!("{} is not a validator", account_id)); - stake - } else { - 0 - }; - let voted_stake = self.votes.remove(&account_id).unwrap_or_default(); - require!( - voted_stake <= self.total_voted_stake, - format!("invariant: voted stake {} is more than total voted stake {}", voted_stake, self.total_voted_stake) - ); - self.total_voted_stake = self.total_voted_stake + account_stake - voted_stake; - if account_stake > 0 { - self.votes.insert(account_id, account_stake); - self.check_result(); - } - } - /// Returns current a pair of `total_voted_stake` and the total stake. /// Note: as a view method, it doesn't recompute the active stake. May need to call `ping` to /// update the active stake. From e7df2c8aaa596f4c20da857a6f3c2737b3ca6248 Mon Sep 17 00:00:00 2001 From: Linguists <95207870+linguists@users.noreply.github.com> Date: Tue, 13 May 2025 12:08:04 +0800 Subject: [PATCH 05/16] style: cargo fmt --- src/lib.rs | 169 +++++++++++++++++++++++++++++++++---------- tests/test_basics.rs | 2 - 2 files changed, 131 insertions(+), 40 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 0dc81ac..c12e2fc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,6 +1,6 @@ -use near_sdk::{near, env, require, Timestamp, AccountId, EpochHeight}; -use std::collections::HashMap; use near_sdk::json_types::U128; +use near_sdk::{env, near, require, AccountId, EpochHeight, Timestamp}; +use std::collections::HashMap; type Balance = u128; @@ -24,7 +24,10 @@ impl Contract { #[private] pub fn new(proposal: String, deadline_timestamp_ms: Timestamp) -> Self { require!(!proposal.is_empty(), "Proposal cannot be empty"); - require!(deadline_timestamp_ms > env::block_timestamp_ms(), "Deadline must be in the future"); + require!( + deadline_timestamp_ms > env::block_timestamp_ms(), + "Deadline must be in the future" + ); Contract { proposal, deadline_timestamp_ms, @@ -56,7 +59,10 @@ impl Contract { let voted_stake = self.votes.remove(&account_id).unwrap_or_default(); require!( voted_stake <= self.total_voted_stake, - format!("invariant: voted stake {} is more than total voted stake {}", voted_stake, self.total_voted_stake) + format!( + "invariant: voted stake {} is more than total voted stake {}", + voted_stake, self.total_voted_stake + ) ); self.total_voted_stake = self.total_voted_stake + account_stake - voted_stake; if account_stake > 0 { @@ -136,15 +142,16 @@ impl Contract { } } - #[cfg(test)] mod tests { use super::*; - use near_sdk::test_utils::{VMContextBuilder, accounts}; - use near_sdk::{env, testing_env, test_vm_config, RuntimeFeesConfig, NearToken, Gas}; + use near_sdk::test_utils::{accounts, VMContextBuilder}; + use near_sdk::{env, test_vm_config, testing_env, Gas, NearToken, RuntimeFeesConfig}; fn validators() -> HashMap { - (0..10).map(|i| (format!("validator-{}", i), NearToken::from_yoctonear(10))).collect::>() + (0..10) + .map(|i| (format!("validator-{}", i), NearToken::from_yoctonear(10))) + .collect::>() } fn validator(id: u64) -> AccountId { @@ -185,7 +192,7 @@ mod tests { "Test proposal".to_string(), env::block_timestamp_ms() + 1000, // 1 second deadline ); - + (contract, context) } @@ -200,8 +207,16 @@ mod tests { ] .into_iter(), ); - testing_env!(context.build(), test_vm_config(), RuntimeFeesConfig::test(), validators); - let mut contract = Contract::new("Test proposal".to_string(), env::block_timestamp_ms() + 1000); + testing_env!( + context.build(), + test_vm_config(), + RuntimeFeesConfig::test(), + validators + ); + let mut contract = Contract::new( + "Test proposal".to_string(), + env::block_timestamp_ms() + 1000, + ); contract.vote(true); } @@ -211,9 +226,19 @@ mod tests { // Setup validator and context let validator_id = validator(0); let context = get_context(&validator_id); - let validators = HashMap::from_iter(vec![(validator_id.to_string(), NearToken::from_yoctonear(100))].into_iter()); - testing_env!(context.build(), test_vm_config(), RuntimeFeesConfig::test(), validators); - let mut contract = Contract::new("Test proposal".to_string(), env::block_timestamp_ms() + 1000); + let validators = HashMap::from_iter( + vec![(validator_id.to_string(), NearToken::from_yoctonear(100))].into_iter(), + ); + testing_env!( + context.build(), + test_vm_config(), + RuntimeFeesConfig::test(), + validators + ); + let mut contract = Contract::new( + "Test proposal".to_string(), + env::block_timestamp_ms() + 1000, + ); contract.vote(true); assert!(contract.get_result().is_some()); contract.vote(true); // Should panic because voting has ended @@ -225,13 +250,26 @@ mod tests { .map(|i| (format!("validator-{}", i), NearToken::from_yoctonear(10))) .collect(); let context = get_context(&validator(0)); - testing_env!(context.build(), test_vm_config(), RuntimeFeesConfig::test(), validators.clone()); - let mut contract = Contract::new("Test proposal".to_string(), env::block_timestamp_ms() + 1000); + testing_env!( + context.build(), + test_vm_config(), + RuntimeFeesConfig::test(), + validators.clone() + ); + let mut contract = Contract::new( + "Test proposal".to_string(), + env::block_timestamp_ms() + 1000, + ); for i in 0..7 { let voter = validator(i); let context = get_context(&voter); - testing_env!(context.build(), test_vm_config(), RuntimeFeesConfig::test(), validators.clone()); + testing_env!( + context.build(), + test_vm_config(), + RuntimeFeesConfig::test(), + validators.clone() + ); contract.vote(true); // Simulate view context (not strictly necessary for this contract, but for parity with original) // let mut context = get_context(&voter); @@ -241,9 +279,8 @@ mod tests { contract.get_total_voted_stake(), (U128::from(10 * (i + 1) as u128), U128::from(100)) ); - let expected_votes: HashMap = (0..=i) - .map(|j| (validator(j), U128::from(10))) - .collect(); + let expected_votes: HashMap = + (0..=i).map(|j| (validator(j), U128::from(10))).collect(); assert_eq!(contract.get_votes(), expected_votes); assert_eq!(contract.get_votes().len() as u64, i + 1); if i < 6 { @@ -260,13 +297,26 @@ mod tests { .map(|i| (format!("validator-{}", i), NearToken::from_yoctonear(10))) .collect(); let context = get_context(&validator(0)); - testing_env!(context.build(), test_vm_config(), RuntimeFeesConfig::test(), validators.clone()); - let mut contract = Contract::new("Test proposal".to_string(), env::block_timestamp_ms() + 1000); + testing_env!( + context.build(), + test_vm_config(), + RuntimeFeesConfig::test(), + validators.clone() + ); + let mut contract = Contract::new( + "Test proposal".to_string(), + env::block_timestamp_ms() + 1000, + ); for i in 0..7 { let voter = validator(i); let context = get_context_with_epoch_height(&voter, i); - testing_env!(context.build(), test_vm_config(), RuntimeFeesConfig::test(), validators.clone()); + testing_env!( + context.build(), + test_vm_config(), + RuntimeFeesConfig::test(), + validators.clone() + ); contract.vote(true); assert_eq!(contract.get_votes().len() as u64, i + 1); if i < 6 { @@ -285,12 +335,25 @@ mod tests { (validator(3).to_string(), NearToken::from_yoctonear(10)), ]); let context = get_context_with_epoch_height(&validator(1), 1); - testing_env!(context.build(), test_vm_config(), RuntimeFeesConfig::test(), validators.clone()); - let mut contract = Contract::new("Test proposal".to_string(), env::block_timestamp_ms() + 1000); + testing_env!( + context.build(), + test_vm_config(), + RuntimeFeesConfig::test(), + validators.clone() + ); + let mut contract = Contract::new( + "Test proposal".to_string(), + env::block_timestamp_ms() + 1000, + ); contract.vote(true); validators.insert(validator(1).to_string(), NearToken::from_yoctonear(50)); let context = get_context_with_epoch_height(&validator(2), 2); - testing_env!(context.build(), test_vm_config(), RuntimeFeesConfig::test(), validators.clone()); + testing_env!( + context.build(), + test_vm_config(), + RuntimeFeesConfig::test(), + validators.clone() + ); contract.ping(); assert!(contract.get_result().is_some()); } @@ -302,12 +365,25 @@ mod tests { (validator(2).to_string(), NearToken::from_yoctonear(10)), ]); let context = get_context_with_epoch_height(&validator(1), 1); - testing_env!(context.build(), test_vm_config(), RuntimeFeesConfig::test(), validators.clone()); - let mut contract = Contract::new("Test proposal".to_string(), env::block_timestamp_ms() + 1000); + testing_env!( + context.build(), + test_vm_config(), + RuntimeFeesConfig::test(), + validators.clone() + ); + let mut contract = Contract::new( + "Test proposal".to_string(), + env::block_timestamp_ms() + 1000, + ); contract.vote(true); assert_eq!(contract.get_votes().len(), 1); let context = get_context_with_epoch_height(&validator(1), 2); - testing_env!(context.build(), test_vm_config(), RuntimeFeesConfig::test(), validators.clone()); + testing_env!( + context.build(), + test_vm_config(), + RuntimeFeesConfig::test(), + validators.clone() + ); contract.vote(false); assert!(contract.get_votes().is_empty()); } @@ -320,13 +396,26 @@ mod tests { (validator(3).to_string(), NearToken::from_yoctonear(10)), ]); let context = get_context_with_epoch_height(&validator(1), 1); - testing_env!(context.build(), test_vm_config(), RuntimeFeesConfig::test(), validators.clone()); - let mut contract = Contract::new("Test proposal".to_string(), env::block_timestamp_ms() + 1000); + testing_env!( + context.build(), + test_vm_config(), + RuntimeFeesConfig::test(), + validators.clone() + ); + let mut contract = Contract::new( + "Test proposal".to_string(), + env::block_timestamp_ms() + 1000, + ); contract.vote(true); assert_eq!((contract.get_total_voted_stake().0).0, 40); validators.remove(&validator(1).to_string()); let context = get_context_with_epoch_height(&validator(2), 2); - testing_env!(context.build(), test_vm_config(), RuntimeFeesConfig::test(), validators.clone()); + testing_env!( + context.build(), + test_vm_config(), + RuntimeFeesConfig::test(), + validators.clone() + ); contract.ping(); assert_eq!((contract.get_total_voted_stake().0).0, 0); } @@ -340,7 +429,10 @@ mod tests { #[test] fn test_get_deadline_timestamp() { let (contract, _) = setup(); - assert_eq!(contract.get_deadline_timestamp(), env::block_timestamp_ms() + 1000); + assert_eq!( + contract.get_deadline_timestamp(), + env::block_timestamp_ms() + 1000 + ); } #[test] @@ -365,15 +457,16 @@ mod tests { let (mut contract, mut context) = setup(); // Move time past deadline - testing_env!(context - .block_timestamp(env::block_timestamp_ms() + 2000 * 1_000_000) - .predecessor_account_id(validator(0)) - .build(), + testing_env!( + context + .block_timestamp(env::block_timestamp_ms() + 2000 * 1_000_000) + .predecessor_account_id(validator(0)) + .build(), test_vm_config(), RuntimeFeesConfig::test(), validators() ); - + contract.vote(true); } } diff --git a/tests/test_basics.rs b/tests/test_basics.rs index 211bdb0..b79cecc 100644 --- a/tests/test_basics.rs +++ b/tests/test_basics.rs @@ -26,5 +26,3 @@ // Ok(()) // } - - From 7f8a16d32600f38f520d0cd740e51d0a382738da Mon Sep 17 00:00:00 2001 From: Linguists <95207870+linguists@users.noreply.github.com> Date: Tue, 13 May 2025 12:15:10 +0800 Subject: [PATCH 06/16] style: cargo clippy fix --- src/lib.rs | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index c12e2fc..8b415ef 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -28,7 +28,7 @@ impl Contract { deadline_timestamp_ms > env::block_timestamp_ms(), "Deadline must be in the future" ); - Contract { + Self { proposal, deadline_timestamp_ms, votes: HashMap::new(), @@ -127,12 +127,12 @@ impl Contract { } /// Get the timestamp of when the voting finishes. `None` means the voting hasn't ended yet. - pub fn get_result(&self) -> Option { + pub const fn get_result(&self) -> Option { self.result } /// Returns the deadline timestamp in milliseconds. - pub fn get_deadline_timestamp(&self) -> Timestamp { + pub const fn get_deadline_timestamp(&self) -> Timestamp { self.deadline_timestamp_ms } @@ -167,8 +167,8 @@ mod tests { epoch_height: EpochHeight, ) -> VMContextBuilder { VMContextBuilder::new() - .current_account_id(accounts(0).clone()) - .signer_account_id(accounts(1).clone()) + .current_account_id(accounts(0)) + .signer_account_id(accounts(1)) // .signer_account_pk(vec![0, 1, 2]) .predecessor_account_id(predecessor_account_id.clone()) // .block_index(0) @@ -200,13 +200,10 @@ mod tests { #[should_panic(expected = "is not a validator")] fn test_nonvalidator_cannot_vote() { let context = get_context(&validator(3)); - let validators = HashMap::from_iter( - vec![ - (validator(0).to_string(), NearToken::from_yoctonear(100)), - (validator(1).to_string(), NearToken::from_yoctonear(100)), - ] - .into_iter(), - ); + let validators = HashMap::from_iter(vec![ + (validator(0).to_string(), NearToken::from_yoctonear(100)), + (validator(1).to_string(), NearToken::from_yoctonear(100)), + ]); testing_env!( context.build(), test_vm_config(), @@ -226,9 +223,10 @@ mod tests { // Setup validator and context let validator_id = validator(0); let context = get_context(&validator_id); - let validators = HashMap::from_iter( - vec![(validator_id.to_string(), NearToken::from_yoctonear(100))].into_iter(), - ); + let validators = HashMap::from_iter(vec![( + validator_id.to_string(), + NearToken::from_yoctonear(100), + )]); testing_env!( context.build(), test_vm_config(), @@ -382,7 +380,7 @@ mod tests { context.build(), test_vm_config(), RuntimeFeesConfig::test(), - validators.clone() + validators ); contract.vote(false); assert!(contract.get_votes().is_empty()); From 9c2ddc528e87b6343701365a67560eb1b3010cdf Mon Sep 17 00:00:00 2001 From: Linguists <95207870+linguists@users.noreply.github.com> Date: Tue, 13 May 2025 14:16:40 +0800 Subject: [PATCH 07/16] chore(ci): add reproducible build --- .github/workflows/build.yml | 19 +++++++++ .github/workflows/deploy-production.yml | 27 ------------ .github/workflows/deploy-staging.yml | 56 ------------------------- .github/workflows/test.yml | 5 ++- .github/workflows/undeploy-staging.yml | 25 ----------- 5 files changed, 23 insertions(+), 109 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/deploy-production.yml delete mode 100644 .github/workflows/deploy-staging.yml delete mode 100644 .github/workflows/undeploy-staging.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..8d29be7 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,19 @@ +name: Build +on: + push: + branches: + - main + pull_request: + +jobs: + build: + name: Build + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Install cargo-near CLI + run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/download/cargo-near-v0.14.2/cargo-near-installer.sh | sh + - name: Build + run: | + cargo near build build-reproducible-wasm diff --git a/.github/workflows/deploy-production.yml b/.github/workflows/deploy-production.yml deleted file mode 100644 index 07ba5a6..0000000 --- a/.github/workflows/deploy-production.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Deploy to production -on: - push: - branches: [main] - -jobs: - test: - uses: ./.github/workflows/test.yml - - deploy-staging: - name: Deploy to production - needs: [test] - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Install cargo-near CLI - run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/download/cargo-near-v0.14.2/cargo-near-installer.sh | sh - - name: Deploy to production - run: | - cargo near deploy build-reproducible-wasm "${{ vars.NEAR_CONTRACT_PRODUCTION_ACCOUNT_ID }}" \ - without-init-call \ - network-config "${{ vars.NEAR_CONTRACT_PRODUCTION_NETWORK }}" \ - sign-with-plaintext-private-key \ - --signer-public-key "${{ vars.NEAR_CONTRACT_PRODUCTION_ACCOUNT_PUBLIC_KEY }}" \ - --signer-private-key "${{ secrets.NEAR_CONTRACT_PRODUCTION_ACCOUNT_PRIVATE_KEY }}" \ - send diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml deleted file mode 100644 index 9832a2a..0000000 --- a/.github/workflows/deploy-staging.yml +++ /dev/null @@ -1,56 +0,0 @@ -name: Deploy to staging -on: - pull_request: - -jobs: - test: - uses: ./.github/workflows/test.yml - - deploy-staging: - name: Deploy to staging subaccount - permissions: - pull-requests: write - needs: [test] - runs-on: ubuntu-latest - env: - NEAR_CONTRACT_PR_STAGING_ACCOUNT_ID: gh-${{ github.event.number }}.${{ vars.NEAR_CONTRACT_STAGING_ACCOUNT_ID }} - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Install near CLI - run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/near-cli-rs/releases/download/v0.11.1/near-cli-rs-installer.sh | sh - - name: Create staging account - if: github.event.action == 'opened' || github.event.action == 'reopened' - run: | - near account create-account fund-myself "${{ env.NEAR_CONTRACT_PR_STAGING_ACCOUNT_ID }}" '10 NEAR' \ - use-manually-provided-public-key "${{ vars.NEAR_CONTRACT_STAGING_ACCOUNT_PUBLIC_KEY }}" \ - sign-as "${{ vars.NEAR_CONTRACT_STAGING_ACCOUNT_ID }}" \ - network-config "${{ vars.NEAR_CONTRACT_STAGING_NETWORK }}" \ - sign-with-plaintext-private-key \ - --signer-public-key "${{ vars.NEAR_CONTRACT_STAGING_ACCOUNT_PUBLIC_KEY }}" \ - --signer-private-key "${{ secrets.NEAR_CONTRACT_STAGING_ACCOUNT_PRIVATE_KEY }}" \ - send - - - name: Install cargo-near CLI - run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/download/cargo-near-v0.14.2/cargo-near-installer.sh | sh - - name: Deploy to staging - # `--skip-git-remote-check` was used - # as pull request git refs `refs/pull/NUMBER/merge` are somewhat harder to access and live only as long as PRs do - # - # WASM reproducibility check akin to SourceScan won't be available for staging contracts, deployed from PRs - run: | - cargo near deploy build-reproducible-wasm --skip-git-remote-check "${{ env.NEAR_CONTRACT_PR_STAGING_ACCOUNT_ID }}" \ - without-init-call \ - network-config "${{ vars.NEAR_CONTRACT_STAGING_NETWORK }}" \ - sign-with-plaintext-private-key \ - --signer-public-key "${{ vars.NEAR_CONTRACT_STAGING_ACCOUNT_PUBLIC_KEY }}" \ - --signer-private-key "${{ secrets.NEAR_CONTRACT_STAGING_ACCOUNT_PRIVATE_KEY }}" \ - send - - - name: Comment on pull request - env: - GH_TOKEN: ${{ github.token }} - run: | - gh pr comment "${{ github.event.number }}" --body "Staging contract is deployed to ["'`'"${{ env.NEAR_CONTRACT_PR_STAGING_ACCOUNT_ID }}"'`'" account](https://explorer.${{ vars.NEAR_CONTRACT_STAGING_NETWORK }}.near.org/accounts/${{ env.NEAR_CONTRACT_PR_STAGING_ACCOUNT_ID }})" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7f847af..973c3d6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,6 +1,9 @@ name: Test on: - workflow_call: + push: + branches: + - main + pull_request: jobs: code-formatting: diff --git a/.github/workflows/undeploy-staging.yml b/.github/workflows/undeploy-staging.yml deleted file mode 100644 index f7d3186..0000000 --- a/.github/workflows/undeploy-staging.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Undeploy staging -on: - pull_request: - types: [closed] - -jobs: - cleanup-staging: - name: Cleanup staging account - runs-on: ubuntu-latest - env: - NEAR_CONTRACT_PR_STAGING_ACCOUNT_ID: gh-${{ github.event.number }}.${{ vars.NEAR_CONTRACT_STAGING_ACCOUNT_ID }} - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - name: Install near CLI - run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/near-cli-rs/releases/download/v0.11.1/near-cli-rs-installer.sh | sh - - name: Remove staging account - run: | - near account delete-account "${{ env.NEAR_CONTRACT_PR_STAGING_ACCOUNT_ID }}" \ - beneficiary "${{ vars.NEAR_CONTRACT_STAGING_ACCOUNT_ID }}" \ - network-config "${{ vars.NEAR_CONTRACT_STAGING_NETWORK }}" \ - sign-with-plaintext-private-key \ - --signer-public-key "${{ vars.NEAR_CONTRACT_STAGING_ACCOUNT_PUBLIC_KEY }}" \ - --signer-private-key "${{ secrets.NEAR_CONTRACT_STAGING_ACCOUNT_PRIVATE_KEY }}" \ - send From 83522e288728121ce1a15c10eef4bceb62adda5f Mon Sep 17 00:00:00 2001 From: Linguists <95207870+linguists@users.noreply.github.com> Date: Tue, 13 May 2025 14:18:15 +0800 Subject: [PATCH 08/16] ci: build command --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8d29be7..0a04d4e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,4 +16,4 @@ jobs: run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/download/cargo-near-v0.14.2/cargo-near-installer.sh | sh - name: Build run: | - cargo near build build-reproducible-wasm + cargo near build reproducible-wasm From 057dd4f90cf7e25d0e00fd13a37f6c18645aa956 Mon Sep 17 00:00:00 2001 From: Linguists <95207870+linguists@users.noreply.github.com> Date: Tue, 13 May 2025 14:25:20 +0800 Subject: [PATCH 09/16] docs: update readme --- README.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/README.md b/README.md index 725caf6..435df04 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # NEAR Validator Voting -The purpose of this contract is for validators to vote on any specific proposal. Validators can call `vote` function to vote for yes or no with the staked amount on the validator. If there are more than 2/3 of the stake at any given moment voting for yes, the voting is done. After the voting is finished, no one can further modify the contract. The voting contract is recommended to be pinged every epoch to make sure the latest stake is updated in the contract. +The purpose of this contract is for validators to vote on any specific proposal. Validators can call `vote` function to vote for yes or no with the staked amount on the validator. If there are more than 2/3 of the stake at any given moment voting for yes, the voting is done. After the voting is finished or the voting deadline has passed, no one can further modify the contract. The voting contract is recommended to be pinged every epoch to make sure the latest stake is updated in the contract. ## Build @@ -18,9 +18,6 @@ cargo test ## Deploy -Deployment is automated with GitHub Actions CI/CD pipeline. -To deploy manually, install [`cargo-near`](https://github.com/near/cargo-near) and run: - ```bash cargo near deploy build-reproducible-wasm ``` From 91dc7cf95d8f3760d68041c061b5fcb3f63e5232 Mon Sep 17 00:00:00 2001 From: Linguists <95207870+linguists@users.noreply.github.com> Date: Tue, 13 May 2025 15:13:59 +0800 Subject: [PATCH 10/16] test: refactor unit tests --- src/lib.rs | 161 +++++++++++++++++++++++++++-------------------------- 1 file changed, 81 insertions(+), 80 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 8b415ef..e24e1e1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -45,7 +45,7 @@ impl Contract { env::block_timestamp_ms() < self.deadline_timestamp_ms, "Voting deadline has already passed" ); - require!(self.result.is_none(), "Voting has already completed"); + require!(self.result.is_none(), "Voting has already ended"); self.ping(); let account_id = env::predecessor_account_id(); @@ -106,7 +106,7 @@ impl Contract { } } - /// Returns current a pair of `total_voted_stake` and the total stake. + /// Returns a pair of `total_voted_stake` and the total stake. /// Note: as a view method, it doesn't recompute the active stake. May need to call `ping` to /// update the active stake. pub fn get_total_voted_stake(&self) -> (U128, U128) { @@ -127,12 +127,12 @@ impl Contract { } /// Get the timestamp of when the voting finishes. `None` means the voting hasn't ended yet. - pub const fn get_result(&self) -> Option { + pub fn get_result(&self) -> Option { self.result } /// Returns the deadline timestamp in milliseconds. - pub const fn get_deadline_timestamp(&self) -> Timestamp { + pub fn get_deadline_timestamp(&self) -> Timestamp { self.deadline_timestamp_ms } @@ -169,31 +169,19 @@ mod tests { VMContextBuilder::new() .current_account_id(accounts(0)) .signer_account_id(accounts(1)) - // .signer_account_pk(vec![0, 1, 2]) .predecessor_account_id(predecessor_account_id.clone()) - // .block_index(0) - // .block_timestamp(0) - // .account_balance(0) - // .account_locked_balance(0) .storage_usage(1000) - // .attached_deposit(0) .prepaid_gas(Gas::from_tgas(200)) - // .random_seed(vec![0, 1, 2]) .is_view(false) - // .output_data_receivers(vec![]) .epoch_height(epoch_height) .clone() } - fn setup() -> (Contract, VMContextBuilder) { - let context = VMContextBuilder::new(); - - let contract = Contract::new( + fn get_contract() -> Contract { + Contract::new( "Test proposal".to_string(), - env::block_timestamp_ms() + 1000, // 1 second deadline - ); - - (contract, context) + env::block_timestamp_ms() + 1000, + ) } #[test] @@ -210,17 +198,13 @@ mod tests { RuntimeFeesConfig::test(), validators ); - let mut contract = Contract::new( - "Test proposal".to_string(), - env::block_timestamp_ms() + 1000, - ); + let mut contract = get_contract(); contract.vote(true); } #[test] - #[should_panic(expected = "Voting has already completed")] + #[should_panic(expected = "Voting has already ended")] fn test_vote_again_after_voting_ends() { - // Setup validator and context let validator_id = validator(0); let context = get_context(&validator_id); let validators = HashMap::from_iter(vec![( @@ -233,54 +217,55 @@ mod tests { RuntimeFeesConfig::test(), validators ); - let mut contract = Contract::new( - "Test proposal".to_string(), - env::block_timestamp_ms() + 1000, - ); + let mut contract = get_contract(); + // vote contract.vote(true); assert!(contract.get_result().is_some()); - contract.vote(true); // Should panic because voting has ended + // vote again. should panic because voting has ended + contract.vote(true); } #[test] fn test_voting_simple() { - let validators: HashMap = (0..10) - .map(|i| (format!("validator-{}", i), NearToken::from_yoctonear(10))) - .collect(); let context = get_context(&validator(0)); testing_env!( context.build(), test_vm_config(), RuntimeFeesConfig::test(), - validators.clone() - ); - let mut contract = Contract::new( - "Test proposal".to_string(), - env::block_timestamp_ms() + 1000, + validators() ); + let mut contract = get_contract(); for i in 0..7 { + // vote by each validator let voter = validator(i); - let context = get_context(&voter); + let mut context = get_context(&voter); testing_env!( context.build(), test_vm_config(), RuntimeFeesConfig::test(), - validators.clone() + validators() ); contract.vote(true); - // Simulate view context (not strictly necessary for this contract, but for parity with original) - // let mut context = get_context(&voter); - // context.is_view = true; - // testing_env!(context.build(), test_vm_config(), RuntimeFeesConfig::test(), validators.clone()); + + // check total voted stake + context.is_view(true); + testing_env!( + context.build(), + test_vm_config(), + RuntimeFeesConfig::test(), + validators() + ); assert_eq!( contract.get_total_voted_stake(), (U128::from(10 * (i + 1) as u128), U128::from(100)) ); + // check votes let expected_votes: HashMap = (0..=i).map(|j| (validator(j), U128::from(10))).collect(); assert_eq!(contract.get_votes(), expected_votes); assert_eq!(contract.get_votes().len() as u64, i + 1); + // check voting result if i < 6 { assert!(contract.get_result().is_none()); } else { @@ -291,32 +276,28 @@ mod tests { #[test] fn test_voting_with_epoch_change() { - let validators: HashMap = (0..10) - .map(|i| (format!("validator-{}", i), NearToken::from_yoctonear(10))) - .collect(); let context = get_context(&validator(0)); testing_env!( context.build(), test_vm_config(), RuntimeFeesConfig::test(), - validators.clone() - ); - let mut contract = Contract::new( - "Test proposal".to_string(), - env::block_timestamp_ms() + 1000, + validators() ); + let mut contract = get_contract(); for i in 0..7 { - let voter = validator(i); - let context = get_context_with_epoch_height(&voter, i); + // vote by each validator + let context = get_context_with_epoch_height(&validator(i), i); testing_env!( context.build(), test_vm_config(), RuntimeFeesConfig::test(), - validators.clone() + validators() ); contract.vote(true); + // check votes assert_eq!(contract.get_votes().len() as u64, i + 1); + // check voting result if i < 6 { assert!(contract.get_result().is_none()); } else { @@ -332,6 +313,7 @@ mod tests { (validator(2).to_string(), NearToken::from_yoctonear(10)), (validator(3).to_string(), NearToken::from_yoctonear(10)), ]); + // vote at epoch 1 let context = get_context_with_epoch_height(&validator(1), 1); testing_env!( context.build(), @@ -339,11 +321,9 @@ mod tests { RuntimeFeesConfig::test(), validators.clone() ); - let mut contract = Contract::new( - "Test proposal".to_string(), - env::block_timestamp_ms() + 1000, - ); + let mut contract = get_contract(); contract.vote(true); + // ping at epoch 2 validators.insert(validator(1).to_string(), NearToken::from_yoctonear(50)); let context = get_context_with_epoch_height(&validator(2), 2); testing_env!( @@ -369,12 +349,11 @@ mod tests { RuntimeFeesConfig::test(), validators.clone() ); - let mut contract = Contract::new( - "Test proposal".to_string(), - env::block_timestamp_ms() + 1000, - ); + let mut contract = get_contract(); + // vote at epoch 1 contract.vote(true); assert_eq!(contract.get_votes().len(), 1); + // withdraw vote at epoch 2 let context = get_context_with_epoch_height(&validator(1), 2); testing_env!( context.build(), @@ -400,12 +379,11 @@ mod tests { RuntimeFeesConfig::test(), validators.clone() ); - let mut contract = Contract::new( - "Test proposal".to_string(), - env::block_timestamp_ms() + 1000, - ); + let mut contract = get_contract(); + // vote at epoch 1 contract.vote(true); assert_eq!((contract.get_total_voted_stake().0).0, 40); + // remove validator at epoch 2 validators.remove(&validator(1).to_string()); let context = get_context_with_epoch_height(&validator(2), 2); testing_env!( @@ -414,19 +392,15 @@ mod tests { RuntimeFeesConfig::test(), validators.clone() ); + // ping will update total voted stake contract.ping(); assert_eq!((contract.get_total_voted_stake().0).0, 0); } #[test] - fn test_get_proposal() { - let (contract, _) = setup(); + fn test_init_contract() { + let contract = get_contract(); assert_eq!(contract.get_proposal(), "Test proposal"); - } - - #[test] - fn test_get_deadline_timestamp() { - let (contract, _) = setup(); assert_eq!( contract.get_deadline_timestamp(), env::block_timestamp_ms() + 1000 @@ -435,7 +409,7 @@ mod tests { #[test] #[should_panic(expected = "Proposal cannot be empty")] - fn test_empty_proposal() { + fn test_init_with_empty_proposal() { let context = VMContextBuilder::new(); testing_env!(context.build()); Contract::new("".to_string(), env::block_timestamp_ms() + 1000); @@ -443,7 +417,7 @@ mod tests { #[test] #[should_panic(expected = "Deadline must be in the future")] - fn test_past_deadline() { + fn test_init_with_past_deadline() { let context = VMContextBuilder::new(); testing_env!(context.build()); Contract::new("Test proposal".to_string(), env::block_timestamp_ms()); @@ -452,19 +426,46 @@ mod tests { #[test] #[should_panic(expected = "Voting deadline has already passed")] fn test_vote_after_deadline() { - let (mut contract, mut context) = setup(); + let mut contract = get_contract(); + let mut context = get_context(&validator(0)); - // Move time past deadline + // vote after deadline testing_env!( context .block_timestamp(env::block_timestamp_ms() + 2000 * 1_000_000) - .predecessor_account_id(validator(0)) .build(), test_vm_config(), RuntimeFeesConfig::test(), validators() ); + contract.vote(true); + } + + #[test] + #[should_panic(expected = "Voting deadline has already passed")] + fn test_ping_after_deadline() { + let mut contract = get_contract(); + let mut context = get_context(&validator(0)); + // vote at epoch 1 + testing_env!( + context.build(), + test_vm_config(), + RuntimeFeesConfig::test(), + validators() + ); contract.vote(true); + + // ping at epoch 2 after deadline + testing_env!( + context + .block_timestamp(env::block_timestamp_ms() + 2000 * 1_000_000) + .epoch_height(2) + .build(), + test_vm_config(), + RuntimeFeesConfig::test(), + validators() + ); + contract.ping(); } } From ad493d056bea2ee500cbdf447dd690032bf6a058 Mon Sep 17 00:00:00 2001 From: Linguists <95207870+linguists@users.noreply.github.com> Date: Tue, 13 May 2025 15:38:11 +0800 Subject: [PATCH 11/16] test: refactor set context --- src/lib.rs | 142 ++++++++++++++++------------------------------------- 1 file changed, 41 insertions(+), 101 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index e24e1e1..6a25adc 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -184,6 +184,27 @@ mod tests { ) } + fn set_context(context: &VMContextBuilder) { + testing_env!( + context.build(), + test_vm_config(), + RuntimeFeesConfig::test(), + validators() + ); + } + + fn set_context_and_validators( + context: &VMContextBuilder, + validators: &HashMap, + ) { + testing_env!( + context.build(), + test_vm_config(), + RuntimeFeesConfig::test(), + validators.clone() + ); + } + #[test] #[should_panic(expected = "is not a validator")] fn test_nonvalidator_cannot_vote() { @@ -192,12 +213,7 @@ mod tests { (validator(0).to_string(), NearToken::from_yoctonear(100)), (validator(1).to_string(), NearToken::from_yoctonear(100)), ]); - testing_env!( - context.build(), - test_vm_config(), - RuntimeFeesConfig::test(), - validators - ); + set_context_and_validators(&context, &validators); let mut contract = get_contract(); contract.vote(true); } @@ -211,12 +227,7 @@ mod tests { validator_id.to_string(), NearToken::from_yoctonear(100), )]); - testing_env!( - context.build(), - test_vm_config(), - RuntimeFeesConfig::test(), - validators - ); + set_context_and_validators(&context, &validators); let mut contract = get_contract(); // vote contract.vote(true); @@ -228,34 +239,19 @@ mod tests { #[test] fn test_voting_simple() { let context = get_context(&validator(0)); - testing_env!( - context.build(), - test_vm_config(), - RuntimeFeesConfig::test(), - validators() - ); + set_context(&context); let mut contract = get_contract(); for i in 0..7 { // vote by each validator let voter = validator(i); let mut context = get_context(&voter); - testing_env!( - context.build(), - test_vm_config(), - RuntimeFeesConfig::test(), - validators() - ); + set_context(&context); contract.vote(true); // check total voted stake context.is_view(true); - testing_env!( - context.build(), - test_vm_config(), - RuntimeFeesConfig::test(), - validators() - ); + set_context(&context); assert_eq!( contract.get_total_voted_stake(), (U128::from(10 * (i + 1) as u128), U128::from(100)) @@ -277,23 +273,13 @@ mod tests { #[test] fn test_voting_with_epoch_change() { let context = get_context(&validator(0)); - testing_env!( - context.build(), - test_vm_config(), - RuntimeFeesConfig::test(), - validators() - ); + set_context(&context); let mut contract = get_contract(); for i in 0..7 { // vote by each validator let context = get_context_with_epoch_height(&validator(i), i); - testing_env!( - context.build(), - test_vm_config(), - RuntimeFeesConfig::test(), - validators() - ); + set_context(&context); contract.vote(true); // check votes assert_eq!(contract.get_votes().len() as u64, i + 1); @@ -315,23 +301,13 @@ mod tests { ]); // vote at epoch 1 let context = get_context_with_epoch_height(&validator(1), 1); - testing_env!( - context.build(), - test_vm_config(), - RuntimeFeesConfig::test(), - validators.clone() - ); + set_context_and_validators(&context, &validators); let mut contract = get_contract(); contract.vote(true); // ping at epoch 2 validators.insert(validator(1).to_string(), NearToken::from_yoctonear(50)); let context = get_context_with_epoch_height(&validator(2), 2); - testing_env!( - context.build(), - test_vm_config(), - RuntimeFeesConfig::test(), - validators.clone() - ); + set_context_and_validators(&context, &validators); contract.ping(); assert!(contract.get_result().is_some()); } @@ -343,24 +319,14 @@ mod tests { (validator(2).to_string(), NearToken::from_yoctonear(10)), ]); let context = get_context_with_epoch_height(&validator(1), 1); - testing_env!( - context.build(), - test_vm_config(), - RuntimeFeesConfig::test(), - validators.clone() - ); + set_context_and_validators(&context, &validators); let mut contract = get_contract(); // vote at epoch 1 contract.vote(true); assert_eq!(contract.get_votes().len(), 1); // withdraw vote at epoch 2 let context = get_context_with_epoch_height(&validator(1), 2); - testing_env!( - context.build(), - test_vm_config(), - RuntimeFeesConfig::test(), - validators - ); + set_context_and_validators(&context, &validators); contract.vote(false); assert!(contract.get_votes().is_empty()); } @@ -373,12 +339,7 @@ mod tests { (validator(3).to_string(), NearToken::from_yoctonear(10)), ]); let context = get_context_with_epoch_height(&validator(1), 1); - testing_env!( - context.build(), - test_vm_config(), - RuntimeFeesConfig::test(), - validators.clone() - ); + set_context_and_validators(&context, &validators); let mut contract = get_contract(); // vote at epoch 1 contract.vote(true); @@ -386,12 +347,7 @@ mod tests { // remove validator at epoch 2 validators.remove(&validator(1).to_string()); let context = get_context_with_epoch_height(&validator(2), 2); - testing_env!( - context.build(), - test_vm_config(), - RuntimeFeesConfig::test(), - validators.clone() - ); + set_context_and_validators(&context, &validators); // ping will update total voted stake contract.ping(); assert_eq!((contract.get_total_voted_stake().0).0, 0); @@ -411,7 +367,7 @@ mod tests { #[should_panic(expected = "Proposal cannot be empty")] fn test_init_with_empty_proposal() { let context = VMContextBuilder::new(); - testing_env!(context.build()); + set_context(&context); Contract::new("".to_string(), env::block_timestamp_ms() + 1000); } @@ -419,7 +375,7 @@ mod tests { #[should_panic(expected = "Deadline must be in the future")] fn test_init_with_past_deadline() { let context = VMContextBuilder::new(); - testing_env!(context.build()); + set_context(&context); Contract::new("Test proposal".to_string(), env::block_timestamp_ms()); } @@ -430,14 +386,7 @@ mod tests { let mut context = get_context(&validator(0)); // vote after deadline - testing_env!( - context - .block_timestamp(env::block_timestamp_ms() + 2000 * 1_000_000) - .build(), - test_vm_config(), - RuntimeFeesConfig::test(), - validators() - ); + set_context(&context.block_timestamp(env::block_timestamp_ms() + 2000 * 1_000_000)); contract.vote(true); } @@ -448,23 +397,14 @@ mod tests { let mut context = get_context(&validator(0)); // vote at epoch 1 - testing_env!( - context.build(), - test_vm_config(), - RuntimeFeesConfig::test(), - validators() - ); + set_context(&context); contract.vote(true); // ping at epoch 2 after deadline - testing_env!( - context + set_context( + &context .block_timestamp(env::block_timestamp_ms() + 2000 * 1_000_000) - .epoch_height(2) - .build(), - test_vm_config(), - RuntimeFeesConfig::test(), - validators() + .epoch_height(2), ); contract.ping(); } From 41898a4898a2ad83319cc5d1898c3fa616d28bd9 Mon Sep 17 00:00:00 2001 From: Linguists <95207870+linguists@users.noreply.github.com> Date: Tue, 13 May 2025 15:40:16 +0800 Subject: [PATCH 12/16] test: refactor test functions --- src/lib.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 6a25adc..b83fb92 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -158,6 +158,13 @@ mod tests { format!("validator-{}", id).parse().unwrap() } + fn get_contract() -> Contract { + Contract::new( + "Test proposal".to_string(), + env::block_timestamp_ms() + 1000, + ) + } + fn get_context(predecessor_account_id: &AccountId) -> VMContextBuilder { get_context_with_epoch_height(predecessor_account_id, 0) } @@ -177,13 +184,6 @@ mod tests { .clone() } - fn get_contract() -> Contract { - Contract::new( - "Test proposal".to_string(), - env::block_timestamp_ms() + 1000, - ) - } - fn set_context(context: &VMContextBuilder) { testing_env!( context.build(), From 99aa8045f31d142fed647112ca2131490075c62c Mon Sep 17 00:00:00 2001 From: Linguists <95207870+linguists@users.noreply.github.com> Date: Tue, 13 May 2025 15:41:06 +0800 Subject: [PATCH 13/16] test: fix test case name --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index b83fb92..9a63538 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -207,7 +207,7 @@ mod tests { #[test] #[should_panic(expected = "is not a validator")] - fn test_nonvalidator_cannot_vote() { + fn test_non_validator_cannot_vote() { let context = get_context(&validator(3)); let validators = HashMap::from_iter(vec![ (validator(0).to_string(), NearToken::from_yoctonear(100)), From 2901ddef7b53b9ef7248fdbc593c8030a9271193 Mon Sep 17 00:00:00 2001 From: Linguists <95207870+linguists@users.noreply.github.com> Date: Tue, 13 May 2025 15:46:50 +0800 Subject: [PATCH 14/16] test: test with 300 validators --- src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 9a63538..a7d715c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -149,7 +149,7 @@ mod tests { use near_sdk::{env, test_vm_config, testing_env, Gas, NearToken, RuntimeFeesConfig}; fn validators() -> HashMap { - (0..10) + (0..300) .map(|i| (format!("validator-{}", i), NearToken::from_yoctonear(10))) .collect::>() } @@ -242,7 +242,7 @@ mod tests { set_context(&context); let mut contract = get_contract(); - for i in 0..7 { + for i in 0..201 { // vote by each validator let voter = validator(i); let mut context = get_context(&voter); @@ -254,7 +254,7 @@ mod tests { set_context(&context); assert_eq!( contract.get_total_voted_stake(), - (U128::from(10 * (i + 1) as u128), U128::from(100)) + (U128::from(10 * (i + 1) as u128), U128::from(3000)) ); // check votes let expected_votes: HashMap = @@ -262,7 +262,7 @@ mod tests { assert_eq!(contract.get_votes(), expected_votes); assert_eq!(contract.get_votes().len() as u64, i + 1); // check voting result - if i < 6 { + if i < 200 { assert!(contract.get_result().is_none()); } else { assert!(contract.get_result().is_some()); @@ -276,7 +276,7 @@ mod tests { set_context(&context); let mut contract = get_contract(); - for i in 0..7 { + for i in 0..201 { // vote by each validator let context = get_context_with_epoch_height(&validator(i), i); set_context(&context); @@ -284,7 +284,7 @@ mod tests { // check votes assert_eq!(contract.get_votes().len() as u64, i + 1); // check voting result - if i < 6 { + if i < 200 { assert!(contract.get_result().is_none()); } else { assert!(contract.get_result().is_some()); From 6721349fc1f85ed5d05808ceff6dca7dcba64f86 Mon Sep 17 00:00:00 2001 From: Linguists <95207870+linguists@users.noreply.github.com> Date: Wed, 14 May 2025 12:07:11 +0800 Subject: [PATCH 15/16] refactor: update type and assertion --- Cargo.toml | 4 ++-- src/lib.rs | 13 ++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 5502275..cb5d064 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,10 +3,10 @@ name = "validator-voting" description = "NEAR Validator Voting Contract" version = "0.1.0" edition = "2021" -# TODO: Fill out the repository field to help NEAR ecosystem tools to discover your project. + # NEP-0330 is automatically implemented for all contracts built with https://github.com/near/cargo-near. # Link to the repository will be available via `contract_source_metadata` view-function. -repository = "https://github.com//" +repository = "https://github.com/linear-protocol/validator-voting-contract" [lib] crate-type = ["cdylib", "rlib"] diff --git a/src/lib.rs b/src/lib.rs index a7d715c..02e69fa 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,8 +1,11 @@ use near_sdk::json_types::U128; -use near_sdk::{env, near, require, AccountId, EpochHeight, Timestamp}; +use near_sdk::{env, near, require, AccountId, EpochHeight}; use std::collections::HashMap; +/// Balance in yocto NEAR type Balance = u128; +/// Timestamp in milliseconds +type Timestamp = u64; /// Voting contract for any specific proposal. Once the majority of the stake holders agree to /// the proposal, the time will be recorded and the voting ends. @@ -41,12 +44,6 @@ impl Contract { /// Method for validators to vote or withdraw the vote. /// Votes for if `is_vote` is true, or withdraws the vote if `is_vote` is false. pub fn vote(&mut self, is_vote: bool) { - require!( - env::block_timestamp_ms() < self.deadline_timestamp_ms, - "Voting deadline has already passed" - ); - require!(self.result.is_none(), "Voting has already ended"); - self.ping(); let account_id = env::predecessor_account_id(); let account_stake = if is_vote { @@ -344,6 +341,7 @@ mod tests { // vote at epoch 1 contract.vote(true); assert_eq!((contract.get_total_voted_stake().0).0, 40); + assert_eq!(contract.get_votes().len(), 1); // remove validator at epoch 2 validators.remove(&validator(1).to_string()); let context = get_context_with_epoch_height(&validator(2), 2); @@ -351,6 +349,7 @@ mod tests { // ping will update total voted stake contract.ping(); assert_eq!((contract.get_total_voted_stake().0).0, 0); + assert_eq!(contract.get_votes().len(), 0); } #[test] From 4cb0a9b3238f272e870c4754f14062cc01779ffa Mon Sep 17 00:00:00 2001 From: Linguists <95207870+linguists@users.noreply.github.com> Date: Wed, 14 May 2025 12:27:05 +0800 Subject: [PATCH 16/16] feat: events --- src/events.rs | 46 ++++++++++++++++++++++++++++++++++++++++++++++ src/lib.rs | 28 ++++++++++++++++++++++++++-- 2 files changed, 72 insertions(+), 2 deletions(-) create mode 100644 src/events.rs diff --git a/src/events.rs b/src/events.rs new file mode 100644 index 0000000..dc92734 --- /dev/null +++ b/src/events.rs @@ -0,0 +1,46 @@ +use near_sdk::json_types::{U128, U64}; +use near_sdk::serde::Serialize; +use near_sdk::serde_json::json; +use near_sdk::{log, AccountId}; + +pub const EVENT_STANDARD: &str = "validator-voting"; +pub const EVENT_STANDARD_VERSION: &str = "1.0.0"; + +#[derive(Serialize)] +#[serde( + crate = "near_sdk::serde", + rename_all = "snake_case", + tag = "event", + content = "data" +)] +#[must_use = "Don't forget to `.emit()` this event"] +pub enum Event<'a> { + Voted { + validator_id: &'a AccountId, + }, + VoteWithdrawn { + validator_id: &'a AccountId, + }, + ProposalApproved { + proposal: &'a String, + approval_timestamp_ms: &'a U64, + deadline_timestamp_ms: &'a U64, + voted_stake: &'a U128, + total_stake: &'a U128, + num_votes: &'a U64, + }, +} + +impl<'a> Event<'a> { + pub fn emit(&self) { + let json = json!(self); + let event_json = json!({ + "standard": EVENT_STANDARD, + "version": EVENT_STANDARD_VERSION, + "event": json["event"], + "data": [json["data"]] + }) + .to_string(); + log!("EVENT_JSON:{}", event_json); + } +} diff --git a/src/lib.rs b/src/lib.rs index 02e69fa..890a4a0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,10 @@ -use near_sdk::json_types::U128; +use near_sdk::json_types::{U128, U64}; use near_sdk::{env, near, require, AccountId, EpochHeight}; use std::collections::HashMap; +mod events; +use crate::events::Event; + /// Balance in yocto NEAR type Balance = u128; /// Timestamp in milliseconds @@ -63,9 +66,21 @@ impl Contract { ); self.total_voted_stake = self.total_voted_stake + account_stake - voted_stake; if account_stake > 0 { - self.votes.insert(account_id, account_stake); + self.votes.insert(account_id.clone(), account_stake); self.check_result(); } + // emit event + if is_vote { + Event::Voted { + validator_id: &account_id, + } + .emit(); + } else { + Event::VoteWithdrawn { + validator_id: &account_id, + } + .emit(); + } } /// Ping to update the votes according to current stake of validators. @@ -100,6 +115,15 @@ impl Contract { let total_stake = env::validator_total_stake().as_yoctonear(); if self.total_voted_stake > total_stake * 2 / 3 { self.result = Some(env::block_timestamp_ms()); + Event::ProposalApproved { + proposal: &self.proposal, + approval_timestamp_ms: &U64::from(env::block_timestamp_ms()), + deadline_timestamp_ms: &U64::from(self.deadline_timestamp_ms), + voted_stake: &U128::from(self.total_voted_stake), + total_stake: &U128::from(total_stake), + num_votes: &U64::from(self.votes.len() as u64), + } + .emit(); } }