diff --git a/.github/workflows/test_examples.yml b/.github/workflows/test_examples.yml index 6393c73bd..df30b006a 100644 --- a/.github/workflows/test_examples.yml +++ b/.github/workflows/test_examples.yml @@ -13,7 +13,8 @@ jobs: strategy: matrix: platform: [ubuntu-latest, macos-latest] - toolchain: [stable] + toolchain: [1.81] + # toolchain: [stable] example: [ adder, callback-results, @@ -34,7 +35,7 @@ jobs: - uses: Swatinem/rust-cache@v1 with: working-directory: ./examples/${{ matrix.example }} - - name: Build status-message + - name: Build `status-message`, that `factory-contract` depends on if: matrix.example == 'factory-contract' env: RUSTFLAGS: '-C link-arg=-s' diff --git a/.github/workflows/test_examples_small.yml b/.github/workflows/test_examples_small.yml index 3a5ac95c8..f04392245 100644 --- a/.github/workflows/test_examples_small.yml +++ b/.github/workflows/test_examples_small.yml @@ -13,7 +13,8 @@ jobs: strategy: matrix: platform: [ubuntu-latest, macos-latest] - toolchain: [stable] + toolchain: [1.81] + # toolchain: [stable] steps: - uses: actions/checkout@v3 - name: "${{ matrix.toolchain }} with rustfmt, clippy, and wasm32" diff --git a/near-sdk/Cargo.toml b/near-sdk/Cargo.toml index 05c178b52..79178b012 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.14", features = ["unstable"] } +near-workspaces = { version = "0.14.1", features = ["unstable"] } anyhow = "1.0" tokio = { version = "1", features = ["full"] } strum = "0.25.0" diff --git a/near-sdk/src/environment/env.rs b/near-sdk/src/environment/env.rs index 873dd5454..e439318d4 100644 --- a/near-sdk/src/environment/env.rs +++ b/near-sdk/src/environment/env.rs @@ -105,6 +105,8 @@ pub fn set_blockchain_interface(blockchain_interface: MockedBlockchain) { /// Implements panic hook that converts `PanicInfo` into a string and provides it through the /// blockchain interface. +// TODO: replace with std::panic::PanicHookInfo when MSRV becomes >= 1.81.0 +#[allow(deprecated)] fn panic_hook_impl(info: &std_panic::PanicInfo) { panic_str(info.to_string().as_str()); } diff --git a/near-sdk/tests/store_performance_tests.rs b/near-sdk/tests/store_performance_tests.rs index 1205e529e..cb2a7e573 100644 --- a/near-sdk/tests/store_performance_tests.rs +++ b/near-sdk/tests/store_performance_tests.rs @@ -221,6 +221,7 @@ async fn iter() -> anyhow::Result<()> { Ok(()) } +#[allow(clippy::ifs_same_cond)] #[tokio::test] async fn random_access() -> anyhow::Result<()> { // LookupMap and LookupSet are not iterable. @@ -246,8 +247,14 @@ 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 }; + let unordered_map = if rustversion::cfg!(since(1.82)) { + 40 + // Rust 1.81 improved performance of unordered collections, 1.82 regressed it + } else 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.