Skip to content

Commit

Permalink
fix: canary browser test transfer method (#2126)
Browse files Browse the repository at this point in the history
  • Loading branch information
spypsy authored Sep 8, 2023
1 parent 13d3f16 commit a23b037
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions yarn-project/canary/src/aztec_js_browser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ conditionalDescribe()('e2e_aztec.js_browser', () => {
const wallet = await AztecJs.getSandboxAccountsWallet(client);
const contract = await Contract.at(AztecAddress.fromString(contractAddress), PrivateTokenContractAbi, wallet);
const balance = await contract.methods.getBalance(owner).view({ from: owner });
console.log(`Owner's balance: ${balance}`);
return balance;
},
SANDBOX_URL,
Expand All @@ -159,9 +160,13 @@ conditionalDescribe()('e2e_aztec.js_browser', () => {
const receiver = accounts[1].address;
const wallet = await AztecJs.getSandboxAccountsWallet(client);
const contract = await Contract.at(AztecAddress.fromString(contractAddress), PrivateTokenContractAbi, wallet);
await contract.methods.transfer(transferAmount, owner, receiver).send({ origin: owner }).wait();
await contract.methods.transfer(transferAmount, receiver).send({ origin: owner }).wait();
console.log(`Transferred ${transferAmount} tokens to new Account`);
return await contract.methods.getBalance(receiver).view({ from: receiver });
const receiverBalance = await contract.methods.getBalance(receiver).view({ from: receiver });
console.log(`Receiver's balance is now: ${receiverBalance}`);
const senderBalance = await contract.methods.getBalance(owner).view({ from: owner });
console.log(`Updated sender balance: ${senderBalance}`);
return receiverBalance;
},
SANDBOX_URL,
(await getPrivateTokenAddress()).toString(),
Expand Down

0 comments on commit a23b037

Please sign in to comment.