Skip to content

Commit

Permalink
Fix token handling in SAC tests (#828)
Browse files Browse the repository at this point in the history
  • Loading branch information
tupui authored Jul 29, 2024
1 parent b53de80 commit 7143515
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions docs/build/guides/conventions/stellar-asset-contract.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,15 @@ Soroban Rust SDK provides an easy way to instantiate a Stellar Asset Contract to

use soroban_sdk::testutils::Address as _;
use soroban_sdk::{token, Address, Env};
use token::TokenClient;
use token::StellarAssetClient;
use token::{StellarAssetClient, TokenClient};

#[test]
fn test() {
let e = Env::default();
e.mock_all_auths();

let issuer = Address::random();
let distributer = Address::random();
let issuer = Address::generate(&e);
let distributor = Address::generate(&e);

let token_address = e.register_stellar_asset_contract(issuer.clone());

Expand All @@ -86,7 +85,7 @@ fn test() {
// E.g. to mint 1 TOKEN, we need to use 1*1e7 in the mint function.
let genesis_amount: i128 = 1_000_000_000 * 10_000_000;

token_sac.mint(&issuer, &distributer, &genesis_amount);
token_sac.mint(&distributor, &genesis_amount);

assert_eq!(token.balance(&distributor), genesis_amount);
}
Expand Down

0 comments on commit 7143515

Please sign in to comment.