From b41ed0960b70435db71167f2d54b1a46e8d30a6f Mon Sep 17 00:00:00 2001 From: Oleksandr Anyshchenko Date: Fri, 23 Feb 2024 17:33:04 +0000 Subject: [PATCH] fix: fix contract ft-receiver --- etc/tests/ft-receiver/src/lib.rs | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/etc/tests/ft-receiver/src/lib.rs b/etc/tests/ft-receiver/src/lib.rs index 4dbec6237..29c00f478 100644 --- a/etc/tests/ft-receiver/src/lib.rs +++ b/etc/tests/ft-receiver/src/lib.rs @@ -1,22 +1,28 @@ use near_contract_standards::fungible_token::receiver::FungibleTokenReceiver; -use near_sdk::borsh::{self, BorshDeserialize, BorshSerialize}; -use near_sdk::json_types::{U128, ValidAccountId}; -use near_sdk::{near_bindgen, log, PromiseOrValue}; +use near_sdk::borsh::{BorshDeserialize, BorshSerialize}; +use near_sdk::json_types::U128; +use near_sdk::{log, near_bindgen, AccountId, PromiseOrValue}; /// Will happily take and NEP-141 #[near_bindgen] #[derive(BorshDeserialize, BorshSerialize, Default)] +#[borsh(crate = "near_sdk::borsh")] struct DummyFungibleTokenReceiver; #[near_bindgen] impl FungibleTokenReceiver for DummyFungibleTokenReceiver { fn ft_on_transfer( &mut self, - sender_id: ValidAccountId, + sender_id: AccountId, amount: U128, msg: String, ) -> PromiseOrValue { - log!("in {} tokens from @{} ft_on_transfer, msg = {}", amount.0, sender_id.as_ref(), msg); + log!( + "in {} tokens from @{} ft_on_transfer, msg = {}", + amount.0, + sender_id, + msg + ); PromiseOrValue::Value(U128::from(0)) } }