From 063181de67aad1a43a036c0a27f638884590caca Mon Sep 17 00:00:00 2001 From: sakura Date: Fri, 10 Nov 2023 09:55:06 +0800 Subject: [PATCH 1/2] fix: nft_approve --- .../src/non_fungible_token/approval/approval_impl.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/near-contract-standards/src/non_fungible_token/approval/approval_impl.rs b/near-contract-standards/src/non_fungible_token/approval/approval_impl.rs index 68aa841a3..f4e1751e1 100644 --- a/near-contract-standards/src/non_fungible_token/approval/approval_impl.rs +++ b/near-contract-standards/src/non_fungible_token/approval/approval_impl.rs @@ -8,9 +8,7 @@ use crate::non_fungible_token::utils::{ refund_approved_account_ids_iter, refund_deposit, }; use crate::non_fungible_token::NonFungibleToken; -use near_sdk::{assert_one_yocto, env, require, AccountId, Gas, Promise}; - -const GAS_FOR_NFT_APPROVE: Gas = Gas::from_tgas(10); +use near_sdk::{assert_one_yocto, env, require, AccountId, Promise}; fn expect_token_found(option: Option) -> T { option.unwrap_or_else(|| env::panic_str("Token not found")) @@ -59,7 +57,6 @@ impl NonFungibleTokenApproval for NonFungibleToken { // if given `msg`, schedule call to `nft_on_approve` and return it. Else, return None. msg.map(|msg| { ext_nft_approval_receiver::ext(account_id) - .with_static_gas(env::prepaid_gas().saturating_sub(GAS_FOR_NFT_APPROVE)) .nft_on_approve(token_id, owner_id, approval_id, msg) }) } From 4807444902853f3bdf855e01acd5e65e2a7f4c69 Mon Sep 17 00:00:00 2001 From: sakura Date: Fri, 10 Nov 2023 11:09:29 +0800 Subject: [PATCH 2/2] refactor: fmt --- .../src/non_fungible_token/approval/approval_impl.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/near-contract-standards/src/non_fungible_token/approval/approval_impl.rs b/near-contract-standards/src/non_fungible_token/approval/approval_impl.rs index f4e1751e1..5b6433a70 100644 --- a/near-contract-standards/src/non_fungible_token/approval/approval_impl.rs +++ b/near-contract-standards/src/non_fungible_token/approval/approval_impl.rs @@ -56,8 +56,12 @@ impl NonFungibleTokenApproval for NonFungibleToken { // if given `msg`, schedule call to `nft_on_approve` and return it. Else, return None. msg.map(|msg| { - ext_nft_approval_receiver::ext(account_id) - .nft_on_approve(token_id, owner_id, approval_id, msg) + ext_nft_approval_receiver::ext(account_id).nft_on_approve( + token_id, + owner_id, + approval_id, + msg, + ) }) }