Skip to content

Commit 2013389

Browse files
Use 'account_balance' instead of the legacy 'account_balance_dfx'. (#4173)
1 parent 0a82e04 commit 2013389

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
# UNRELEASED
44

5+
### chore: use `account_balance` instead of the legacy `account_balance_dfx`
6+
7+
Use the `account_balance` rather than the legacy `account_balance_dfx` on the ICP ledger.
8+
59
### feat: Extend `dfx ledger transfer` and `dfx ledger balance` to support ICRC-1 standard
610

711
Extend `dfx ledger transfer` and `dfx ledger balance` to support [ICRC-1 standard](https://github.com/dfinity/ICRC-1/tree/main/standards/ICRC-1).

src/dfx/src/lib/ledger_types/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ pub struct Memo(pub u64);
121121

122122
#[derive(CandidType)]
123123
pub struct AccountBalanceArgs {
124-
pub account: String,
124+
pub account: AccountIdBlob,
125125
}
126126

127127
#[derive(CandidType)]

src/dfx/src/lib/operations/ledger.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ use icrc_ledger_types::icrc2::transfer_from::TransferFromError;
3636
use slog::{info, Logger};
3737
use std::time::{SystemTime, UNIX_EPOCH};
3838

39-
const ACCOUNT_BALANCE_METHOD: &str = "account_balance_dfx";
39+
const ACCOUNT_BALANCE_METHOD: &str = "account_balance";
4040
const TRANSFER_METHOD: &str = "transfer";
4141

4242
pub async fn balance(
@@ -52,7 +52,7 @@ pub async fn balance(
5252
let (result,) = canister
5353
.query(ACCOUNT_BALANCE_METHOD)
5454
.with_arg(AccountBalanceArgs {
55-
account: acct.to_string(),
55+
account: acct.to_address(),
5656
})
5757
.build()
5858
.call()

0 commit comments

Comments
 (0)