Skip to content

Commit 8c91784

Browse files
committed
fix: coderabbit
1 parent 9c01a4c commit 8c91784

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

contracts/test/arbitration/draw.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ describe("Draw Benchmark", async () => {
137137
const tx = await arbitrable["createDispute(string)"]("future of france", {
138138
value: arbitrationCost,
139139
});
140+
await tx.wait();
140141
if (tx.blockNumber === null) throw new Error("tx.blockNumber is null");
141142
const trace = await network.provider.send("debug_traceTransaction", [tx.hash]);
142143
const [disputeId] = abiCoder.decode(["uint"], ethers.getBytes(`${trace.returnValue}`));
@@ -208,6 +209,7 @@ describe("Draw Benchmark", async () => {
208209
expect(await core.getRoundInfo(0, 0).then((round) => round.drawIterations)).to.equal(3);
209210

210211
const tx = await (await drawTx).wait();
212+
if (!tx) throw new Error("Failed to get transaction receipt");
211213
expect(tx)
212214
.to.emit(core, "Draw")
213215
.withArgs(anyValue, 0, 0, 0)
@@ -306,7 +308,7 @@ describe("Draw Benchmark", async () => {
306308
expect(await core.getRoundInfo(0, 0).then((round) => round.drawIterations)).to.equal(3);
307309

308310
const tx = await (await drawTx).wait();
309-
if (tx === null) throw new Error("tx is null");
311+
if (!tx) throw new Error("Failed to get transaction receipt");
310312
expect(tx)
311313
.to.emit(core, "Draw")
312314
.withArgs(anyValue, 0, 0, 0)
@@ -368,7 +370,7 @@ describe("Draw Benchmark", async () => {
368370
expect(await core.getRoundInfo(0, 0).then((round) => round.drawIterations)).to.equal(3);
369371

370372
const tx = await (await drawTx).wait();
371-
if (tx === null) throw new Error("tx is null");
373+
if (!tx) throw new Error("Failed to get transaction receipt");
372374
expect(tx)
373375
.to.emit(core, "Draw")
374376
.withArgs(anyValue, 0, 0, 0)

contracts/test/integration/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ describe("Integration tests", async () => {
129129
);
130130
console.log("dispute hash: ", disputeHash);
131131
if (lastBlock.hash === null) {
132-
process.exit();
132+
throw new Error("Block hash is null - cannot calculate dispute hash");
133133
}
134134
// Relayer tx
135135
const tx2 = await homeGateway

contracts/test/rng/index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,16 @@ describe("BlockHashRNG", async () => {
3333
});
3434

3535
it("Should return a non-zero number for a block number in the past", async () => {
36-
const tx = await rng.receiveRandomness(9876543210);
36+
const tx = await rng.receiveRandomness(5);
3737
const trace = await network.provider.send("debug_traceTransaction", [tx.hash]);
3838
const [rn] = abiCoder.decode(["uint"], ethers.getBytes(`${trace.returnValue}`));
39-
expect(rn).to.equal(0);
39+
expect(rn).to.not.equal(0);
4040
});
4141

4242
it("Should return zero for a block number in the future", async () => {
43-
const tx = await rng.receiveRandomness(5);
43+
const tx = await rng.receiveRandomness(9876543210);
4444
const trace = await network.provider.send("debug_traceTransaction", [tx.hash]);
4545
const [rn] = abiCoder.decode(["uint"], ethers.getBytes(`${trace.returnValue}`));
46-
expect(rn).to.not.equal(0);
46+
expect(rn).to.equal(0);
4747
});
4848
});

0 commit comments

Comments
 (0)