From 457473c611b7e608b0a4a8f85f7386260d8aac01 Mon Sep 17 00:00:00 2001 From: Nam Chu Hoai Date: Thu, 4 Jan 2024 20:41:05 +0100 Subject: [PATCH] set gasprice on bsctestnet (#3120) ### Description Sets a somewhat arbitrary gas price on bsctestnet to get transactions going for the key-funder (and presumably kathy as well). It's a pretty blunt hammer for a not-helpful `transaction underpriced` error, but IMO fine enough ### Drive-by changes handleTx would not handle confirmations=0, and just set it to 1 --- typescript/infra/config/environments/testnet4/chains.ts | 7 ++++++- typescript/sdk/src/providers/MultiProvider.ts | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/typescript/infra/config/environments/testnet4/chains.ts b/typescript/infra/config/environments/testnet4/chains.ts index 3f87914ed..2c5fed600 100644 --- a/typescript/infra/config/environments/testnet4/chains.ts +++ b/typescript/infra/config/environments/testnet4/chains.ts @@ -14,7 +14,12 @@ export const ethereumTestnetConfigs: ChainMap = { maxPriorityFeePerGas: 40 * 10 ** 9, // 40 gwei }, }, - bsctestnet: chainMetadata.bsctestnet, + bsctestnet: { + ...chainMetadata.bsctestnet, + transactionOverrides: { + gasPrice: 80 * 10 ** 9, // 8 gwei + }, + }, goerli: chainMetadata.goerli, scrollsepolia: chainMetadata.scrollsepolia, sepolia: chainMetadata.sepolia, diff --git a/typescript/sdk/src/providers/MultiProvider.ts b/typescript/sdk/src/providers/MultiProvider.ts index 7973cc312..7e7d367d9 100644 --- a/typescript/sdk/src/providers/MultiProvider.ts +++ b/typescript/sdk/src/providers/MultiProvider.ts @@ -305,7 +305,7 @@ export class MultiProvider extends ChainMetadataManager { tx: ContractTransaction | Promise, ): Promise { const confirmations = - this.getChainMetadata(chainNameOrId).blocks?.confirmations || 1; + this.getChainMetadata(chainNameOrId).blocks?.confirmations ?? 1; const response = await tx; const txUrl = this.tryGetExplorerTxUrl(chainNameOrId, response); this.logger(