Skip to content

Commit

Permalink
ONE MORE TEST COMMIT
Browse files Browse the repository at this point in the history
  • Loading branch information
onemicky committed Jun 10, 2024
1 parent 9374731 commit 7d68658
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/lib/contracts/callContract.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,26 @@ export async function callContract(
}

if (opts.customSigners) {
const wallets: Wallet[] = [];

// @ts-expect-error
if (!window.disableBrowserWalletRpc) {
wallets.push(wallet);
}

// @ts-expect-error
if (!window.disablePublicRpc) {
wallets.push(opts.customSigners[0]);
}

// @ts-expect-error
if (!window.disableFallbackRpc) {
wallets.push(opts.customSigners[1]);
}

// If we send the transaction to multiple RPCs simultaneously,
// we should specify a fixed nonce to avoid possible txn duplication.
txnOpts.nonce = await getBestNonce([wallet, ...opts.customSigners]);
txnOpts.nonce = await getBestNonce(wallets);
}

if (opts.showPreliminaryMsg && !opts.hideSentMsg) {
Expand Down
3 changes: 3 additions & 0 deletions src/lib/contracts/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,5 +59,8 @@ export async function getBestNonce(providers: Wallet[], timeout = 3000): Promise
throw new Error(`None of providers returned nonce in ${timeout} ms`);
}

// eslint-disable-next-line no-console
console.log("Nonces been received: ", results);

return Math.max(...results);
}

0 comments on commit 7d68658

Please sign in to comment.