Skip to content

Commit

Permalink
fix(sdk-coin-sol): fix solana verifyTransaction method
Browse files Browse the repository at this point in the history
Fixed solana verifyTransaction method to only validate the durableNonce if its an input of during
the method call

WP-209
  • Loading branch information
alebusse committed Jul 10, 2023
1 parent af40c49 commit 87d3144
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/sdk-coin-sol/src/sol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export class Sol extends BaseCoin {
throw new Error('Tx fee payer is not the wallet root address');
}

if (!_.isEqual(explainedTx.durableNonce, durableNonce)) {
if (durableNonce && !_.isEqual(explainedTx.durableNonce, durableNonce)) {
throw new Error('Tx durableNonce does not match with param durableNonce');
}

Expand Down
2 changes: 1 addition & 1 deletion modules/sdk-coin-sol/test/unit/sol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ describe('SOL:', function () {
const txParams = newTxParams();
const txPrebuild = newTxPrebuild();
await basecoin
.verifyTransaction({ txParams, txPrebuild, memo, errorDurableNonce, wallet: walletObj } as any)
.verifyTransaction({ txParams, txPrebuild, memo, durableNonce: errorDurableNonce, wallet: walletObj } as any)
.should.be.rejectedWith('Tx durableNonce does not match with param durableNonce');
});

Expand Down

0 comments on commit 87d3144

Please sign in to comment.