Skip to content

Commit

Permalink
🐛 Fix iscn tx gas amount calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
williamchong committed Dec 29, 2023
1 parent f83c214 commit a98f1d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion constant/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export const TEST_MODE = process.env.NODE_ENV !== 'production' || process.env.CI

export const COSMOS_DENOM = IS_TESTNET ? 'nanoekil' : 'nanolike';

export const DEFAULT_GAS_PRICE = [{ amount: 1000, denom: COSMOS_DENOM }];
export const DEFAULT_GAS_PRICE = [{ amount: 10000, denom: COSMOS_DENOM }];
export const DEFAULT_GAS_PRICE_NUMBER = DEFAULT_GAS_PRICE[0].amount;
export const TRANSFER_GAS = 100000;

Expand Down
5 changes: 3 additions & 2 deletions utils/cosmos/iscn/sign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { OfflineSigner } from '@cosmjs/proto-signing';
import { ISCNSignPayload, ISCNSigningClient } from '@likecoin/iscn-js';
import network from '@/constant/network';
import { DeliverTxResponse } from '@cosmjs/stargate';
import { BigNumber } from 'bignumber.js';
import { ISCNRegisterPayload } from './iscn.type';
import { WALLET_TYPE_REPLACER, ISCN_GAS_FEE, DEFAULT_GAS_PRICE } from '~/constant'
import { getPublisherISCNPayload } from '.';
Expand Down Expand Up @@ -171,7 +172,7 @@ export async function signISCN(
gas,
amount: [{
denom: DEFAULT_GAS_PRICE[0].denom,
amount: DEFAULT_GAS_PRICE[0].amount.toString(),
amount: new BigNumber(gas).multipliedBy(DEFAULT_GAS_PRICE[0].amount).toFixed(0),
}],
},
})
Expand All @@ -181,7 +182,7 @@ export async function signISCN(
gas,
amount: [{
denom: DEFAULT_GAS_PRICE[0].denom,
amount: DEFAULT_GAS_PRICE[0].amount.toString(),
amount: new BigNumber(gas).multipliedBy(DEFAULT_GAS_PRICE[0].amount).toFixed(0),
}],
},
})
Expand Down

0 comments on commit a98f1d2

Please sign in to comment.