Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TAS-559] ✨ Enable update ISCN #429

Merged
merged 14 commits into from
Dec 29, 2023
Merged
1 change: 0 additions & 1 deletion constant/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ 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_FEE = 300000;

export const ISCN_REGISTRY_NAME = 'likecoin-chain';

Expand Down
28 changes: 1 addition & 27 deletions utils/cosmos/iscn/sign.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export async function signISCN(
? signingClient.updateISCNRecord(address, iscnId as string, tx, {
memo: memo || 'app.like.co',
fee: {
gas,
gas: new BigNumber(gas).multipliedBy(ISCN_GAS_MULTIPLIER).toFixed(0),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just increase the default ISCN_GAS_FEE by ISCN_GAS_MULTIPLIER? gas as a input is expected to be override, ISCN_GAS_MULTIPLIER should be applied to the input not inside this function

amount: [{
denom: DEFAULT_GAS_PRICE[0].denom,
amount: new BigNumber(gas).multipliedBy(DEFAULT_GAS_PRICE[0].amount).toFixed(0),
Expand All @@ -190,29 +190,3 @@ export async function signISCN(
return res as DeliverTxResponse
}

export async function updateISCNRecord(
signer: OfflineSigner,
address: string,
iscnId: string,
payload: ISCNSignPayload,
) {
const signingClient = await getSigningClient()
await signingClient.connectWithSigner(network.rpcURL, signer)
const signingPromise = signingClient.updateISCNRecord(
address,
iscnId,
payload,
{
fee: {
gas: (new BigNumber(ISCN_GAS_FEE).times(ISCN_GAS_MULTIPLIER).toFixed(0)).toString(),
amount: [{
denom: DEFAULT_GAS_PRICE[0].denom,
amount: DEFAULT_GAS_PRICE[0].amount.toString(),
}],
},
},
)

const res = await signingPromise
return res as DeliverTxResponse
}
Loading