fn check_create_mint_transfer(mut client: ClientProxy) {
    // Create account 0, mint 10 coins and check balance
    client.create_next_account(false).unwrap();
    client
        .mint_coins(&["mintb", "0", "10", "Coin1"], true)
        .unwrap();
    assert!(compare_balances(
        vec![(10.0, "Coin1".to_string())],
        client.get_balances(&["b", "0"]).unwrap(),
    ));

    // Create account 1, mint 1 coin, transfer 3 coins from account 0 to 1, check balances
    client.create_next_account(false).unwrap();
    client
        .mint_coins(&["mintb", "1", "1", "Coin1"], true)
        .unwrap();
    client
        .transfer_coins(&["tb", "0", "1", "3", "Coin1"], true)
        .unwrap();
    assert!(compare_balances(
        vec![(7.0, "Coin1".to_string())],
        client.get_balances(&["b", "0"]).unwrap(),
    ));
    assert!(compare_balances(
        vec![(4.0, "Coin1".to_string())],
        client.get_balances(&["b", "1"]).unwrap(),
    ));

    // Create account 2, mint 15 coins and check balance
    client.create_next_account(false).unwrap();
    client
        .mint_coins(&["mintb", "2", "15", "Coin1"], true)
        .unwrap();
    assert!(compare_balances(
        vec![(15.0, "Coin1".to_string())],
        client.get_balances(&["b", "2"]).unwrap(),
    ));
}
/// This helper function creates 3 new accounts, mints funds, transfers funds
/// between the accounts and verifies that these operations succeed.
This helper function creates 3 new accounts, mints funds, transfers funds
between the accounts and verifies that these operations succeed.
This helper function creates 3 new accounts mints funds transfers funds between the accounts and verifies that these operations succeed .
fn check_create_mint_transfer(mut client: ClientProxy) {
    // Create account 0, mint 10 coins and check balance
    client.create_next_account(false).unwrap();
    client
        .mint_coins(&["mintb", "0", "10", "Coin1"], true)
        .unwrap();
    assert!(compare_balances(
        vec![(10.0, "Coin1".to_string())],
        client.get_balances(&["b", "0"]).unwrap(),
    ));
    // Create account 1, mint 1 coin, transfer 3 coins from account 0 to 1, check balances
    client.create_next_account(false).unwrap();
    client
        .mint_coins(&["mintb", "1", "1", "Coin1"], true)
        .unwrap();
    client
        .transfer_coins(&["tb", "0", "1", "3", "Coin1"], true)
        .unwrap();
    assert!(compare_balances(
        vec![(7.0, "Coin1".to_string())],
        client.get_balances(&["b", "0"]).unwrap(),
    ));
    assert!(compare_balances(
        vec![(4.0, "Coin1".to_string())],
        client.get_balances(&["b", "1"]).unwrap(),
    ));
    // Create account 2, mint 15 coins and check balance
    client.create_next_account(false).unwrap();
    client
        .mint_coins(&["mintb", "2", "15", "Coin1"], true)
        .unwrap();
    assert!(compare_balances(
        vec![(15.0, "Coin1".to_string())],
        client.get_balances(&["b", "2"]).unwrap(),
    ));
}
fn check_create_mint_transfer ( mut client : ClientProxy ) { // Create account 0, mint 10 coins and check balance client . create_next_account ( false ) . unwrap ( ) ; client . mint_coins ( & [ " " , " " , " " , " " ] , true ) . unwrap ( ) ; assert ! ( compare_balances ( vec [ ( 10.0 " " to_string ( ) ) ] client get_balances ( [ " " " " ] ) unwrap ( ) ) ) ; // Create account 1, mint 1 coin, transfer 3 coins from account 0 to 1, check balances client . create_next_account ( false ) . unwrap ( ) ; client . mint_coins ( & [ " " , " " , " " , " " ] , true ) . unwrap ( ) ; client . transfer_coins ( & [ " " , " " , " " , " " , " " ] , true ) . unwrap ( ) ; assert ! ( compare_balances ( vec [ ( 7.0 " " to_string ( ) ) ] client get_balances ( [ " " " " ] ) unwrap ( ) ) ) ; assert ! ( compare_balances ( vec [ ( 4.0 " " to_string ( ) ) ] client get_balances ( [ " " " " ] ) unwrap ( ) ) ) ; // Create account 2, mint 15 coins and check balance client . create_next_account ( false ) . unwrap ( ) ; client . mint_coins ( & [ " " , " " , " " , " " ] , true ) . unwrap ( ) ; assert ! ( compare_balances ( vec [ ( 15.0 " " to_string ( ) ) ] client get_balances ( [ " " " " ] ) unwrap ( ) ) ) ; }
This helper function creates 3 new accounts, mints funds, transfers funds
between the accounts and verifies that these operations succeed.
This helper function creates 3 new accounts mints funds transfers funds between the accounts and verifies that these operations succeed .
client
ClientProxy
client
ClientProxy