Skip to content

Commit

Permalink
🩹 Set new gas when calling signISCN
Browse files Browse the repository at this point in the history
  • Loading branch information
AuroraHuang22 committed Jan 31, 2024
1 parent 550a499 commit e27c11e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion pages/edit/_iscnId.vue
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,8 @@
import { Vue, Component } from 'vue-property-decorator'
import { namespace } from 'vuex-class'
import { OfflineSigner } from '@cosmjs/proto-signing'
import { ISCN_PREFIX } from '~/constant'
import { BigNumber } from 'bignumber.js';
import { ISCN_PREFIX, ISCN_GAS_FEE, UPDATE_ISCN_GAS_MULTIPLIER } from '~/constant'
import { logTrackerEvent } from '~/utils/logger'
import { signISCN } from '~/utils/cosmos/iscn/sign'
import { extractIscnIdPrefix } from '~/utils/ui'
Expand Down Expand Up @@ -428,6 +429,7 @@ export default class EditIscnPage extends Vue {
await this.initIfNecessary()
const result = await signISCN(this.payload, this.signer, this.address, {
iscnId: this.iscnId,
gas: new BigNumber(ISCN_GAS_FEE).multipliedBy(UPDATE_ISCN_GAS_MULTIPLIER).toFixed(0),
})
if (result) {
this.$router.replace(
Expand Down
4 changes: 2 additions & 2 deletions utils/cosmos/iscn/sign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ 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, UPDATE_ISCN_GAS_MULTIPLIER } from '~/constant'
import { WALLET_TYPE_REPLACER, ISCN_GAS_FEE, DEFAULT_GAS_PRICE, ISCN_GAS_MULTIPLIER } from '~/constant'
import { getPublisherISCNPayload } from '.';
import { ISCN_PUBLISHERS } from '~/constant/iscn';

Expand Down Expand Up @@ -159,7 +159,7 @@ export async function signISCN(
{
iscnId,
memo,
gas = new BigNumber(ISCN_GAS_FEE).multipliedBy(UPDATE_ISCN_GAS_MULTIPLIER).toFixed(0),
gas = new BigNumber(ISCN_GAS_FEE).multipliedBy(ISCN_GAS_MULTIPLIER).toFixed(0),
}: { iscnId?: string, memo?: string, gas?: string } = {},
) {
const isUpdate = !!iscnId
Expand Down

0 comments on commit e27c11e

Please sign in to comment.