Create test the new pub key method
@@ -2,6 +2,8 @@ import { Tester } from './tester';
import { expect } from 'chai';
import { Wallet, types } from 'zksync';
import { ChangePubkeyTypes } from 'zksync/build/types';
+import * as zksync from 'zksync';
+import crypto from 'crypto';
type TokenLike = types.TokenLike;
@@ -34,7 +36,12 @@ Tester.prototype.testChangePubKey = async function (wallet: Wallet, feeToken: To
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;
-
+ expect(await wallet.isCorrectSigningKeySet(), 'ChangePubKey failed').to.be.true;
+ const oldSigner = wallet.signer;
+ wallet.signer = await zksync.Signer.fromSeed(crypto.randomBytes(32));
+ expect(await wallet.isSigningKeySet(), 'ChangePubKey failed').to.be.true;
+ expect(await wallet.isCorrectSigningKeySet(), 'Wrong signer for ChangePubKey failed').to.be.false;
+ wallet.signer = oldSigner;
const accountState = await wallet.getAccountState();
expect(accountState.accountType, 'Incorrect account type').to.be.eql('Owned');
