Skip to content

Commit 875cd3d

Browse files
committed
fix: hardcoded import of abis in upgrade test
1 parent eb5213f commit 875cd3d

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

core/tests/upgrade-test/tests/upgrade.test.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -591,15 +591,10 @@ async function publishBytecode(
591591
nonce: number
592592
): Promise<number> {
593593
const hash = zksync.utils.hashBytecode(bytecode);
594-
const abi = [
595-
'function publishBytecode(bytes calldata _bytecode) public',
596-
'function publishingBlock(bytes32 _hash) public view returns (uint256)'
597-
];
598-
599-
const contract = new ethers.Contract(bytecodeSupplierAddr, abi, wallet);
594+
const contract = new ethers.Contract(bytecodeSupplierAddr, contracts.bytecodesSupplierAbi, wallet);
600595
const block = await contract.publishingBlock(hash);
601596
if (block == BigInt(0)) {
602-
const tx = await contract.publishBytecode(bytecode, { nonce });
597+
const tx = await contract.publishEraBytecode(bytecode, { nonce });
603598
await tx.wait();
604599
return 1;
605600
}

core/tests/upgrade-test/tests/utils.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export interface Contracts {
4141
complexUpgraderAbi: any;
4242
counterBytecode: any;
4343
chainTypeManager: any;
44+
bytecodesSupplierAbi: any;
4445
}
4546

4647
export function initContracts(pathToHome: string, zkStack: boolean): Contracts {
@@ -70,6 +71,9 @@ export function initContracts(pathToHome: string, zkStack: boolean): Contracts {
7071
).deployedBytecode,
7172
chainTypeManager: new ethers.Interface(
7273
require(`${CONTRACTS_FOLDER}/l1-contracts/out/EraChainTypeManager.sol/EraChainTypeManager.json`).abi
74+
),
75+
bytecodesSupplierAbi: new ethers.Interface(
76+
require(`${CONTRACTS_FOLDER}/l1-contracts/out/BytecodesSupplier.sol/BytecodesSupplier.json`).abi
7377
)
7478
};
7579
} else {
@@ -99,6 +103,9 @@ export function initContracts(pathToHome: string, zkStack: boolean): Contracts {
99103
.deployedBytecode,
100104
chainTypeManager: new ethers.Interface(
101105
require(`${L1_CONTRACTS_FOLDER}/state-transition/ChainTypeManager.sol/ChainTypeManager.json`).abi
106+
),
107+
bytecodesSupplierAbi: new ethers.Interface(
108+
require(`${L1_CONTRACTS_FOLDER}/upgrades/BytecodesSupplier.sol/BytecodesSupplier.json`).abi
102109
)
103110
};
104111
}

0 commit comments

Comments
 (0)