Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: canary browser test transfer method #2126

Merged
merged 1 commit into from
Sep 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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