fn transfer(
    ctx: &ic_fondue::pot::Context,
    rt: &tokio::runtime::Runtime,
    ledger: &Canister,
    from: &util::UniversalCanister,
    to: &util::UniversalCanister,
    amount: u64,
) {
    rt.block_on(async move {
        let balance = util::get_icp_balance(
            ledger,
            &CanisterId::try_from(to.canister_id().as_slice()).unwrap(),
            None,
        )
        .await;
        util::transact_icp(ctx, ledger, from, amount, to, balance.get_e8s() + amount).await;
    });
}
/// Transfers `amount` of ICP between two given canisters and verifies that the
/// balance of the target canister is `amount` more than before the request.
/// Crashes if the update request doesn't succeed or the balance is not as
/// expected afterwards.
Transfers `amount` of ICP between two given canisters and verifies that the
balance of the target canister is `amount` more than before the request.
Crashes if the update request doesn't succeed or the balance is not as
expected afterwards.
Transfers ` amount ` of ICP between two given canisters and verifies that the balance of the target canister is ` amount ` more than before the request . Crashes if the update request doesn ' t succeed or the balance is not as expected afterwards .
fn transfer(
    ctx: &ic_fondue::pot::Context,
    rt: &tokio::runtime::Runtime,
    ledger: &Canister,
    from: &util::UniversalCanister,
    to: &util::UniversalCanister,
    amount: u64,
) {
    rt.block_on(async move {
        let balance = util::get_icp_balance(
            ledger,
            &CanisterId::try_from(to.canister_id().as_slice()).unwrap(),
            None,
        )
        .await;
        util::transact_icp(ctx, ledger, from, amount, to, balance.get_e8s() + amount).await;
    });
}
fn transfer ( ctx : & ic_fondue :: pot :: Context , rt : & tokio :: runtime :: Runtime , ledger : & Canister , from : & util :: UniversalCanister , to : & util :: UniversalCanister , amount : u64 , ) { rt . block_on ( async move { let balance = util :: get_icp_balance ( ledger , & CanisterId :: try_from ( to . canister_id ( ) . as_slice ( ) ) . unwrap ( ) , None , ) . await ; util :: transact_icp ( ctx , ledger , from , amount , to , balance . get_e8s ( ) + amount ) . await ; } ) ; }
Transfers `amount` of ICP between two given canisters and verifies that the
balance of the target canister is `amount` more than before the request.
Transfers ` amount ` of ICP between two given canisters and verifies that the balance of the target canister is ` amount ` more than before the request .
ctx
&ic_fondue::pot::Context
rt
&tokio::runtime::Runtime
ledger
&Canister
from
&util::UniversalCanister
to
&util::UniversalCanister
amount
u64
ctx
&ic_fondue::pot::Context
rt
&tokio::runtime::Runtime
ledger
&Canister
from
&util::UniversalCanister
to
&util::UniversalCanister
amount
u64