diff --git a/.changelog/2000.trivial.md b/.changelog/2000.trivial.md new file mode 100644 index 0000000000..61112dfa9d --- /dev/null +++ b/.changelog/2000.trivial.md @@ -0,0 +1 @@ +Rename runtime transaction wrapper variable diff --git a/src/app/lib/transaction.ts b/src/app/lib/transaction.ts index ff8342814b..7f2effab57 100644 --- a/src/app/lib/transaction.ts +++ b/src/app/lib/transaction.ts @@ -132,11 +132,10 @@ export class OasisTransaction { ): Promise> { const { amount, recipient: targetAddress, type } = transaction const isDepositing = type === TransactionTypes.Deposit - const consensusRuntimeId = oasis.misc.fromHex(runtime.id) - const txWrapper = new oasisRT.consensusAccounts.Wrapper(consensusRuntimeId)[ - isDepositing ? 'callDeposit' : 'callWithdraw' - ]() - const accountsWrapper = new oasisRT.accounts.Wrapper(consensusRuntimeId) + const rtw = isDepositing + ? new oasisRT.consensusAccounts.Wrapper(oasis.misc.fromHex(runtime.id)).callDeposit() + : new oasisRT.consensusAccounts.Wrapper(oasis.misc.fromHex(runtime.id)).callWithdraw() + const accountsWrapper = new oasisRT.accounts.Wrapper(oasis.misc.fromHex(runtime.id)) const nonce = await accountsWrapper .queryNonce() .setArgs({ address: oasis.staking.addressFromBech32(fromAddress) }) @@ -152,7 +151,7 @@ export class OasisTransaction { nonce, } - txWrapper + rtw .setBody({ amount: [ oasis.quantity.fromBigInt(BigInt(parseRoseStringToBigNumber(amount, runtime.decimals).toFixed(0))), @@ -167,7 +166,7 @@ export class OasisTransaction { .setFeeConsensusMessages(1) .setSignerInfo([signerInfo]) - return txWrapper + return rtw } public static async signUsingLedger(