From bf5ceed63d9e21e4e6250241239c33a9e0b2ac6c Mon Sep 17 00:00:00 2001 From: "Bob(xsb.near)" <389483673@qq.com> Date: Thu, 27 Jun 2024 11:46:48 +0800 Subject: [PATCH] fix: use transfer instead of transferFrom in collect_ledger_fee (#70) --- route/icp/src/main.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/route/icp/src/main.rs b/route/icp/src/main.rs index 7c111a78..81ae9b62 100644 --- a/route/icp/src/main.rs +++ b/route/icp/src/main.rs @@ -23,7 +23,7 @@ use icp_route::{ }; use icrc_ledger_client_cdk::{CdkRuntime, ICRC1Client}; use icrc_ledger_types::icrc1::account::Account; -use icrc_ledger_types::icrc2::transfer_from::TransferFromArgs; +use icrc_ledger_types::icrc1::transfer::TransferArg; use omnity_types::log::{init_log, StableLogWriter}; use omnity_types::{Chain, ChainId}; @@ -146,14 +146,13 @@ pub async fn collect_ledger_fee( }; client - .transfer_from(TransferFromArgs { - spender_subaccount: None, - from: collector, + .transfer(TransferArg { + from_subaccount: Some(FEE_COLLECTOR_SUB_ACCOUNT.clone()), to: receiver, - amount: transfer_amount, fee: None, - memo: None, created_at_time: Some(ic_cdk::api::time()), + memo: None, + amount: transfer_amount, }) .await .map_err(|(code, msg)| {