From 550a4999f11b8238f075b1e53b4aa3e2ebcd0818 Mon Sep 17 00:00:00 2001 From: AuroraHuang22 Date: Wed, 24 Jan 2024 19:56:44 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=A9=B9=20Increase=20gas=20multiplier?= =?UTF-8?q?=20for=20updating=20ISCN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- constant/index.ts | 1 + utils/cosmos/iscn/sign.ts | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/constant/index.ts b/constant/index.ts index 380d8e6c..b241a756 100644 --- a/constant/index.ts +++ b/constant/index.ts @@ -18,6 +18,7 @@ export const ISCN_MIN_BALANCE = 0.01; export const ISCN_GAS_FEE = 200000; export const ISCN_GAS_MULTIPLIER = 1.5; +export const UPDATE_ISCN_GAS_MULTIPLIER = 1.75; export const ISCN_REGISTRY_NAME = 'likecoin-chain'; diff --git a/utils/cosmos/iscn/sign.ts b/utils/cosmos/iscn/sign.ts index feee7f9a..725476cf 100644 --- a/utils/cosmos/iscn/sign.ts +++ b/utils/cosmos/iscn/sign.ts @@ -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, ISCN_GAS_MULTIPLIER } from '~/constant' +import { WALLET_TYPE_REPLACER, ISCN_GAS_FEE, DEFAULT_GAS_PRICE, UPDATE_ISCN_GAS_MULTIPLIER } from '~/constant' import { getPublisherISCNPayload } from '.'; import { ISCN_PUBLISHERS } from '~/constant/iscn'; @@ -159,7 +159,7 @@ export async function signISCN( { iscnId, memo, - gas = new BigNumber(ISCN_GAS_FEE).multipliedBy(ISCN_GAS_MULTIPLIER).toFixed(0), + gas = new BigNumber(ISCN_GAS_FEE).multipliedBy(UPDATE_ISCN_GAS_MULTIPLIER).toFixed(0), }: { iscnId?: string, memo?: string, gas?: string } = {}, ) { const isUpdate = !!iscnId From e27c11eb3777540bdeb3ca0411afd71ef6c7b1ca Mon Sep 17 00:00:00 2001 From: AuroraHuang22 Date: Wed, 31 Jan 2024 13:59:21 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=A9=B9=20Set=20new=20gas=20when=20cal?= =?UTF-8?q?ling=20signISCN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/edit/_iscnId.vue | 4 +++- utils/cosmos/iscn/sign.ts | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pages/edit/_iscnId.vue b/pages/edit/_iscnId.vue index 1451d891..3988e367 100644 --- a/pages/edit/_iscnId.vue +++ b/pages/edit/_iscnId.vue @@ -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' @@ -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( diff --git a/utils/cosmos/iscn/sign.ts b/utils/cosmos/iscn/sign.ts index 725476cf..feee7f9a 100644 --- a/utils/cosmos/iscn/sign.ts +++ b/utils/cosmos/iscn/sign.ts @@ -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'; @@ -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