Skip to content

Commit

Permalink
make test more robust #2
Browse files Browse the repository at this point in the history
  • Loading branch information
AnastasiiaVashchuk committed Jun 12, 2024
1 parent 9108100 commit 2a0abfa
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions core/tests/ts-integration/tests/api/web3.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -937,8 +937,10 @@ describe('web3 API compatibility tests', () => {
// We want to be sure that correct(outer) contract address is return in the transaction receipt,
// when there is a contract that initializa another contract in the constructor
test('Should check inner-outer contract address in the receipt of the deploy tx', async () => {
const nonce = await alice.getNonce();
const expectedAddress = zksync.utils.createAddress(alice.address, nonce);
const deploymentNonce = await alice.getDeploymentNonce();
const expectedAddress = zksync.utils.createAddress(alice.address, deploymentNonce);

const expectedBytecode = contracts.outer.bytecode;

let innerContractBytecode = contracts.inner.bytecode;
let outerContractOverrides = {
Expand All @@ -949,7 +951,10 @@ describe('web3 API compatibility tests', () => {
const outerContract = await deployContract(alice, contracts.outer, [1], undefined, outerContractOverrides);
let receipt = await outerContract.deployTransaction.wait();

const deployedBytecode = await alice.provider.getCode(receipt.contractAddress);

expect(expectedAddress).toEqual(receipt.contractAddress);
expect(expectedBytecode).toEqual(deployedBytecode)
});

afterAll(async () => {
Expand Down

0 comments on commit 2a0abfa

Please sign in to comment.