Skip to content

Commit f1e264f

Browse files
committed
check tx receipt status
1 parent 80b5057 commit f1e264f

2 files changed

Lines changed: 12 additions & 6 deletions

File tree

tests/e2e/consensus/checks/index.mjs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ let broadcastedTransactions = [];
2020

2121
// Results
2222
let allPeersReachedTargetBlockNumber = false;
23-
let allTransactionsReportedByApi = true;
23+
let allTransactionsReportedByApi = false;
24+
let allTransactionsSuccessful = true;
2425

2526
const peerBlockNumberMap = new Map();
2627

@@ -39,16 +40,21 @@ const peerBlockNumberMap = new Map();
3940
async function waitForResults() {
4041
do {
4142
await sleep(1000);
42-
console.log("waiting for results...", { allPeersReachedTargetBlockNumber, allTransactionsReportedByApi });
43+
console.log("waiting for results...", { allPeersReachedTargetBlockNumber, allTransactionsReportedByApi, allTransactionsSuccessful });
4344

4445
if (!allTransactionsReportedByApi) {
4546
try {
4647
let allFound = true;
4748
for (const hash of broadcastedTransactions) {
4849
const transaction = await getApiHttp(config.peer, `/transactions/${hash}`);
4950
if (!transaction) {
50-
allFound = false;
51-
break;
51+
allFound = false;
52+
break;
53+
}
54+
55+
if (transaction.data.receipt.status !== 1) {
56+
console.log("transaction failed!!", transaction.data);
57+
allTransactionsSuccessful = false;
5258
}
5359
}
5460

@@ -62,7 +68,7 @@ async function waitForResults() {
6268

6369
console.log(`checks successful. exiting`);
6470

65-
process.exit(0);
71+
process.exit(allTransactionsSuccessful ? 0 : 1);
6672
}
6773

6874
async function broadcastTransactions() {

tests/e2e/consensus/checks/tx.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const makeEvmDeploy = async (
4646
let builder = app
4747
.resolve(EvmCallBuilder)
4848
.gasPrice("5000000000")
49-
.gasLimit(2_000_000)
49+
.gasLimit(4_000_000)
5050
.payload(abi.bytecode.object.slice(2))
5151
.nonce((walletNonce + nonceOffset).toString());
5252

0 commit comments

Comments
 (0)