Skip to content

Commit 1749555

Browse files
tests: tx confirmed util shouldnt consider mempool as a valid first block
1 parent 1787816 commit 1749555

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

__tests__/integration/helpers/wallet.helper.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* LICENSE file in the root directory of this source tree.
66
*/
77

8-
import { get } from 'lodash';
8+
import { get, includes } from 'lodash';
99
import Connection from '../../../src/new/connection';
1010
import {
1111
DEBUG_LOGGING,
@@ -459,7 +459,9 @@ export async function waitTxConfirmed(
459459

460460
try {
461461
// Only return the positive response after the tx has a first block
462-
while ((await getTxFirstBlock(hWallet, txId)) === null) {
462+
// the nano contract txs are executing the method as soon as they arrive in the node
463+
// and adding the first_block as mempool so we shouldn't consider this as a valid first block for confirmation
464+
while (includes([null, 'mempool'], await getTxFirstBlock(hWallet, txId))) {
463465
await delay(1000);
464466

465467
// If we've reached the requested timeout, break the while loop

0 commit comments

Comments
 (0)