Skip to content

Commit

Permalink
Improvement to avoid problems when the gasPrice could not be found.
Browse files Browse the repository at this point in the history
  • Loading branch information
danilo-silva-funttastic committed Feb 22, 2024
1 parent e938e00 commit a5b28d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/connectors/kujira/kujira.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export namespace KujiraConfig {
accountNumber: configManager.get('kujira.accountNumber') || 0,
nativeToken: 'KUJI',
gasPrice: configManager.get('kujira.gasPrice') ? BigNumber(configManager.get('kujira.gasPrice')) : null,
fallbackGasPrice: BigNumber(0.0034),
gasPriceSuffix: 'ukuji',
gasLimitEstimate: BigNumber(
configManager.get('kujira.gasLimitEstimate') || 0.009147
Expand Down
7 changes: 6 additions & 1 deletion src/connectors/kujira/kujira.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,12 @@ export class Kujira {
this.kujiraNetworkNativeFees = getNotNullOrThrowError<FeeCurrency>(
this.kujiraNetworkInfo['feeCurrencies'].find(it => it.coinDenom == config.nativeToken)
);
this.kujiraNetworkNativeGasPrice = config.gasPrice || BigNumber(getNotNullOrThrowError<number>(this.kujiraNetworkNativeFees.gasPriceStep?.low));

try {
this.kujiraNetworkNativeGasPrice = config.gasPrice || BigNumber(getNotNullOrThrowError<number>(this.kujiraNetworkNativeFees.gasPriceStep?.low));
} catch (exception) {
this.kujiraNetworkNativeGasPrice = config.fallbackGasPrice;
}

this.accounts = IMap<OwnerAddress, KujiraWalletArtifacts>().asMutable();
}
Expand Down

0 comments on commit a5b28d7

Please sign in to comment.