From 3acc8a6a97de1844873ead2676d990278b40ad78 Mon Sep 17 00:00:00 2001 From: Roman Useinov Date: Mon, 12 Aug 2024 23:13:05 +0200 Subject: [PATCH 01/10] feat: Introduced 'remove' method for 'near_sdk::store::Lazy' collection (#1238) --- near-sdk/src/store/lazy/mod.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/near-sdk/src/store/lazy/mod.rs b/near-sdk/src/store/lazy/mod.rs index 0bd6f5f63..cf340dd88 100644 --- a/near-sdk/src/store/lazy/mod.rs +++ b/near-sdk/src/store/lazy/mod.rs @@ -119,6 +119,11 @@ where } } } + + /// Removes the underlying storage item. Useful for deprecating the obsolete [`Lazy`] values. + pub fn remove(&mut self) -> bool { + env::storage_remove(&self.storage_key) + } } impl Lazy @@ -185,6 +190,15 @@ mod tests { assert_eq!(lazy_loaded, b); } + #[test] + pub fn test_remove() { + let mut lazy = Lazy::new(b"m", 8u8); + lazy.flush(); + assert!(env::storage_has_key(b"m")); + lazy.remove(); + assert!(!env::storage_has_key(b"m")); + } + #[test] pub fn test_debug() { let mut lazy = Lazy::new(b"m", 8u8); From 66918f3b92e1a1c4ed4969d5250248aae020027e Mon Sep 17 00:00:00 2001 From: gercos <63029620+jrmncos@users.noreply.github.com> Date: Tue, 13 Aug 2024 03:40:03 -0300 Subject: [PATCH 02/10] chore: Added code coverage CI (#1236) --- .github/workflows/coverage.yml | 55 ++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) create mode 100644 .github/workflows/coverage.yml diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 000000000..ecfd50dc7 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,55 @@ +name: Coverage +on: + push: + branches: + - master + pull_request: +env: + RUSTFLAGS: "-D warnings" + +jobs: + coverage: + runs-on: ${{ matrix.platform }} + name: "${{ matrix.example }} - ${{ matrix.platform }}" + strategy: + matrix: + platform: [macos-latest] + toolchain: [stable] + steps: + - uses: actions/checkout@v3 + - name: Install Homebrew + run: | + /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + - name: Install LLVM + run: brew install llvm + - name: Add LLVM to PATH + run: echo "/opt/homebrew/opt/llvm/bin" >> $GITHUB_PATH + - name: Install cargo-llvm-cov + run: brew install cargo-llvm-cov + - name: Llvm version + run: llvm-config --version + - name: Clang version + run: clang --version + - name: "${{ matrix.toolchain }} with rustfmt, and wasm32" + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: ${{ matrix.toolchain }} + target: wasm32-unknown-unknown + - name: Set Default Toolchain + run: rustup override set ${{ matrix.toolchain }} + - name: Rust version + run: rustc --version --verbose + - name: Add rust-src component + run: rustup component add rust-src --toolchain ${{ matrix.toolchain }} + - name: Verify Rust Toolchain + run: rustup show + - name: Generate code coverage + run: cargo +${{ matrix.toolchain }} llvm-cov --lcov --output-path llvm-cov-output.lcov + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v4 + with: + fail_ci_if_error: true + files: ./llvm-cov-output.lcov + token: ${{ secrets.CODECOV_TOKEN }} + verbose: true \ No newline at end of file From dffe4b900d854bfa364db678250b635cff2ca0c2 Mon Sep 17 00:00:00 2001 From: Artur Yurii Korchynskyi <42449190+akorchyn@users.noreply.github.com> Date: Tue, 13 Aug 2024 13:19:41 +0300 Subject: [PATCH 03/10] chore: updates near-* dependencies to 0.24.0 (#1237) --- examples/adder/Cargo.toml | 2 +- examples/callback-results/Cargo.toml | 2 +- examples/cross-contract-calls/Cargo.toml | 2 +- examples/factory-contract/Cargo.toml | 2 +- examples/fungible-token/Cargo.toml | 2 +- examples/lockable-fungible-token/Cargo.toml | 2 +- examples/non-fungible-token/Cargo.toml | 4 +- near-sdk/Cargo.toml | 12 +-- near-sdk/tests/store_performance_tests.rs | 84 ++++++++++----------- 9 files changed, 56 insertions(+), 56 deletions(-) diff --git a/examples/adder/Cargo.toml b/examples/adder/Cargo.toml index adb000042..bec5bafb9 100644 --- a/examples/adder/Cargo.toml +++ b/examples/adder/Cargo.toml @@ -11,7 +11,7 @@ crate-type = ["cdylib"] near-sdk = { path = "../../near-sdk" } [dev-dependencies] -near-workspaces = "0.11.0" +near-workspaces = "0.11.1" tokio = { version = "1.14", features = ["full"] } anyhow = "1.0" near-abi = "0.4.0" diff --git a/examples/callback-results/Cargo.toml b/examples/callback-results/Cargo.toml index 4c7d53234..52fafda73 100644 --- a/examples/callback-results/Cargo.toml +++ b/examples/callback-results/Cargo.toml @@ -11,7 +11,7 @@ crate-type = ["cdylib"] near-sdk = { path = "../../near-sdk" } [dev-dependencies] -near-workspaces = "0.11.0" +near-workspaces = "0.11.1" tokio = { version = "1.14", features = ["full"] } anyhow = "1.0" near-sdk = { path = "../../near-sdk", features = ["unit-testing"] } diff --git a/examples/cross-contract-calls/Cargo.toml b/examples/cross-contract-calls/Cargo.toml index 9e0109bde..118779daf 100644 --- a/examples/cross-contract-calls/Cargo.toml +++ b/examples/cross-contract-calls/Cargo.toml @@ -9,7 +9,7 @@ anyhow = "1.0" near-sdk = { path = "../../near-sdk", features = ["default", "unit-testing"] } test-case = "2.0" tokio = { version = "1.14", features = ["full"] } -near-workspaces = "0.11.0" +near-workspaces = "0.11.1" cross-contract-high-level = { path = "./high-level" } cross-contract-low-level = { path = "./low-level" } diff --git a/examples/factory-contract/Cargo.toml b/examples/factory-contract/Cargo.toml index eea454614..7fca0329d 100644 --- a/examples/factory-contract/Cargo.toml +++ b/examples/factory-contract/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" anyhow = "1.0" test-case = "2.0" tokio = { version = "1.14", features = ["full"] } -near-workspaces = "0.11.0" +near-workspaces = "0.11.1" near-sdk = { path = "../../near-sdk", features = ["unit-testing"] } [profile.release] diff --git a/examples/fungible-token/Cargo.toml b/examples/fungible-token/Cargo.toml index 9d11ade76..b2a546724 100644 --- a/examples/fungible-token/Cargo.toml +++ b/examples/fungible-token/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" anyhow = "1.0" near-sdk = { path = "../../near-sdk", features = ["unit-testing"] } tokio = { version = "1.14", features = ["full"] } -near-workspaces = "0.11.0" +near-workspaces = "0.11.1" [profile.release] codegen-units = 1 diff --git a/examples/lockable-fungible-token/Cargo.toml b/examples/lockable-fungible-token/Cargo.toml index 3a20a2d0c..01f9982e9 100644 --- a/examples/lockable-fungible-token/Cargo.toml +++ b/examples/lockable-fungible-token/Cargo.toml @@ -14,7 +14,7 @@ near-sdk = { path = "../../near-sdk", features = ["legacy"] } anyhow = "1.0" tokio = { version = "1.14", features = ["full"] } near-sdk = { path = "../../near-sdk", features = ["unit-testing"] } -near-workspaces = "0.11.0" +near-workspaces = "0.11.1" [profile.release] codegen-units = 1 diff --git a/examples/non-fungible-token/Cargo.toml b/examples/non-fungible-token/Cargo.toml index 6df115e55..dcdeee7d9 100644 --- a/examples/non-fungible-token/Cargo.toml +++ b/examples/non-fungible-token/Cargo.toml @@ -7,9 +7,9 @@ edition = "2021" [dev-dependencies] anyhow = "1.0" near-contract-standards = { path = "../../near-contract-standards" } -near-sdk = { path = "../../near-sdk", features = ["unit-testing"] } +near-sdk = { path = "../../near-sdk", features = ["unit-testing"] } tokio = { version = "1.14", features = ["full"] } -near-workspaces = "0.11.0" +near-workspaces = "0.11.1" [profile.release] codegen-units = 1 diff --git a/near-sdk/Cargo.toml b/near-sdk/Cargo.toml index c94aa12e1..07abc8ffa 100644 --- a/near-sdk/Cargo.toml +++ b/near-sdk/Cargo.toml @@ -42,11 +42,11 @@ schemars = { version = "0.8.8", optional = true } near-abi = { version = "0.4.0", features = [ "__chunked-entries", ], optional = true } -near-vm-runner = { version = "0.23", optional = true } -near-primitives-core = { version = "0.23", optional = true } -near-primitives = { version = "0.23", optional = true } -near-crypto = { version = "0.23", default-features = false, optional = true } -near-parameters = { version = "0.23", optional = true } +near-vm-runner = { version = "0.24", optional = true } +near-primitives-core = { version = "0.24", optional = true } +near-primitives = { version = "0.24", optional = true } +near-crypto = { version = "0.24", default-features = false, optional = true } +near-parameters = { version = "0.24", optional = true } [dev-dependencies] near-sdk = { path = ".", features = ["legacy", "unit-testing"] } @@ -63,7 +63,7 @@ rand_chacha = "0.3.1" near-rng = "0.1.1" near-abi = { version = "0.4.0", features = ["__chunked-entries"] } symbolic-debuginfo = "12" -near-workspaces = { version = "0.10.1", features = ["unstable"] } +near-workspaces = { version = "0.11.1", features = ["unstable"] } anyhow = "1.0" tokio = { version = "1", features = ["full"] } strum = "0.25.0" diff --git a/near-sdk/tests/store_performance_tests.rs b/near-sdk/tests/store_performance_tests.rs index 194b4ef05..e15250d3c 100644 --- a/near-sdk/tests/store_performance_tests.rs +++ b/near-sdk/tests/store_performance_tests.rs @@ -118,14 +118,14 @@ async fn insert_and_remove() -> anyhow::Result<()> { // insert test, max_iterations here is the number of elements to insert. It's used to measure // relative performance. for (col, max_iterations) in collection_types.map(|col| match col { - Collection::TreeMap => (col, 340), - Collection::IterableSet => (col, 340), - Collection::IterableMap => (col, 350), - Collection::UnorderedSet => (col, 340), - Collection::UnorderedMap => (col, 350), - Collection::LookupMap => (col, 600), - Collection::LookupSet => (col, 970), - Collection::Vector => (col, 1000), + Collection::TreeMap => (col, 365), + Collection::IterableSet => (col, 370), + Collection::IterableMap => (col, 370), + Collection::UnorderedSet => (col, 360), + Collection::UnorderedMap => (col, 365), + Collection::LookupMap => (col, 650), + Collection::LookupSet => (col, 1020), + Collection::Vector => (col, 1080), }) { let total_gas = account .call(&contract_id, "insert") @@ -143,14 +143,14 @@ async fn insert_and_remove() -> anyhow::Result<()> { // remove test, max_iterations here is the number of elements to remove. It's used to measure // relative performance. for (col, max_iterations) in collection_types.map(|col| match col { - Collection::TreeMap => (col, 220), - Collection::IterableSet => (col, 120), - Collection::IterableMap => (col, 115), - Collection::UnorderedSet => (col, 220), - Collection::UnorderedMap => (col, 220), - Collection::LookupMap => (col, 480), - Collection::LookupSet => (col, 970), - Collection::Vector => (col, 500), + Collection::TreeMap => (col, 230), + Collection::IterableSet => (col, 130), + Collection::IterableMap => (col, 120), + Collection::UnorderedSet => (col, 240), + Collection::UnorderedMap => (col, 250), + Collection::LookupMap => (col, 520), + Collection::LookupSet => (col, 1050), + Collection::Vector => (col, 530), }) { let total_gas = account .call(&contract_id, "remove") @@ -198,11 +198,11 @@ async fn iter() -> anyhow::Result<()> { // It's used to measure relative performance. for (col, repeat) in collection_types.map(|col| match col { Collection::TreeMap => (col, 5), - Collection::IterableSet => (col, 20), - Collection::IterableMap => (col, 9), - Collection::UnorderedSet => (col, 18), - Collection::UnorderedMap => (col, 8), - Collection::Vector => (col, 19), + Collection::IterableSet => (col, 22), + Collection::IterableMap => (col, 10), + Collection::UnorderedSet => (col, 20), + Collection::UnorderedMap => (col, 9), + Collection::Vector => (col, 22), _ => (col, 0), }) { let total_gas = account @@ -249,12 +249,12 @@ async fn random_access() -> anyhow::Result<()> { // iter, repeat here is the number that reflects how many times we retrieve a random element. // It's used to measure relative performance. for (col, repeat) in collection_types.map(|col| match col { - Collection::TreeMap => (col, 14), - Collection::IterableSet => (col, 1600), - Collection::IterableMap => (col, 720), - Collection::UnorderedSet => (col, 37), - Collection::UnorderedMap => (col, 33), - Collection::Vector => (col, 1600), + Collection::TreeMap => (col, 15), + Collection::IterableSet => (col, 1750), + Collection::IterableMap => (col, 745), + Collection::UnorderedSet => (col, 41), + Collection::UnorderedMap => (col, 36), + Collection::Vector => (col, 1700), _ => (col, 0), }) { let total_gas = account @@ -303,13 +303,13 @@ async fn contains() -> anyhow::Result<()> { // contains test, repeat here is the number of times we check all the elements in each collection. // It's used to measure relative performance. for (col, repeat) in collection_types.map(|col| match col { - Collection::TreeMap => (col, 12), - Collection::IterableSet => (col, 11), - Collection::IterableMap => (col, 12), - Collection::UnorderedSet => (col, 11), - Collection::UnorderedMap => (col, 12), - Collection::LookupMap => (col, 16), - Collection::LookupSet => (col, 14), + Collection::TreeMap => (col, 13), + Collection::IterableSet => (col, 12), + Collection::IterableMap => (col, 13), + Collection::UnorderedSet => (col, 12), + Collection::UnorderedMap => (col, 13), + Collection::LookupMap => (col, 17), + Collection::LookupSet => (col, 15), _ => (col, 0), }) { let total_gas = account @@ -369,10 +369,10 @@ async fn iterable_vs_unordered() -> anyhow::Result<()> { // iter, repeat here is the number of times we iterate through the whole collection. It's used to // measure relative performance. for (col, repeat) in collection_types.map(|col| match col { - Collection::IterableSet => (col, 240000), - Collection::IterableMap => (col, 130000), - Collection::UnorderedSet => (col, 260), - Collection::UnorderedMap => (col, 260), + Collection::IterableSet => (col, 260000), + Collection::IterableMap => (col, 135000), + Collection::UnorderedSet => (col, 280), + Collection::UnorderedMap => (col, 270), _ => (col, 0), }) { let total_gas = account @@ -391,10 +391,10 @@ async fn iterable_vs_unordered() -> anyhow::Result<()> { // random access, repeat here is the number of times we try to access an element in the // collection. It's used to measure relative performance. for (col, repeat) in &collection_types.map(|col| match col { - Collection::IterableSet => (col, 540000), - Collection::IterableMap => (col, 260000), - Collection::UnorderedSet => (col, 255), - Collection::UnorderedMap => (col, 255), + Collection::IterableSet => (col, 600000), + Collection::IterableMap => (col, 280000), + Collection::UnorderedSet => (col, 280), + Collection::UnorderedMap => (col, 260), _ => (col, 0), }) { let total_gas = account From 4551e4394d4c8f6737cc3a8f8594479c4bbec7cd Mon Sep 17 00:00:00 2001 From: Vlad Frolov Date: Wed, 14 Aug 2024 13:50:14 +0200 Subject: [PATCH 04/10] chore: release v5.3.0 (#1226) --- CHANGELOG.md | 16 ++++++++++++++++ Cargo.toml | 2 +- near-contract-standards/CHANGELOG.md | 5 +++++ near-contract-standards/Cargo.toml | 2 +- near-sdk/Cargo.toml | 2 +- 5 files changed, 24 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7785c9593..19b85817d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,22 @@ ## [Unreleased] +## [5.3.0](https://github.com/near/near-sdk-rs/compare/near-sdk-v5.2.1...near-sdk-v5.3.0) - 2024-08-13 + +### Added +- Introduced 'remove' method for 'near_sdk::store::Lazy' collection ([#1238](https://github.com/near/near-sdk-rs/pull/1238)) +- Allow store collection iterators to be cloned (this enables standard Iterator methods like `cycle()`) ([#1224](https://github.com/near/near-sdk-rs/pull/1224)) + +### Fixed +- Fix storage management error message with proper amount ([#1222](https://github.com/near/near-sdk-rs/pull/1222)) +- Fixed compilation errors after Rust 1.80 latest stable release ([#1227](https://github.com/near/near-sdk-rs/pull/1227)) + +### Other +- updates near-* dependencies to 0.24.0 ([#1237](https://github.com/near/near-sdk-rs/pull/1237)) +- Include all examples into CI testing suite ([#1228](https://github.com/near/near-sdk-rs/pull/1228)) +- Optimized up to 10% contract binary size by using `near_sdk::env::panic_str` instead of `expect` calls ([#1220](https://github.com/near/near-sdk-rs/pull/1220)) +- Fixed Rust 1.80 new warning by adding `cargo:rustc-check-cfg` for `__abi-embed-checked` feature in `near-sdk-macros` build.rs ([#1225](https://github.com/near/near-sdk-rs/pull/1225)) + ## [5.2.1](https://github.com/near/near-sdk-rs/compare/near-sdk-v5.2.0...near-sdk-v5.2.1) - 2024-07-05 ### Fixed diff --git a/Cargo.toml b/Cargo.toml index ebdaea268..f12bfca8c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,7 @@ members = [ exclude = ["examples/"] [workspace.package] -version = "5.2.1" +version = "5.3.0" # Special triple # comment for ci. [patch.crates-io] diff --git a/near-contract-standards/CHANGELOG.md b/near-contract-standards/CHANGELOG.md index b3dd62680..e32005cd1 100644 --- a/near-contract-standards/CHANGELOG.md +++ b/near-contract-standards/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [5.3.0](https://github.com/near/near-sdk-rs/compare/near-contract-standards-v5.2.1...near-contract-standards-v5.3.0) - 2024-08-13 + +### Fixed +- Fix storage management error message with proper amount ([#1222](https://github.com/near/near-sdk-rs/pull/1222)) + ## [5.2.0](https://github.com/near/near-sdk-rs/compare/near-contract-standards-v5.1.0...near-contract-standards-v5.2.0) - 2024-07-04 ### Added diff --git a/near-contract-standards/Cargo.toml b/near-contract-standards/Cargo.toml index 7b7cf8512..5e0d8f2bd 100644 --- a/near-contract-standards/Cargo.toml +++ b/near-contract-standards/Cargo.toml @@ -13,7 +13,7 @@ NEAR smart contracts standard library. """ [dependencies] -near-sdk = { path = "../near-sdk", version = "~5.2.1", default-features = false, features = ["legacy"] } +near-sdk = { path = "../near-sdk", version = "~5.3.0", default-features = false, features = ["legacy"] } [dev-dependencies] near-sdk = { path = "../near-sdk", default-features = false, features = ["unit-testing"] } diff --git a/near-sdk/Cargo.toml b/near-sdk/Cargo.toml index 07abc8ffa..b7edcceb9 100644 --- a/near-sdk/Cargo.toml +++ b/near-sdk/Cargo.toml @@ -21,7 +21,7 @@ required-features = ["abi", "unstable"] # Provide near_bidgen macros. serde = { version = "1", features = ["derive"] } serde_json = "1" -near-sdk-macros = { path = "../near-sdk-macros", version = "~5.2.1" } +near-sdk-macros = { path = "../near-sdk-macros", version = "~5.3.0" } near-sys = { path = "../near-sys", version = "0.2.2" } base64 = "0.21" borsh = { version = "1.0.0", features = ["derive"] } From 0be2c7109bff71d0fac7b37b1463b980b4462568 Mon Sep 17 00:00:00 2001 From: Artur Yurii Korchynskyi <42449190+akorchyn@users.noreply.github.com> Date: Sat, 17 Aug 2024 00:08:27 +0300 Subject: [PATCH 05/10] chore: updated near-workspaces-rs (#1239) --- .github/workflows/test.yml | 4 ++-- examples/adder/Cargo.toml | 2 +- examples/callback-results/Cargo.toml | 2 +- examples/cross-contract-calls/Cargo.toml | 2 +- examples/factory-contract/Cargo.toml | 2 +- examples/fungible-token/Cargo.toml | 2 +- examples/lockable-fungible-token/Cargo.toml | 2 +- examples/non-fungible-token/Cargo.toml | 2 +- near-sdk/Cargo.toml | 6 +++--- near-sdk/compilation_tests/all.rs | 5 +++-- 10 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3ebafe3c7..7690fad84 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,11 +14,11 @@ jobs: matrix: platform: - os: ubuntu-latest - rs: 1.76.0 + rs: 1.78 - os: ubuntu-latest rs: stable - os: macos-latest - rs: 1.76.0 + rs: 1.78 - os: macos-latest rs: stable features: ['', '--features unstable,legacy,__abi-generate'] diff --git a/examples/adder/Cargo.toml b/examples/adder/Cargo.toml index bec5bafb9..89067b819 100644 --- a/examples/adder/Cargo.toml +++ b/examples/adder/Cargo.toml @@ -11,7 +11,7 @@ crate-type = ["cdylib"] near-sdk = { path = "../../near-sdk" } [dev-dependencies] -near-workspaces = "0.11.1" +near-workspaces = "0.12" tokio = { version = "1.14", features = ["full"] } anyhow = "1.0" near-abi = "0.4.0" diff --git a/examples/callback-results/Cargo.toml b/examples/callback-results/Cargo.toml index 52fafda73..204eaad4a 100644 --- a/examples/callback-results/Cargo.toml +++ b/examples/callback-results/Cargo.toml @@ -11,7 +11,7 @@ crate-type = ["cdylib"] near-sdk = { path = "../../near-sdk" } [dev-dependencies] -near-workspaces = "0.11.1" +near-workspaces = "0.12" tokio = { version = "1.14", features = ["full"] } anyhow = "1.0" near-sdk = { path = "../../near-sdk", features = ["unit-testing"] } diff --git a/examples/cross-contract-calls/Cargo.toml b/examples/cross-contract-calls/Cargo.toml index 118779daf..b02c26103 100644 --- a/examples/cross-contract-calls/Cargo.toml +++ b/examples/cross-contract-calls/Cargo.toml @@ -9,7 +9,7 @@ anyhow = "1.0" near-sdk = { path = "../../near-sdk", features = ["default", "unit-testing"] } test-case = "2.0" tokio = { version = "1.14", features = ["full"] } -near-workspaces = "0.11.1" +near-workspaces = "0.12" cross-contract-high-level = { path = "./high-level" } cross-contract-low-level = { path = "./low-level" } diff --git a/examples/factory-contract/Cargo.toml b/examples/factory-contract/Cargo.toml index 7fca0329d..4ba91fe3d 100644 --- a/examples/factory-contract/Cargo.toml +++ b/examples/factory-contract/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" anyhow = "1.0" test-case = "2.0" tokio = { version = "1.14", features = ["full"] } -near-workspaces = "0.11.1" +near-workspaces = "0.12" near-sdk = { path = "../../near-sdk", features = ["unit-testing"] } [profile.release] diff --git a/examples/fungible-token/Cargo.toml b/examples/fungible-token/Cargo.toml index b2a546724..f48f872be 100644 --- a/examples/fungible-token/Cargo.toml +++ b/examples/fungible-token/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" anyhow = "1.0" near-sdk = { path = "../../near-sdk", features = ["unit-testing"] } tokio = { version = "1.14", features = ["full"] } -near-workspaces = "0.11.1" +near-workspaces = "0.12" [profile.release] codegen-units = 1 diff --git a/examples/lockable-fungible-token/Cargo.toml b/examples/lockable-fungible-token/Cargo.toml index 01f9982e9..8a808e3bf 100644 --- a/examples/lockable-fungible-token/Cargo.toml +++ b/examples/lockable-fungible-token/Cargo.toml @@ -14,7 +14,7 @@ near-sdk = { path = "../../near-sdk", features = ["legacy"] } anyhow = "1.0" tokio = { version = "1.14", features = ["full"] } near-sdk = { path = "../../near-sdk", features = ["unit-testing"] } -near-workspaces = "0.11.1" +near-workspaces = "0.12" [profile.release] codegen-units = 1 diff --git a/examples/non-fungible-token/Cargo.toml b/examples/non-fungible-token/Cargo.toml index dcdeee7d9..fe4d40a0a 100644 --- a/examples/non-fungible-token/Cargo.toml +++ b/examples/non-fungible-token/Cargo.toml @@ -9,7 +9,7 @@ anyhow = "1.0" near-contract-standards = { path = "../../near-contract-standards" } near-sdk = { path = "../../near-sdk", features = ["unit-testing"] } tokio = { version = "1.14", features = ["full"] } -near-workspaces = "0.11.1" +near-workspaces = "0.12" [profile.release] codegen-units = 1 diff --git a/near-sdk/Cargo.toml b/near-sdk/Cargo.toml index b7edcceb9..0d51d20ea 100644 --- a/near-sdk/Cargo.toml +++ b/near-sdk/Cargo.toml @@ -31,8 +31,8 @@ bs58 = "0.5" once_cell = { version = "1.17", default-features = false } near-account-id = { version = "1.0.0", features = ["serde", "borsh"] } -near-gas = { version = "0.2.3", features = ["serde", "borsh"] } -near-token = { version = "0.2.1", features = ["serde", "borsh"] } +near-gas = { version = "0.3", features = ["serde", "borsh"] } +near-token = { version = "0.3", features = ["serde", "borsh"] } [target.'cfg(target_arch = "wasm32")'.dependencies] wee_alloc = { version = "0.4.5", default-features = false, optional = true } @@ -63,7 +63,7 @@ rand_chacha = "0.3.1" near-rng = "0.1.1" near-abi = { version = "0.4.0", features = ["__chunked-entries"] } symbolic-debuginfo = "12" -near-workspaces = { version = "0.11.1", features = ["unstable"] } +near-workspaces = { version = "0.12", features = ["unstable"] } anyhow = "1.0" tokio = { version = "1", features = ["full"] } strum = "0.25.0" diff --git a/near-sdk/compilation_tests/all.rs b/near-sdk/compilation_tests/all.rs index 611cc0734..9a8007083 100644 --- a/near-sdk/compilation_tests/all.rs +++ b/near-sdk/compilation_tests/all.rs @@ -23,8 +23,9 @@ fn compilation_tests() { t.pass("compilation_tests/function_error.rs"); t.pass("compilation_tests/enum_near_bindgen.rs"); t.pass("compilation_tests/schema_derive.rs"); - if rustversion::cfg!(since(1.78)) && std::env::consts::OS == "linux" { - // The compilation error output has slightly changed in 1.7x and between platforms, + + if rustversion::cfg!(since(1.80)) && std::env::consts::OS == "linux" { + // The compilation error output has slightly changed in 1.7x and 1.8x and between platforms, // so we snapshoted this single version t.compile_fail("compilation_tests/schema_derive_invalids.rs"); } From df12263d521cbe74f33b450a0bc8dcef39463a56 Mon Sep 17 00:00:00 2001 From: Artur Yurii Korchynskyi <42449190+akorchyn@users.noreply.github.com> Date: Wed, 4 Sep 2024 16:13:48 +0300 Subject: [PATCH 06/10] chore!: upgrade to 0.25 release (#1242) --- .github/workflows/test.yml | 4 +- near-sdk/Cargo.toml | 12 +- .../src/environment/mock/mocked_blockchain.rs | 142 +++++++++++++++--- 3 files changed, 126 insertions(+), 32 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7690fad84..2fc4f9b77 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,11 +14,11 @@ jobs: matrix: platform: - os: ubuntu-latest - rs: 1.78 + rs: 1.79 - os: ubuntu-latest rs: stable - os: macos-latest - rs: 1.78 + rs: 1.79 - os: macos-latest rs: stable features: ['', '--features unstable,legacy,__abi-generate'] diff --git a/near-sdk/Cargo.toml b/near-sdk/Cargo.toml index 0d51d20ea..f1b0c3c65 100644 --- a/near-sdk/Cargo.toml +++ b/near-sdk/Cargo.toml @@ -23,7 +23,7 @@ serde = { version = "1", features = ["derive"] } serde_json = "1" near-sdk-macros = { path = "../near-sdk-macros", version = "~5.3.0" } near-sys = { path = "../near-sys", version = "0.2.2" } -base64 = "0.21" +base64 = "0.22" borsh = { version = "1.0.0", features = ["derive"] } bs58 = "0.5" @@ -42,11 +42,11 @@ schemars = { version = "0.8.8", optional = true } near-abi = { version = "0.4.0", features = [ "__chunked-entries", ], optional = true } -near-vm-runner = { version = "0.24", optional = true } -near-primitives-core = { version = "0.24", optional = true } -near-primitives = { version = "0.24", optional = true } -near-crypto = { version = "0.24", default-features = false, optional = true } -near-parameters = { version = "0.24", optional = true } +near-vm-runner = { version = "0.25", optional = true } +near-primitives-core = { version = "0.25", optional = true } +near-primitives = { version = "0.25", optional = true } +near-crypto = { version = "0.25", default-features = false, optional = true } +near-parameters = { version = "0.25", optional = true } [dev-dependencies] near-sdk = { path = ".", features = ["legacy", "unit-testing"] } diff --git a/near-sdk/src/environment/mock/mocked_blockchain.rs b/near-sdk/src/environment/mock/mocked_blockchain.rs index 1227c8bee..fe7986377 100644 --- a/near-sdk/src/environment/mock/mocked_blockchain.rs +++ b/near-sdk/src/environment/mock/mocked_blockchain.rs @@ -9,32 +9,41 @@ use near_parameters::{RuntimeConfigStore, RuntimeFeesConfig}; use near_primitives_core::version::PROTOCOL_VERSION; use near_vm_runner::logic::mocks::mock_external::MockedExternal; use near_vm_runner::logic::types::{PromiseResult as VmPromiseResult, ReceiptIndex}; -use near_vm_runner::logic::{External, MemoryLike, VMLogic}; +use near_vm_runner::logic::{ExecutionResultState, External, MemoryLike, VMLogic}; use std::cell::RefCell; use std::collections::HashMap; +use std::marker::PhantomData; +use std::sync::Arc; /// Mocked blockchain that can be used in the tests for the smart contracts. /// It implements `BlockchainInterface` by redirecting calls to `VMLogic`. It unwraps errors of /// `VMLogic` to cause panic during the unit tests similarly to how errors of `VMLogic` would cause /// the termination of guest program execution. Unit tests can even assert the expected error /// message. -pub struct MockedBlockchain { +pub struct MockedBlockchain +where + Memory: MemoryLike + Default + 'static, +{ logic: RefCell>, // We keep ownership over logic fixture so that references in `VMLogic` are valid. #[allow(dead_code)] logic_fixture: LogicFixture, + _memory: PhantomData, } pub fn test_vm_config() -> near_parameters::vm::Config { let store = RuntimeConfigStore::test(); - let config = store.get_config(PROTOCOL_VERSION).wasm_config.clone(); + let config = store.get_config(PROTOCOL_VERSION).wasm_config.as_ref().to_owned(); near_parameters::vm::Config { vm_kind: config.vm_kind.replace_with_wasmtime_if_unsupported(), ..config } } -impl Default for MockedBlockchain { +impl Default for MockedBlockchain +where + T: MemoryLike + Default + 'static, +{ fn default() -> Self { MockedBlockchain::new( VMContextBuilder::new().build(), @@ -50,15 +59,14 @@ impl Default for MockedBlockchain { struct LogicFixture { ext: Box, - memory: Box, - #[allow(clippy::box_collection)] - promise_results: Box>, - config: Box, - fees_config: Box, + fees_config: Arc, context: Box, } -impl MockedBlockchain { +impl MockedBlockchain +where + Memory: MemoryLike + Default + 'static, +{ pub fn new( context: VMContext, config: near_parameters::vm::Config, @@ -66,34 +74,35 @@ impl MockedBlockchain { promise_results: Vec, storage: HashMap, Vec>, validators: HashMap, - memory_opt: Option>, + memory: Option, ) -> Self { let mut ext = Box::new(MockedExternal::new()); - let context = Box::new(sdk_context_to_vm_context(context)); + let promise_results: Arc<[VmPromiseResult]> = + promise_results.into_iter().map(Into::into).collect::>().into(); + let context: Box = + Box::new(sdk_context_to_vm_context(context, promise_results)); ext.fake_trie = storage; ext.validators = validators.into_iter().map(|(k, v)| (k.parse().unwrap(), v.as_yoctonear())).collect(); - let memory = memory_opt.unwrap_or_else(|| Box::::default()); - let promise_results = Box::new(promise_results.into_iter().map(From::from).collect()); - let config = Box::new(config); - let fees_config = Box::new(fees_config); + let config = Arc::new(config); + let fees_config = Arc::new(fees_config); + let result_state = + ExecutionResultState::new(&context, context.make_gas_counter(&config), config.clone()); - let mut logic_fixture = - LogicFixture { ext, memory, context, promise_results, config, fees_config }; + let mut logic_fixture = LogicFixture { ext, context, fees_config }; let logic = unsafe { VMLogic::new( &mut *(logic_fixture.ext.as_mut() as *mut dyn External), &*(logic_fixture.context.as_mut() as *mut near_vm_runner::logic::VMContext), - &*(logic_fixture.config.as_mut() as *const near_parameters::vm::Config), - &*(logic_fixture.fees_config.as_mut() as *const RuntimeFeesConfig), - &*(logic_fixture.promise_results.as_ref().as_slice() as *const [VmPromiseResult]), - &mut *(logic_fixture.memory.as_mut() as *mut dyn MemoryLike), + logic_fixture.fees_config.clone(), + result_state, + memory.unwrap_or_default(), ) }; let logic = RefCell::new(logic); - Self { logic, logic_fixture } + Self { logic, logic_fixture, _memory: PhantomData } } pub fn take_storage(&mut self) -> HashMap, Vec> { @@ -147,7 +156,10 @@ impl MockedBlockchain { } } -fn sdk_context_to_vm_context(context: VMContext) -> near_vm_runner::logic::VMContext { +fn sdk_context_to_vm_context( + context: VMContext, + promise_results: std::sync::Arc<[VmPromiseResult]>, +) -> near_vm_runner::logic::VMContext { near_vm_runner::logic::VMContext { current_account_id: context.current_account_id.as_str().parse().unwrap(), signer_account_id: context.signer_account_id.as_str().parse().unwrap(), @@ -169,12 +181,14 @@ fn sdk_context_to_vm_context(context: VMContext) -> near_vm_runner::logic::VMCon .into_iter() .map(|a| a.as_str().parse().unwrap()) .collect(), + promise_results, } } #[cfg(not(target_arch = "wasm32"))] mod mock_chain { use near_vm_runner::logic::{errors::VMLogicError, VMLogic}; + fn with_mock_interface(f: F) -> R where F: FnOnce(&mut VMLogic) -> Result, @@ -588,3 +602,83 @@ mod mock_chain { with_mock_interface(|b| b.alt_bn128_pairing_check(value_len, value_ptr)) } } + +#[cfg(test)] +mod tests { + use std::str::FromStr; + + use near_gas::NearGas; + use near_primitives::types::GasWeight; + + use crate::{ + env, + test_utils::{accounts, get_created_receipts, get_logs}, + testing_env, + }; + + use super::*; + + #[test] + fn test_mocked_blockchain_api() { + let public_key: crate::types::PublicKey = + "ed25519:H3C2AVAWKq5Qm7FkyDB5cHKcYKHgbiiB2BzX8DQX8CJ".parse().unwrap(); + let context = VMContextBuilder::new() + .signer_account_id(accounts(0)) + .signer_account_pk(public_key.clone()) + .build(); + + testing_env!(context.clone()); + assert_eq!(env::signer_account_id(), accounts(0)); + assert_eq!(env::signer_account_pk(), public_key); + + env::storage_write(b"smile", b"hello_worlds"); + assert_eq!(env::storage_read(b"smile").unwrap(), b"hello_worlds"); + assert!(env::storage_has_key(b"smile")); + env::storage_remove(b"smile"); + assert!(!env::storage_has_key(b"smile")); + + let promise_index = env::promise_create( + "account.near".parse().unwrap(), + "method", + &[], + NearToken::from_millinear(1), + NearGas::from_tgas(1), + ); + + env::promise_batch_action_stake(promise_index, NearToken::from_millinear(1), &public_key); + + env::log_str("logged"); + + let logs = get_logs(); + assert_eq!(logs.len(), 1); + assert_eq!(logs[0], "logged"); + + let actions = get_created_receipts(); + assert_eq!(actions.len(), 1); + assert_eq!(actions[0].receiver_id.to_string(), "account.near"); + assert_eq!(actions[0].actions.len(), 2); + assert_eq!( + actions[0].actions[0], + MockAction::FunctionCallWeight { + receipt_index: 0, + method_name: b"method".to_vec(), + args: [].to_vec(), + attached_deposit: NearToken::from_millinear(1), + prepaid_gas: NearGas::from_tgas(1), + gas_weight: GasWeight(0) + } + ); + + assert_eq!( + actions[0].actions[1], + MockAction::Stake { + receipt_index: 0, + stake: NearToken::from_millinear(1), + public_key: near_crypto::PublicKey::from_str( + "ed25519:H3C2AVAWKq5Qm7FkyDB5cHKcYKHgbiiB2BzX8DQX8CJ" + ) + .unwrap() + } + ); + } +} From 9c68e71bf3ac51f9e8cec4b871890b15b5ac0b35 Mon Sep 17 00:00:00 2001 From: Vlad Frolov Date: Wed, 4 Sep 2024 19:44:24 +0200 Subject: [PATCH 07/10] chore: release v5.4.0 (#1240) --- CHANGELOG.md | 6 ++++++ Cargo.toml | 9 ++------- near-contract-standards/Cargo.toml | 8 ++++++-- near-sdk/Cargo.toml | 2 +- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 19b85817d..a2dd48605 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## [Unreleased] +## [5.4.0](https://github.com/near/near-sdk-rs/compare/near-sdk-v5.3.0...near-sdk-v5.4.0) - 2024-09-04 + +### Other +- updates near-* dependencies to 0.25.0 ([#1242](https://github.com/near/near-sdk-rs/pull/1242)) +- updates near-workspaces-rs ([#1239](https://github.com/near/near-sdk-rs/pull/1239)) + ## [5.3.0](https://github.com/near/near-sdk-rs/compare/near-sdk-v5.2.1...near-sdk-v5.3.0) - 2024-08-13 ### Added diff --git a/Cargo.toml b/Cargo.toml index f12bfca8c..e90541710 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,15 +1,10 @@ [workspace] resolver = "2" -members = [ - "near-sdk", - "near-sdk-macros", - "near-contract-standards", - "near-sys", -] +members = ["near-sdk", "near-sdk-macros", "near-contract-standards", "near-sys"] exclude = ["examples/"] [workspace.package] -version = "5.3.0" +version = "5.4.0" # Special triple # comment for ci. [patch.crates-io] diff --git a/near-contract-standards/Cargo.toml b/near-contract-standards/Cargo.toml index 5e0d8f2bd..643c70145 100644 --- a/near-contract-standards/Cargo.toml +++ b/near-contract-standards/Cargo.toml @@ -13,10 +13,14 @@ NEAR smart contracts standard library. """ [dependencies] -near-sdk = { path = "../near-sdk", version = "~5.3.0", default-features = false, features = ["legacy"] } +near-sdk = { path = "../near-sdk", version = "~5.4.0", default-features = false, features = [ + "legacy", +] } [dev-dependencies] -near-sdk = { path = "../near-sdk", default-features = false, features = ["unit-testing"] } +near-sdk = { path = "../near-sdk", default-features = false, features = [ + "unit-testing", +] } [features] default = [] diff --git a/near-sdk/Cargo.toml b/near-sdk/Cargo.toml index f1b0c3c65..25f4cec83 100644 --- a/near-sdk/Cargo.toml +++ b/near-sdk/Cargo.toml @@ -21,7 +21,7 @@ required-features = ["abi", "unstable"] # Provide near_bidgen macros. serde = { version = "1", features = ["derive"] } serde_json = "1" -near-sdk-macros = { path = "../near-sdk-macros", version = "~5.3.0" } +near-sdk-macros = { path = "../near-sdk-macros", version = "~5.4.0" } near-sys = { path = "../near-sys", version = "0.2.2" } base64 = "0.22" borsh = { version = "1.0.0", features = ["derive"] } From 9f5caac2a4b6200f1479390c967c425662fa9e48 Mon Sep 17 00:00:00 2001 From: Artur Yurii Korchynskyi <42449190+akorchyn@users.noreply.github.com> Date: Wed, 11 Sep 2024 20:13:42 +0300 Subject: [PATCH 08/10] chore: Updated near-* dependendencies to v0.26.0. Migrated testing blockchain mock to C-unwind (#1244) --- examples/adder/Cargo.toml | 2 +- examples/callback-results/Cargo.toml | 2 +- examples/cross-contract-calls/Cargo.toml | 2 +- examples/factory-contract/Cargo.toml | 2 +- examples/fungible-token/Cargo.toml | 2 +- examples/lockable-fungible-token/Cargo.toml | 2 +- examples/non-fungible-token/Cargo.toml | 2 +- .../src/non_fungible_token/core/core_impl.rs | 6 +- near-sdk/Cargo.toml | 12 +- .../src/environment/mock/mocked_blockchain.rs | 110 +++++++++--------- near-sdk/tests/store_performance_tests.rs | 5 +- .../tests/test-contracts/store/Cargo.toml | 2 +- 12 files changed, 74 insertions(+), 75 deletions(-) diff --git a/examples/adder/Cargo.toml b/examples/adder/Cargo.toml index 89067b819..db361ee8e 100644 --- a/examples/adder/Cargo.toml +++ b/examples/adder/Cargo.toml @@ -11,7 +11,7 @@ crate-type = ["cdylib"] near-sdk = { path = "../../near-sdk" } [dev-dependencies] -near-workspaces = "0.12" +near-workspaces = "0.13" tokio = { version = "1.14", features = ["full"] } anyhow = "1.0" near-abi = "0.4.0" diff --git a/examples/callback-results/Cargo.toml b/examples/callback-results/Cargo.toml index 204eaad4a..b453d1d68 100644 --- a/examples/callback-results/Cargo.toml +++ b/examples/callback-results/Cargo.toml @@ -11,7 +11,7 @@ crate-type = ["cdylib"] near-sdk = { path = "../../near-sdk" } [dev-dependencies] -near-workspaces = "0.12" +near-workspaces = "0.13" tokio = { version = "1.14", features = ["full"] } anyhow = "1.0" near-sdk = { path = "../../near-sdk", features = ["unit-testing"] } diff --git a/examples/cross-contract-calls/Cargo.toml b/examples/cross-contract-calls/Cargo.toml index b02c26103..fa9af32de 100644 --- a/examples/cross-contract-calls/Cargo.toml +++ b/examples/cross-contract-calls/Cargo.toml @@ -9,7 +9,7 @@ anyhow = "1.0" near-sdk = { path = "../../near-sdk", features = ["default", "unit-testing"] } test-case = "2.0" tokio = { version = "1.14", features = ["full"] } -near-workspaces = "0.12" +near-workspaces = "0.13" cross-contract-high-level = { path = "./high-level" } cross-contract-low-level = { path = "./low-level" } diff --git a/examples/factory-contract/Cargo.toml b/examples/factory-contract/Cargo.toml index 4ba91fe3d..63d894610 100644 --- a/examples/factory-contract/Cargo.toml +++ b/examples/factory-contract/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" anyhow = "1.0" test-case = "2.0" tokio = { version = "1.14", features = ["full"] } -near-workspaces = "0.12" +near-workspaces = "0.13" near-sdk = { path = "../../near-sdk", features = ["unit-testing"] } [profile.release] diff --git a/examples/fungible-token/Cargo.toml b/examples/fungible-token/Cargo.toml index f48f872be..f808891a6 100644 --- a/examples/fungible-token/Cargo.toml +++ b/examples/fungible-token/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" anyhow = "1.0" near-sdk = { path = "../../near-sdk", features = ["unit-testing"] } tokio = { version = "1.14", features = ["full"] } -near-workspaces = "0.12" +near-workspaces = "0.13" [profile.release] codegen-units = 1 diff --git a/examples/lockable-fungible-token/Cargo.toml b/examples/lockable-fungible-token/Cargo.toml index 8a808e3bf..d6e9c28f3 100644 --- a/examples/lockable-fungible-token/Cargo.toml +++ b/examples/lockable-fungible-token/Cargo.toml @@ -14,7 +14,7 @@ near-sdk = { path = "../../near-sdk", features = ["legacy"] } anyhow = "1.0" tokio = { version = "1.14", features = ["full"] } near-sdk = { path = "../../near-sdk", features = ["unit-testing"] } -near-workspaces = "0.12" +near-workspaces = "0.13" [profile.release] codegen-units = 1 diff --git a/examples/non-fungible-token/Cargo.toml b/examples/non-fungible-token/Cargo.toml index fe4d40a0a..2edd9e0c4 100644 --- a/examples/non-fungible-token/Cargo.toml +++ b/examples/non-fungible-token/Cargo.toml @@ -9,7 +9,7 @@ anyhow = "1.0" near-contract-standards = { path = "../../near-contract-standards" } near-sdk = { path = "../../near-sdk", features = ["unit-testing"] } tokio = { version = "1.14", features = ["full"] } -near-workspaces = "0.12" +near-workspaces = "0.13" [profile.release] codegen-units = 1 diff --git a/near-contract-standards/src/non_fungible_token/core/core_impl.rs b/near-contract-standards/src/non_fungible_token/core/core_impl.rs index 733daf8f1..01cc6601a 100644 --- a/near-contract-standards/src/non_fungible_token/core/core_impl.rs +++ b/near-contract-standards/src/non_fungible_token/core/core_impl.rs @@ -432,11 +432,7 @@ impl NonFungibleTokenResolver for NonFungibleToken { // Get whether token should be returned let must_revert = match env::promise_result(0) { PromiseResult::Successful(value) => { - if let Ok(yes_or_no) = near_sdk::serde_json::from_slice::(&value) { - yes_or_no - } else { - true - } + near_sdk::serde_json::from_slice::(&value).unwrap_or(true) } PromiseResult::Failed => true, }; diff --git a/near-sdk/Cargo.toml b/near-sdk/Cargo.toml index 25f4cec83..209f80d72 100644 --- a/near-sdk/Cargo.toml +++ b/near-sdk/Cargo.toml @@ -42,11 +42,11 @@ schemars = { version = "0.8.8", optional = true } near-abi = { version = "0.4.0", features = [ "__chunked-entries", ], optional = true } -near-vm-runner = { version = "0.25", optional = true } -near-primitives-core = { version = "0.25", optional = true } -near-primitives = { version = "0.25", optional = true } -near-crypto = { version = "0.25", default-features = false, optional = true } -near-parameters = { version = "0.25", optional = true } +near-vm-runner = { version = "0.26", optional = true } +near-primitives-core = { version = "0.26", optional = true } +near-primitives = { version = "0.26", optional = true } +near-crypto = { version = "0.26", default-features = false, optional = true } +near-parameters = { version = "0.26", optional = true } [dev-dependencies] near-sdk = { path = ".", features = ["legacy", "unit-testing"] } @@ -63,7 +63,7 @@ rand_chacha = "0.3.1" near-rng = "0.1.1" near-abi = { version = "0.4.0", features = ["__chunked-entries"] } symbolic-debuginfo = "12" -near-workspaces = { version = "0.12", features = ["unstable"] } +near-workspaces = { version = "0.13", features = ["unstable"] } anyhow = "1.0" tokio = { version = "1", features = ["full"] } strum = "0.25.0" diff --git a/near-sdk/src/environment/mock/mocked_blockchain.rs b/near-sdk/src/environment/mock/mocked_blockchain.rs index fe7986377..418e91c05 100644 --- a/near-sdk/src/environment/mock/mocked_blockchain.rs +++ b/near-sdk/src/environment/mock/mocked_blockchain.rs @@ -197,91 +197,91 @@ mod mock_chain { } #[no_mangle] - extern "C" fn read_register(register_id: u64, ptr: u64) { + extern "C-unwind" fn read_register(register_id: u64, ptr: u64) { with_mock_interface(|b| b.read_register(register_id, ptr)) } #[no_mangle] - extern "C" fn register_len(register_id: u64) -> u64 { + extern "C-unwind" fn register_len(register_id: u64) -> u64 { with_mock_interface(|b| b.register_len(register_id)) } #[no_mangle] - extern "C" fn current_account_id(register_id: u64) { + extern "C-unwind" fn current_account_id(register_id: u64) { with_mock_interface(|b| b.current_account_id(register_id)) } #[no_mangle] - extern "C" fn signer_account_id(register_id: u64) { + extern "C-unwind" fn signer_account_id(register_id: u64) { with_mock_interface(|b| b.signer_account_id(register_id)) } #[no_mangle] - extern "C" fn signer_account_pk(register_id: u64) { + extern "C-unwind" fn signer_account_pk(register_id: u64) { with_mock_interface(|b| b.signer_account_pk(register_id)) } #[no_mangle] - extern "C" fn predecessor_account_id(register_id: u64) { + extern "C-unwind" fn predecessor_account_id(register_id: u64) { with_mock_interface(|b| b.predecessor_account_id(register_id)) } #[no_mangle] - extern "C" fn input(register_id: u64) { + extern "C-unwind" fn input(register_id: u64) { with_mock_interface(|b| b.input(register_id)) } #[no_mangle] - extern "C" fn block_index() -> u64 { + extern "C-unwind" fn block_index() -> u64 { with_mock_interface(|b| b.block_index()) } #[no_mangle] - extern "C" fn block_timestamp() -> u64 { + extern "C-unwind" fn block_timestamp() -> u64 { with_mock_interface(|b| b.block_timestamp()) } #[no_mangle] - extern "C" fn epoch_height() -> u64 { + extern "C-unwind" fn epoch_height() -> u64 { with_mock_interface(|b| b.epoch_height()) } #[no_mangle] - extern "C" fn storage_usage() -> u64 { + extern "C-unwind" fn storage_usage() -> u64 { with_mock_interface(|b| b.storage_usage()) } #[no_mangle] - extern "C" fn account_balance(balance_ptr: u64) { + extern "C-unwind" fn account_balance(balance_ptr: u64) { with_mock_interface(|b| b.account_balance(balance_ptr)) } #[no_mangle] - extern "C" fn account_locked_balance(balance_ptr: u64) { + extern "C-unwind" fn account_locked_balance(balance_ptr: u64) { with_mock_interface(|b| b.account_locked_balance(balance_ptr)) } #[no_mangle] - extern "C" fn attached_deposit(balance_ptr: u64) { + extern "C-unwind" fn attached_deposit(balance_ptr: u64) { with_mock_interface(|b| b.attached_deposit(balance_ptr)) } #[no_mangle] - extern "C" fn prepaid_gas() -> u64 { + extern "C-unwind" fn prepaid_gas() -> u64 { with_mock_interface(|b| b.prepaid_gas()) } #[no_mangle] - extern "C" fn used_gas() -> u64 { + extern "C-unwind" fn used_gas() -> u64 { with_mock_interface(|b| b.used_gas()) } #[no_mangle] - extern "C" fn random_seed(register_id: u64) { + extern "C-unwind" fn random_seed(register_id: u64) { with_mock_interface(|b| b.random_seed(register_id)) } #[no_mangle] - extern "C" fn sha256(value_len: u64, value_ptr: u64, register_id: u64) { + extern "C-unwind" fn sha256(value_len: u64, value_ptr: u64, register_id: u64) { with_mock_interface(|b| b.sha256(value_len, value_ptr, register_id)) } #[no_mangle] - extern "C" fn keccak256(value_len: u64, value_ptr: u64, register_id: u64) { + extern "C-unwind" fn keccak256(value_len: u64, value_ptr: u64, register_id: u64) { with_mock_interface(|b| b.keccak256(value_len, value_ptr, register_id)) } #[no_mangle] - extern "C" fn keccak512(value_len: u64, value_ptr: u64, register_id: u64) { + extern "C-unwind" fn keccak512(value_len: u64, value_ptr: u64, register_id: u64) { with_mock_interface(|b| b.keccak512(value_len, value_ptr, register_id)) } #[no_mangle] - extern "C" fn ripemd160(value_len: u64, value_ptr: u64, register_id: u64) { + extern "C-unwind" fn ripemd160(value_len: u64, value_ptr: u64, register_id: u64) { with_mock_interface(|b| b.ripemd160(value_len, value_ptr, register_id)) } #[no_mangle] - extern "C" fn ecrecover( + extern "C-unwind" fn ecrecover( hash_len: u64, hash_ptr: u64, sig_len: u64, @@ -295,7 +295,7 @@ mod mock_chain { }) } #[no_mangle] - extern "C" fn ed25519_verify( + extern "C-unwind" fn ed25519_verify( signature_len: u64, signature_ptr: u64, message_len: u64, @@ -315,29 +315,29 @@ mod mock_chain { }) } #[no_mangle] - extern "C" fn value_return(value_len: u64, value_ptr: u64) { + extern "C-unwind" fn value_return(value_len: u64, value_ptr: u64) { with_mock_interface(|b| b.value_return(value_len, value_ptr)) } #[no_mangle] - extern "C" fn panic() -> ! { + extern "C-unwind" fn panic() -> ! { with_mock_interface(|b| b.panic()); unreachable!() } #[no_mangle] - extern "C" fn panic_utf8(len: u64, ptr: u64) -> ! { + extern "C-unwind" fn panic_utf8(len: u64, ptr: u64) -> ! { with_mock_interface(|b| b.panic_utf8(len, ptr)); unreachable!() } #[no_mangle] - extern "C" fn log_utf8(len: u64, ptr: u64) { + extern "C-unwind" fn log_utf8(len: u64, ptr: u64) { with_mock_interface(|b| b.log_utf8(len, ptr)) } #[no_mangle] - extern "C" fn log_utf16(len: u64, ptr: u64) { + extern "C-unwind" fn log_utf16(len: u64, ptr: u64) { with_mock_interface(|b| b.log_utf16(len, ptr)) } #[no_mangle] - extern "C" fn promise_create( + extern "C-unwind" fn promise_create( account_id_len: u64, account_id_ptr: u64, function_name_len: u64, @@ -361,7 +361,7 @@ mod mock_chain { }) } #[no_mangle] - extern "C" fn promise_then( + extern "C-unwind" fn promise_then( promise_index: u64, account_id_len: u64, account_id_ptr: u64, @@ -387,15 +387,15 @@ mod mock_chain { }) } #[no_mangle] - extern "C" fn promise_and(promise_idx_ptr: u64, promise_idx_count: u64) -> u64 { + extern "C-unwind" fn promise_and(promise_idx_ptr: u64, promise_idx_count: u64) -> u64 { with_mock_interface(|b| b.promise_and(promise_idx_ptr, promise_idx_count)) } #[no_mangle] - extern "C" fn promise_batch_create(account_id_len: u64, account_id_ptr: u64) -> u64 { + extern "C-unwind" fn promise_batch_create(account_id_len: u64, account_id_ptr: u64) -> u64 { with_mock_interface(|b| b.promise_batch_create(account_id_len, account_id_ptr)) } #[no_mangle] - extern "C" fn promise_batch_then( + extern "C-unwind" fn promise_batch_then( promise_index: u64, account_id_len: u64, account_id_ptr: u64, @@ -403,11 +403,11 @@ mod mock_chain { with_mock_interface(|b| b.promise_batch_then(promise_index, account_id_len, account_id_ptr)) } #[no_mangle] - extern "C" fn promise_batch_action_create_account(promise_index: u64) { + extern "C-unwind" fn promise_batch_action_create_account(promise_index: u64) { with_mock_interface(|b| b.promise_batch_action_create_account(promise_index)) } #[no_mangle] - extern "C" fn promise_batch_action_deploy_contract( + extern "C-unwind" fn promise_batch_action_deploy_contract( promise_index: u64, code_len: u64, code_ptr: u64, @@ -417,7 +417,7 @@ mod mock_chain { }) } #[no_mangle] - extern "C" fn promise_batch_action_function_call( + extern "C-unwind" fn promise_batch_action_function_call( promise_index: u64, function_name_len: u64, function_name_ptr: u64, @@ -440,7 +440,7 @@ mod mock_chain { } #[no_mangle] - extern "C" fn promise_batch_action_function_call_weight( + extern "C-unwind" fn promise_batch_action_function_call_weight( promise_index: u64, function_name_len: u64, function_name_ptr: u64, @@ -465,11 +465,11 @@ mod mock_chain { } #[no_mangle] - extern "C" fn promise_batch_action_transfer(promise_index: u64, amount_ptr: u64) { + extern "C-unwind" fn promise_batch_action_transfer(promise_index: u64, amount_ptr: u64) { with_mock_interface(|b| b.promise_batch_action_transfer(promise_index, amount_ptr)) } #[no_mangle] - extern "C" fn promise_batch_action_stake( + extern "C-unwind" fn promise_batch_action_stake( promise_index: u64, amount_ptr: u64, public_key_len: u64, @@ -480,7 +480,7 @@ mod mock_chain { }) } #[no_mangle] - extern "C" fn promise_batch_action_add_key_with_full_access( + extern "C-unwind" fn promise_batch_action_add_key_with_full_access( promise_index: u64, public_key_len: u64, public_key_ptr: u64, @@ -496,7 +496,7 @@ mod mock_chain { }) } #[no_mangle] - extern "C" fn promise_batch_action_add_key_with_function_call( + extern "C-unwind" fn promise_batch_action_add_key_with_function_call( promise_index: u64, public_key_len: u64, public_key_ptr: u64, @@ -522,7 +522,7 @@ mod mock_chain { }) } #[no_mangle] - extern "C" fn promise_batch_action_delete_key( + extern "C-unwind" fn promise_batch_action_delete_key( promise_index: u64, public_key_len: u64, public_key_ptr: u64, @@ -532,7 +532,7 @@ mod mock_chain { }) } #[no_mangle] - extern "C" fn promise_batch_action_delete_account( + extern "C-unwind" fn promise_batch_action_delete_account( promise_index: u64, beneficiary_id_len: u64, beneficiary_id_ptr: u64, @@ -546,19 +546,19 @@ mod mock_chain { }) } #[no_mangle] - extern "C" fn promise_results_count() -> u64 { + extern "C-unwind" fn promise_results_count() -> u64 { with_mock_interface(|b| b.promise_results_count()) } #[no_mangle] - extern "C" fn promise_result(result_idx: u64, register_id: u64) -> u64 { + extern "C-unwind" fn promise_result(result_idx: u64, register_id: u64) -> u64 { with_mock_interface(|b| b.promise_result(result_idx, register_id)) } #[no_mangle] - extern "C" fn promise_return(promise_id: u64) { + extern "C-unwind" fn promise_return(promise_id: u64) { with_mock_interface(|b| b.promise_return(promise_id)) } #[no_mangle] - extern "C" fn storage_write( + extern "C-unwind" fn storage_write( key_len: u64, key_ptr: u64, value_len: u64, @@ -570,35 +570,35 @@ mod mock_chain { }) } #[no_mangle] - extern "C" fn storage_read(key_len: u64, key_ptr: u64, register_id: u64) -> u64 { + extern "C-unwind" fn storage_read(key_len: u64, key_ptr: u64, register_id: u64) -> u64 { with_mock_interface(|b| b.storage_read(key_len, key_ptr, register_id)) } #[no_mangle] - extern "C" fn storage_remove(key_len: u64, key_ptr: u64, register_id: u64) -> u64 { + extern "C-unwind" fn storage_remove(key_len: u64, key_ptr: u64, register_id: u64) -> u64 { with_mock_interface(|b| b.storage_remove(key_len, key_ptr, register_id)) } #[no_mangle] - extern "C" fn storage_has_key(key_len: u64, key_ptr: u64) -> u64 { + extern "C-unwind" fn storage_has_key(key_len: u64, key_ptr: u64) -> u64 { with_mock_interface(|b| b.storage_has_key(key_len, key_ptr)) } #[no_mangle] - extern "C" fn validator_stake(account_id_len: u64, account_id_ptr: u64, stake_ptr: u64) { + extern "C-unwind" fn validator_stake(account_id_len: u64, account_id_ptr: u64, stake_ptr: u64) { with_mock_interface(|b| b.validator_stake(account_id_len, account_id_ptr, stake_ptr)) } #[no_mangle] - extern "C" fn validator_total_stake(stake_ptr: u64) { + extern "C-unwind" fn validator_total_stake(stake_ptr: u64) { with_mock_interface(|b| b.validator_total_stake(stake_ptr)) } #[no_mangle] - extern "C" fn alt_bn128_g1_multiexp(value_len: u64, value_ptr: u64, register_id: u64) { + extern "C-unwind" fn alt_bn128_g1_multiexp(value_len: u64, value_ptr: u64, register_id: u64) { with_mock_interface(|b| b.alt_bn128_g1_multiexp(value_len, value_ptr, register_id)) } #[no_mangle] - extern "C" fn alt_bn128_g1_sum(value_len: u64, value_ptr: u64, register_id: u64) { + extern "C-unwind" fn alt_bn128_g1_sum(value_len: u64, value_ptr: u64, register_id: u64) { with_mock_interface(|b| b.alt_bn128_g1_sum(value_len, value_ptr, register_id)) } #[no_mangle] - extern "C" fn alt_bn128_pairing_check(value_len: u64, value_ptr: u64) -> u64 { + extern "C-unwind" fn alt_bn128_pairing_check(value_len: u64, value_ptr: u64) -> u64 { with_mock_interface(|b| b.alt_bn128_pairing_check(value_len, value_ptr)) } } diff --git a/near-sdk/tests/store_performance_tests.rs b/near-sdk/tests/store_performance_tests.rs index e15250d3c..1205e529e 100644 --- a/near-sdk/tests/store_performance_tests.rs +++ b/near-sdk/tests/store_performance_tests.rs @@ -246,6 +246,9 @@ async fn random_access() -> anyhow::Result<()> { .unwrap(); } + // Rust 1.81 improved performance of unordered collections. + let unordered_map = if rustversion::cfg!(since(1.81)) { 42 } else { 36 }; + // iter, repeat here is the number that reflects how many times we retrieve a random element. // It's used to measure relative performance. for (col, repeat) in collection_types.map(|col| match col { @@ -253,7 +256,7 @@ async fn random_access() -> anyhow::Result<()> { Collection::IterableSet => (col, 1750), Collection::IterableMap => (col, 745), Collection::UnorderedSet => (col, 41), - Collection::UnorderedMap => (col, 36), + Collection::UnorderedMap => (col, unordered_map), Collection::Vector => (col, 1700), _ => (col, 0), }) { diff --git a/near-sdk/tests/test-contracts/store/Cargo.toml b/near-sdk/tests/test-contracts/store/Cargo.toml index cfb1c1934..43dd2f1af 100644 --- a/near-sdk/tests/test-contracts/store/Cargo.toml +++ b/near-sdk/tests/test-contracts/store/Cargo.toml @@ -7,6 +7,6 @@ edition = "2021" crate-type = ["cdylib"] [dependencies] -near-sdk = { path = "../../../../near-sdk", features = ["default", "unstable"]} +near-sdk = { path = "../../../../near-sdk", features = ["default", "unstable"] } [workspace] From f5caed2af27e0c3984d34c3d1c943d6020b7ad2c Mon Sep 17 00:00:00 2001 From: Vlad Frolov Date: Wed, 11 Sep 2024 18:28:02 +0100 Subject: [PATCH 09/10] chore: release v5.5.0 (#1245) --- CHANGELOG.md | 6 ++++++ Cargo.toml | 2 +- near-contract-standards/CHANGELOG.md | 6 ++++++ near-contract-standards/Cargo.toml | 2 +- near-sdk/Cargo.toml | 2 +- 5 files changed, 15 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2dd48605..e7ce7d105 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## [Unreleased] +## [5.5.0](https://github.com/near/near-sdk-rs/compare/near-sdk-v5.4.0...near-sdk-v5.5.0) - 2024-09-11 + +### Other + +- Updated near-* dependendencies to v0.26.0. Migrated testing blockchain mock to C-unwind ([#1244](https://github.com/near/near-sdk-rs/pull/1244)) + ## [5.4.0](https://github.com/near/near-sdk-rs/compare/near-sdk-v5.3.0...near-sdk-v5.4.0) - 2024-09-04 ### Other diff --git a/Cargo.toml b/Cargo.toml index e90541710..a27e334a8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ members = ["near-sdk", "near-sdk-macros", "near-contract-standards", "near-sys"] exclude = ["examples/"] [workspace.package] -version = "5.4.0" +version = "5.5.0" # Special triple # comment for ci. [patch.crates-io] diff --git a/near-contract-standards/CHANGELOG.md b/near-contract-standards/CHANGELOG.md index e32005cd1..f512e5ceb 100644 --- a/near-contract-standards/CHANGELOG.md +++ b/near-contract-standards/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [5.5.0](https://github.com/near/near-sdk-rs/compare/near-contract-standards-v5.4.0...near-contract-standards-v5.5.0) - 2024-09-11 + +### Other + +- Updated near-* dependendencies to v0.26.0. Migrated testing blockchain mock to C-unwind ([#1244](https://github.com/near/near-sdk-rs/pull/1244)) + ## [5.3.0](https://github.com/near/near-sdk-rs/compare/near-contract-standards-v5.2.1...near-contract-standards-v5.3.0) - 2024-08-13 ### Fixed diff --git a/near-contract-standards/Cargo.toml b/near-contract-standards/Cargo.toml index 643c70145..432041ca9 100644 --- a/near-contract-standards/Cargo.toml +++ b/near-contract-standards/Cargo.toml @@ -13,7 +13,7 @@ NEAR smart contracts standard library. """ [dependencies] -near-sdk = { path = "../near-sdk", version = "~5.4.0", default-features = false, features = [ +near-sdk = { path = "../near-sdk", version = "~5.5.0", default-features = false, features = [ "legacy", ] } diff --git a/near-sdk/Cargo.toml b/near-sdk/Cargo.toml index 209f80d72..8108c43e7 100644 --- a/near-sdk/Cargo.toml +++ b/near-sdk/Cargo.toml @@ -21,7 +21,7 @@ required-features = ["abi", "unstable"] # Provide near_bidgen macros. serde = { version = "1", features = ["derive"] } serde_json = "1" -near-sdk-macros = { path = "../near-sdk-macros", version = "~5.4.0" } +near-sdk-macros = { path = "../near-sdk-macros", version = "~5.5.0" } near-sys = { path = "../near-sys", version = "0.2.2" } base64 = "0.22" borsh = { version = "1.0.0", features = ["derive"] } From f179a289528fbec5cd85077314e29deec198d0f3 Mon Sep 17 00:00:00 2001 From: Artur Yurii Korchynskyi <42449190+akorchyn@users.noreply.github.com> Date: Thu, 12 Sep 2024 14:28:49 +0300 Subject: [PATCH 10/10] chore: Updated near-workspaces to 0.14 version (matching 0.26 near-* release) (#1246) --- examples/adder/Cargo.toml | 2 +- examples/callback-results/Cargo.toml | 2 +- examples/cross-contract-calls/Cargo.toml | 2 +- examples/factory-contract/Cargo.toml | 2 +- examples/fungible-token/Cargo.toml | 2 +- examples/lockable-fungible-token/Cargo.toml | 2 +- examples/non-fungible-token/Cargo.toml | 2 +- near-sdk/Cargo.toml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/adder/Cargo.toml b/examples/adder/Cargo.toml index db361ee8e..54624f33c 100644 --- a/examples/adder/Cargo.toml +++ b/examples/adder/Cargo.toml @@ -11,7 +11,7 @@ crate-type = ["cdylib"] near-sdk = { path = "../../near-sdk" } [dev-dependencies] -near-workspaces = "0.13" +near-workspaces = "0.14" tokio = { version = "1.14", features = ["full"] } anyhow = "1.0" near-abi = "0.4.0" diff --git a/examples/callback-results/Cargo.toml b/examples/callback-results/Cargo.toml index b453d1d68..748c97ebd 100644 --- a/examples/callback-results/Cargo.toml +++ b/examples/callback-results/Cargo.toml @@ -11,7 +11,7 @@ crate-type = ["cdylib"] near-sdk = { path = "../../near-sdk" } [dev-dependencies] -near-workspaces = "0.13" +near-workspaces = "0.14" tokio = { version = "1.14", features = ["full"] } anyhow = "1.0" near-sdk = { path = "../../near-sdk", features = ["unit-testing"] } diff --git a/examples/cross-contract-calls/Cargo.toml b/examples/cross-contract-calls/Cargo.toml index fa9af32de..f32c5f152 100644 --- a/examples/cross-contract-calls/Cargo.toml +++ b/examples/cross-contract-calls/Cargo.toml @@ -9,7 +9,7 @@ anyhow = "1.0" near-sdk = { path = "../../near-sdk", features = ["default", "unit-testing"] } test-case = "2.0" tokio = { version = "1.14", features = ["full"] } -near-workspaces = "0.13" +near-workspaces = "0.14" cross-contract-high-level = { path = "./high-level" } cross-contract-low-level = { path = "./low-level" } diff --git a/examples/factory-contract/Cargo.toml b/examples/factory-contract/Cargo.toml index 63d894610..d94193794 100644 --- a/examples/factory-contract/Cargo.toml +++ b/examples/factory-contract/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" anyhow = "1.0" test-case = "2.0" tokio = { version = "1.14", features = ["full"] } -near-workspaces = "0.13" +near-workspaces = "0.14" near-sdk = { path = "../../near-sdk", features = ["unit-testing"] } [profile.release] diff --git a/examples/fungible-token/Cargo.toml b/examples/fungible-token/Cargo.toml index f808891a6..611bc14a6 100644 --- a/examples/fungible-token/Cargo.toml +++ b/examples/fungible-token/Cargo.toml @@ -8,7 +8,7 @@ edition = "2021" anyhow = "1.0" near-sdk = { path = "../../near-sdk", features = ["unit-testing"] } tokio = { version = "1.14", features = ["full"] } -near-workspaces = "0.13" +near-workspaces = "0.14" [profile.release] codegen-units = 1 diff --git a/examples/lockable-fungible-token/Cargo.toml b/examples/lockable-fungible-token/Cargo.toml index d6e9c28f3..e2356e017 100644 --- a/examples/lockable-fungible-token/Cargo.toml +++ b/examples/lockable-fungible-token/Cargo.toml @@ -14,7 +14,7 @@ near-sdk = { path = "../../near-sdk", features = ["legacy"] } anyhow = "1.0" tokio = { version = "1.14", features = ["full"] } near-sdk = { path = "../../near-sdk", features = ["unit-testing"] } -near-workspaces = "0.13" +near-workspaces = "0.14" [profile.release] codegen-units = 1 diff --git a/examples/non-fungible-token/Cargo.toml b/examples/non-fungible-token/Cargo.toml index 2edd9e0c4..7f9a7e530 100644 --- a/examples/non-fungible-token/Cargo.toml +++ b/examples/non-fungible-token/Cargo.toml @@ -9,7 +9,7 @@ anyhow = "1.0" near-contract-standards = { path = "../../near-contract-standards" } near-sdk = { path = "../../near-sdk", features = ["unit-testing"] } tokio = { version = "1.14", features = ["full"] } -near-workspaces = "0.13" +near-workspaces = "0.14" [profile.release] codegen-units = 1 diff --git a/near-sdk/Cargo.toml b/near-sdk/Cargo.toml index 8108c43e7..05c178b52 100644 --- a/near-sdk/Cargo.toml +++ b/near-sdk/Cargo.toml @@ -63,7 +63,7 @@ rand_chacha = "0.3.1" near-rng = "0.1.1" near-abi = { version = "0.4.0", features = ["__chunked-entries"] } symbolic-debuginfo = "12" -near-workspaces = { version = "0.13", features = ["unstable"] } +near-workspaces = { version = "0.14", features = ["unstable"] } anyhow = "1.0" tokio = { version = "1", features = ["full"] } strum = "0.25.0"