diff --git a/cycles-ledger/src/main.rs b/cycles-ledger/src/main.rs index 5941ce0..c5009ae 100644 --- a/cycles-ledger/src/main.rs +++ b/cycles-ledger/src/main.rs @@ -436,8 +436,7 @@ fn icrc2_approve(args: ApproveArgs) -> Result { } let txid = storage::approve( - &from_account, - &args.spender, + (&from_account, &args.spender), amount, args.expires_at, now, diff --git a/cycles-ledger/src/storage.rs b/cycles-ledger/src/storage.rs index fcea024..e2b0045 100644 --- a/cycles-ledger/src/storage.rs +++ b/cycles-ledger/src/storage.rs @@ -419,8 +419,7 @@ pub fn allowance(account: &Account, spender: &Account, now: u64) -> (u128, u64) } pub fn approve( - from: &Account, - spender: &Account, + from_spender: (&Account, &Account), amount: u128, expires_at: Option, now: u64, @@ -428,6 +427,8 @@ pub fn approve( memo: Option, created_at_time: Option, ) -> Result { + let from = from_spender.0; + let spender = from_spender.1; let from_key = to_account_key(from); let from_balance = read_state(|s| s.balances.get(&from_key).unwrap_or_default());