Skip to content

Commit

Permalink
rename function
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejdfinity committed Dec 11, 2024
1 parent 33a0fd6 commit c730fc2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions rs/ledger_suite/common/ledger_canister_core/src/ledger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,14 @@ where
L: LedgerData,
L::BalancesStore: InspectableBalancesStore,
{
let result = apply_transaction_no_prunning(ledger, transaction, now, effective_fee);
let result = apply_transaction_no_trimming(ledger, transaction, now, effective_fee);
trim_balances(ledger, now);
result
}

/// Adds a new block with the specified transaction to the ledger.
/// Do not perform any balance trimming.
pub fn apply_transaction_no_prunning<L>(
pub fn apply_transaction_no_trimming<L>(
ledger: &mut L,
transaction: L::Transaction,
now: TimeStamp,
Expand Down
4 changes: 2 additions & 2 deletions rs/ledger_suite/icrc1/ledger/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use ic_ledger_canister_core::{
archive::ArchiveCanisterWasm,
blockchain::Blockchain,
ledger::{
apply_transaction_no_prunning, block_locations, LedgerContext, LedgerData, TransactionInfo,
apply_transaction_no_trimming, block_locations, LedgerContext, LedgerData, TransactionInfo,
},
range_utils,
};
Expand Down Expand Up @@ -685,7 +685,7 @@ impl Ledger {
)
});
let mint = Transaction::mint(account, amount, Some(now), None);
apply_transaction_no_prunning(&mut ledger, mint, now, Tokens::ZERO).unwrap_or_else(
apply_transaction_no_trimming(&mut ledger, mint, now, Tokens::ZERO).unwrap_or_else(
|err| {
panic!(
"failed to mint {} tokens to {}: {:?}",
Expand Down
6 changes: 3 additions & 3 deletions rs/ledger_suite/icrc1/ledger/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use ic_icrc1_ledger::{
};
use ic_icrc1_ledger::{InitArgs, Ledger, LedgerArgument, LedgerField, LedgerState};
use ic_ledger_canister_core::ledger::{
apply_transaction_no_prunning, archive_blocks, LedgerAccess, LedgerContext, LedgerData,
apply_transaction_no_trimming, archive_blocks, LedgerAccess, LedgerContext, LedgerData,
TransferError as CoreTransferError,
};
use ic_ledger_canister_core::runtime::heap_memory_size_bytes;
Expand Down Expand Up @@ -669,7 +669,7 @@ fn execute_transfer_not_async(
)
};

let (block_idx, _) = apply_transaction_no_prunning(ledger, tx, now, effective_fee)?;
let (block_idx, _) = apply_transaction_no_trimming(ledger, tx, now, effective_fee)?;
Ok(block_idx)
})
}
Expand Down Expand Up @@ -868,7 +868,7 @@ async fn icrc2_approve(arg: ApproveArgs) -> Result<Nat, ApproveError> {
memo: arg.memo,
};

let (block_idx, _) = apply_transaction_no_prunning(ledger, tx, now, expected_fee_tokens)
let (block_idx, _) = apply_transaction_no_trimming(ledger, tx, now, expected_fee_tokens)
.map_err(convert_transfer_error)
.map_err(|err| {
let err: ApproveError = match err.try_into() {
Expand Down

0 comments on commit c730fc2

Please sign in to comment.