Skip to content

Commit 7d68658

Browse files
committed
ONE MORE TEST COMMIT
1 parent 9374731 commit 7d68658

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

src/lib/contracts/callContract.tsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,26 @@ export async function callContract(
4747
}
4848

4949
if (opts.customSigners) {
50+
const wallets: Wallet[] = [];
51+
52+
// @ts-expect-error
53+
if (!window.disableBrowserWalletRpc) {
54+
wallets.push(wallet);
55+
}
56+
57+
// @ts-expect-error
58+
if (!window.disablePublicRpc) {
59+
wallets.push(opts.customSigners[0]);
60+
}
61+
62+
// @ts-expect-error
63+
if (!window.disableFallbackRpc) {
64+
wallets.push(opts.customSigners[1]);
65+
}
66+
5067
// If we send the transaction to multiple RPCs simultaneously,
5168
// we should specify a fixed nonce to avoid possible txn duplication.
52-
txnOpts.nonce = await getBestNonce([wallet, ...opts.customSigners]);
69+
txnOpts.nonce = await getBestNonce(wallets);
5370
}
5471

5572
if (opts.showPreliminaryMsg && !opts.hideSentMsg) {

src/lib/contracts/utils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,8 @@ export async function getBestNonce(providers: Wallet[], timeout = 3000): Promise
5959
throw new Error(`None of providers returned nonce in ${timeout} ms`);
6060
}
6161

62+
// eslint-disable-next-line no-console
63+
console.log("Nonces been received: ", results);
64+
6265
return Math.max(...results);
6366
}

0 commit comments

Comments
 (0)