Skip to content

Commit 5850bf8

Browse files
committed
bump sdk version, fix tests by limiting gas for place_nft_for_sale transaction
1 parent 55ef238 commit 5850bf8

File tree

11 files changed

+19
-23
lines changed

11 files changed

+19
-23
lines changed

integration-tests/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ publish = false
55
edition = "2021"
66

77
[dev-dependencies]
8-
near-sdk = { version = "5.4.0", features = ["unit-testing"] }
9-
near-workspaces = { version = "0.14.1", features = ["unstable"] }
8+
near-sdk = { version = "5.11.0", features = ["unit-testing"] }
9+
near-workspaces = { version = "0.18.0", features = ["unstable"] }
1010
tokio = { version = "1.12.0", features = ["full"] }
1111
serde_json = "1"
1212

integration-tests/src/helpers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use near_sdk::Gas;
12
use near_workspaces::{
23
types::{AccountDetails, NearToken},
34
Account, Contract,
@@ -88,8 +89,7 @@ pub async fn place_nft_for_sale(
8889
let _ = user
8990
.call(market_contract.id(), "list_nft_for_sale")
9091
.args_json(request_payload)
91-
.max_gas()
92-
.deposit(NearToken::from_yoctonear(DEFAULT_DEPOSIT))
92+
.gas(Gas::from_tgas(100))
9393
.transact()
9494
.await;
9595

integration-tests/src/tests.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -182,15 +182,10 @@ async fn test_sell_nft_listed_on_marketplace(
182182
) -> Result<(), Box<dyn std::error::Error>> {
183183
let token_id = "4";
184184
let approval_id = 0;
185-
let sale_price: NearToken = NearToken::from_yoctonear(10000000000000000000000000);
185+
let sale_price: NearToken = NearToken::from_near(1);
186186

187187
helpers::mint_nft(seller, nft_contract, token_id).await?;
188-
helpers::pay_for_storage(
189-
seller,
190-
market_contract,
191-
NearToken::from_yoctonear(1000000000000000000000000),
192-
)
193-
.await?;
188+
helpers::pay_for_storage(seller, market_contract, NearToken::from_millinear(10)).await?;
194189
helpers::approve_nft(market_contract, seller, nft_contract, token_id).await?;
195190
helpers::place_nft_for_sale(
196191
seller,

market-contract/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ edition = "2021"
88
crate-type = ["cdylib", "rlib"]
99

1010
[dependencies]
11-
near-sdk = { version = "5.4.0", features = ["legacy"] }
11+
near-sdk = { version = "5.11.0", features = ["legacy"] }
1212

1313
[dev-dependencies]
14-
near-sdk = { version = "5.4.0", features = ["unit-testing"] }
15-
near-workspaces = { version = "0.14.1", features = ["unstable"] }
14+
near-sdk = { version = "5.11.0", features = ["unit-testing"] }
15+
near-workspaces = { version = "0.18.0", features = ["unstable"] }
1616
tokio = { version = "1.12.0", features = ["full"] }
1717
serde_json = "1"
1818

nft-contract-approval/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ edition = "2021"
88
crate-type = ["cdylib", "rlib"]
99

1010
[dependencies]
11-
near-sdk = { version = "5.4.0", features = ["legacy"] }
11+
near-sdk = { version = "5.11.0", features = ["legacy"] }
1212
serde_json = "1.0.113"
1313

1414
[profile.release]

nft-contract-basic/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ edition = "2021"
88
crate-type = ["cdylib", "rlib"]
99

1010
[dependencies]
11-
near-sdk = { version = "5.4.0", features = ["legacy"] }
11+
near-sdk = { version = "5.11.0", features = ["legacy"] }
1212

1313
[profile.release]
1414
codegen-units = 1

nft-contract-events/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ edition = "2021"
88
crate-type = ["cdylib", "rlib"]
99

1010
[dependencies]
11-
near-sdk = { version = "5.4.0", features = ["legacy"] }
11+
near-sdk = { version = "5.11.0", features = ["legacy"] }
1212
serde_json = "1.0.113"
1313

1414
[profile.release]

nft-contract-royalty/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ edition = "2021"
88
crate-type = ["cdylib", "rlib"]
99

1010
[dependencies]
11-
near-sdk = { version = "5.4.0", features = ["legacy"] }
11+
near-sdk = { version = "5.11.0", features = ["legacy"] }
1212
serde_json = "1.0.113"
1313

1414
[profile.release]

nft-contract-royalty/src/internal.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ where
2828
.map(bytes_for_approved_account_id)
2929
.sum();
3030
//transfer the account the storage that is released
31-
Promise::new(account_id).transfer(env::storage_byte_cost().saturating_mul(storage_released))
31+
let amount_to_be_released = env::storage_byte_cost().saturating_mul(storage_released);
32+
Promise::new(account_id).transfer(amount_to_be_released)
3233
}
3334

3435
//refund a map of approved account IDs and send the funds to the passed in account ID

nft-contract-skeleton/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ edition = "2021"
88
crate-type = ["cdylib", "rlib"]
99

1010
[dependencies]
11-
near-sdk = { version = "5.4.0", features = ["legacy"] }
11+
near-sdk = { version = "5.11.0", features = ["legacy"] }
1212

1313
[profile.release]
1414
codegen-units = 1

0 commit comments

Comments
 (0)