Skip to content

Commit 239e7e8

Browse files
committed
fix(simulations): shorter way of handling non-existing contract
1 parent a289743 commit 239e7e8

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

contracts/scripts/simulations/utils.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,7 @@ export const getContracts = async (hre) => {
2525
const pnk = (await hre.ethers.getContract("PNK")) as PNK;
2626
const randomizerRng = (await hre.ethers.getContract("RandomizerRNG")) as RandomizerRNG;
2727
const arbitrable = (await hre.ethers.getContract("ArbitrableExampleEthFee")) as ArbitrableExampleEthFee;
28-
let randomizerMock: RandomizerMock | undefined;
29-
30-
try {
31-
randomizerMock = (await hre.ethers.getContract("RandomizerMock")) as RandomizerMock;
32-
} catch (error) {
33-
console.log("RandomizerMock contract not found");
34-
}
28+
const randomizerMock = (await hre.ethers.getContract("RandomizerMock").catch(() => undefined)) as RandomizerMock;
3529

3630
return {
3731
core,

0 commit comments

Comments
 (0)