Skip to content

Commit

Permalink
Merge pull request #2000 from oasisprotocol/lw/rename-rtw
Browse files Browse the repository at this point in the history
Rename runtime transaction wrapper variable
  • Loading branch information
lukaw3d authored Jul 12, 2024
2 parents 233651f + c143f2a commit 8e78786
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions .changelog/2000.trivial.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Rename runtime transaction wrapper variable
13 changes: 6 additions & 7 deletions src/app/lib/transaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,10 @@ export class OasisTransaction {
): Promise<RTW<oasisRT.types.ConsensusDeposit | oasisRT.types.ConsensusWithdraw>> {
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) })
Expand All @@ -152,7 +151,7 @@ export class OasisTransaction {
nonce,
}

txWrapper
rtw
.setBody({
amount: [
oasis.quantity.fromBigInt(BigInt(parseRoseStringToBigNumber(amount, runtime.decimals).toFixed(0))),
Expand All @@ -167,7 +166,7 @@ export class OasisTransaction {
.setFeeConsensusMessages(1)
.setSignerInfo([signerInfo])

return txWrapper
return rtw
}

public static async signUsingLedger<T>(
Expand Down

0 comments on commit 8e78786

Please sign in to comment.