Skip to content

Commit 6892d77

Browse files
committed
Fix typescript compile error
1 parent 246ee9a commit 6892d77

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

test/src/helper/chai-similar.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { U64 } from "codechain-primitives";
1818

1919
export const $else = Symbol("else");
2020

21-
interface Predicate {
21+
export interface Predicate {
2222
(_: any): boolean;
2323
toString(): string;
2424
}

test/src/tendermint.test/norpc.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ import CodeChain from "../helper/spawn";
128128
console.log("Txes prepared");
129129

130130
for (let k = 0; k < 4; k++) {
131-
131+
132132
let i = numTransactions - 1;
133133
while(i > 0) {
134134
console.log(`${i}`);
@@ -168,7 +168,7 @@ import CodeChain from "../helper/spawn";
168168
console.log("---------------------");
169169
console.log(`Block ${lastNum}`);
170170
const block = await nodes[0].sdk.rpc.chain.getBlock(lastNum);
171-
const txnum = block?.transactions.length!;
171+
const txnum = block!.transactions.length!;
172172
consumed += txnum;
173173
console.log(`Txs: ${txnum}`);
174174

@@ -205,7 +205,11 @@ import CodeChain from "../helper/spawn";
205205

206206
for (let i = 0; i <= bnEnd; i++) {
207207
const block = await nodes[0].sdk.rpc.chain.getBlock(i);
208-
console.log(`BLOCK${i} : ${block?.transactions.length}`);
208+
if (block != null) {
209+
console.log(`BLOCK${i} : ${block.transactions.length}`);
210+
} else {
211+
console.log(`BLOCK${i} : null`);
212+
}
209213
}
210214

211215
console.log(`TPS: ${tps}`);

0 commit comments

Comments
 (0)