From 88337b39bcc7bf215f51225125df9165c83998a4 Mon Sep 17 00:00:00 2001 From: Jacob Lindahl Date: Thu, 12 Oct 2023 22:49:13 +0900 Subject: [PATCH] chore: use pretty_assertions and fix gas issue --- workspaces-tests/Cargo.toml | 1 + workspaces-tests/tests/counter_multisig.rs | 1 + workspaces-tests/tests/escrow.rs | 1 + workspaces-tests/tests/fungible_token.rs | 1 + workspaces-tests/tests/native_multisig.rs | 1 + workspaces-tests/tests/non_fungible_token.rs | 3 ++- workspaces-tests/tests/rbac.rs | 1 + workspaces-tests/tests/simple_multisig.rs | 1 + workspaces-tests/tests/storage_fee.rs | 1 - workspaces-tests/tests/upgrade.rs | 1 + workspaces-tests/tests/upgrade_multisig.rs | 1 + 11 files changed, 11 insertions(+), 2 deletions(-) diff --git a/workspaces-tests/Cargo.toml b/workspaces-tests/Cargo.toml index 4c8c160..d48241b 100644 --- a/workspaces-tests/Cargo.toml +++ b/workspaces-tests/Cargo.toml @@ -69,6 +69,7 @@ thiserror.workspace = true [dev-dependencies] near-crypto = "0.15.0" tokio = "1.21.1" +pretty_assertions = "1.4.0" [target.'cfg(not(windows))'.dev-dependencies] near-workspaces = "0.8" diff --git a/workspaces-tests/tests/counter_multisig.rs b/workspaces-tests/tests/counter_multisig.rs index 7428b70..640da22 100644 --- a/workspaces-tests/tests/counter_multisig.rs +++ b/workspaces-tests/tests/counter_multisig.rs @@ -2,6 +2,7 @@ use near_sdk::serde_json::json; use near_workspaces::{Account, Contract}; +use pretty_assertions::assert_eq; const WASM: &[u8] = include_bytes!("../../target/wasm32-unknown-unknown/release/counter_multisig.wasm"); diff --git a/workspaces-tests/tests/escrow.rs b/workspaces-tests/tests/escrow.rs index d698995..b0308fe 100644 --- a/workspaces-tests/tests/escrow.rs +++ b/workspaces-tests/tests/escrow.rs @@ -5,6 +5,7 @@ use near_sdk::{ serde_json::{self, json}, }; use near_workspaces::{Account, AccountId, Contract}; +use pretty_assertions::assert_eq; use tokio::join; const WASM: &[u8] = include_bytes!("../../target/wasm32-unknown-unknown/release/escrow.wasm"); diff --git a/workspaces-tests/tests/fungible_token.rs b/workspaces-tests/tests/fungible_token.rs index 56a7cc9..610111f 100644 --- a/workspaces-tests/tests/fungible_token.rs +++ b/workspaces-tests/tests/fungible_token.rs @@ -2,6 +2,7 @@ use near_sdk::{json_types::U128, serde_json::json}; use near_workspaces::{Account, AccountId, Contract}; +use pretty_assertions::assert_eq; const WASM: &[u8] = include_bytes!("../../target/wasm32-unknown-unknown/release/fungible_token.wasm"); diff --git a/workspaces-tests/tests/native_multisig.rs b/workspaces-tests/tests/native_multisig.rs index b432af0..46b3003 100644 --- a/workspaces-tests/tests/native_multisig.rs +++ b/workspaces-tests/tests/native_multisig.rs @@ -11,6 +11,7 @@ use near_workspaces::{ types::{AccessKeyPermission, Finality}, Account, AccountDetailsPatch, Contract, DevNetwork, Worker, }; +use pretty_assertions::assert_eq; use tokio::{join, time::sleep}; const WASM: &[u8] = diff --git a/workspaces-tests/tests/non_fungible_token.rs b/workspaces-tests/tests/non_fungible_token.rs index f0680e7..9ec5673 100644 --- a/workspaces-tests/tests/non_fungible_token.rs +++ b/workspaces-tests/tests/non_fungible_token.rs @@ -10,6 +10,7 @@ use near_sdk_contract_tools::standard::{ nep297::Event, }; use near_workspaces::{operations::Function, types::Gas}; +use pretty_assertions::assert_eq; use tokio::task::JoinSet; use workspaces_tests_utils::{expect_execution_error, nft_token, setup, Setup}; @@ -708,7 +709,7 @@ async fn transfer_call_receiver_send_return() { "receiver_id": bob.id(), "msg": format!("transfer:{}", charlie.id()), })) - .gas(THIRTY_TERAGAS) // xtra gas + .gas(THIRTY_TERAGAS.saturating_mul(10)) // xtra gas .deposit(1) .transact() .await diff --git a/workspaces-tests/tests/rbac.rs b/workspaces-tests/tests/rbac.rs index 0255f23..4a5ffdb 100644 --- a/workspaces-tests/tests/rbac.rs +++ b/workspaces-tests/tests/rbac.rs @@ -7,6 +7,7 @@ use near_sdk::{ serde_json::{self, json}, }; use near_workspaces::{Account, AccountId, Contract}; +use pretty_assertions::assert_eq; use tokio::join; const WASM: &[u8] = include_bytes!("../../target/wasm32-unknown-unknown/release/rbac.wasm"); diff --git a/workspaces-tests/tests/simple_multisig.rs b/workspaces-tests/tests/simple_multisig.rs index cce6708..cf75814 100644 --- a/workspaces-tests/tests/simple_multisig.rs +++ b/workspaces-tests/tests/simple_multisig.rs @@ -2,6 +2,7 @@ use near_sdk::serde_json::json; use near_workspaces::{Account, Contract}; +use pretty_assertions::assert_eq; const WASM: &[u8] = include_bytes!("../../target/wasm32-unknown-unknown/release/simple_multisig.wasm"); diff --git a/workspaces-tests/tests/storage_fee.rs b/workspaces-tests/tests/storage_fee.rs index f8b9012..fe230e4 100644 --- a/workspaces-tests/tests/storage_fee.rs +++ b/workspaces-tests/tests/storage_fee.rs @@ -1,7 +1,6 @@ #![cfg(not(windows))] use near_sdk::{json_types::U128, serde_json::json, ONE_NEAR}; - use near_workspaces::{sandbox, Account, Contract, DevNetwork, Worker}; const WASM: &[u8] = include_bytes!("../../target/wasm32-unknown-unknown/release/storage_fee.wasm"); diff --git a/workspaces-tests/tests/upgrade.rs b/workspaces-tests/tests/upgrade.rs index 7db82c7..6392b3e 100644 --- a/workspaces-tests/tests/upgrade.rs +++ b/workspaces-tests/tests/upgrade.rs @@ -5,6 +5,7 @@ use near_sdk::{ serde::Serialize, }; use near_workspaces::{Account, Contract}; +use pretty_assertions::assert_eq; const WASM_BORSH: &[u8] = include_bytes!("../../target/wasm32-unknown-unknown/release/upgrade_old_borsh.wasm"); diff --git a/workspaces-tests/tests/upgrade_multisig.rs b/workspaces-tests/tests/upgrade_multisig.rs index 29cf1a7..715d8c4 100644 --- a/workspaces-tests/tests/upgrade_multisig.rs +++ b/workspaces-tests/tests/upgrade_multisig.rs @@ -2,6 +2,7 @@ use near_sdk::{json_types::Base64VecU8, serde_json::json}; use near_workspaces::{Account, Contract}; +use pretty_assertions::assert_eq; const WASM: &[u8] = include_bytes!("../../target/wasm32-unknown-unknown/release/upgrade_old_multisig.wasm");