Skip to content

Commit

Permalink
Add new wallet for change pubkey offchain test
Browse files Browse the repository at this point in the history
  • Loading branch information
vladbochok committed Dec 1, 2020
1 parent c19f901 commit ab189bc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion core/tests/ts-tests/tests/change-pub-key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Tester.prototype.testChangePubKey = async function (wallet: Wallet, feeToken: To
onchainAuth: onchain
});

const receipt = await changePubkeyHandle.awaitVerifyReceipt();
const receipt = await changePubkeyHandle.awaitReceipt();
expect(receipt.success, `ChangePubKey transaction failed with a reason: ${receipt.failReason}`).to.be.true;
expect(await wallet.isSigningKeySet(), 'ChangePubKey failed').to.be.true;
this.runningFee = this.runningFee.add(fee);
Expand Down
20 changes: 11 additions & 9 deletions core/tests/ts-tests/tests/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ describe(`ZkSync integration tests (token: ${token}, transport: ${transport})`,
let tester: Tester;
let alice: Wallet;
let bob: Wallet;
let chuck: Wallet;
let operatorBalance: BigNumber;

before('create tester and test wallets', async () => {
tester = await Tester.init('localhost', transport);
alice = await tester.fundedWallet('5.0');
bob = await tester.emptyWallet();
chuck = await tester.emptyWallet();
operatorBalance = await tester.operatorBalance(token);
});

Expand Down Expand Up @@ -59,13 +61,21 @@ describe(`ZkSync integration tests (token: ${token}, transport: ${transport})`,
});

step('should execute a transfer to new account', async () => {
await tester.testTransfer(alice, bob, token, TX_AMOUNT);
await tester.testTransfer(alice, chuck, token, TX_AMOUNT);
});

step('should execute a transfer to existing account', async () => {
await tester.testTransfer(alice, chuck, token, TX_AMOUNT);
});

it('should execute a transfer to self', async () => {
await tester.testTransfer(alice, alice, token, TX_AMOUNT);
});

step('should change pubkey offchain', async () => {
await tester.testChangePubKey(chuck, token, false);
});

step('should test multi-transfers', async () => {
await tester.testBatch(alice, bob, token, TX_AMOUNT);
await tester.testIgnoredBatch(alice, bob, token, TX_AMOUNT);
Expand All @@ -79,14 +89,6 @@ describe(`ZkSync integration tests (token: ${token}, transport: ${transport})`,
step('should execute a ForcedExit', async () => {
await tester.testVerifiedForcedExit(alice, bob, token);
});

step('should execute a transfer to existing account', async () => {
await tester.testTransfer(alice, bob, token, TX_AMOUNT);
});

step('should change pubkey offchain', async () => {
await tester.testChangePubKey(bob, token, false);
});

it('should check collected fees', async () => {
const collectedFee = (await tester.operatorBalance(token)).sub(operatorBalance);
Expand Down

0 comments on commit ab189bc

Please sign in to comment.