Skip to content

Commit

Permalink
fix: htlc refund handler to use performGenericWalletChecks (+ fix e2e…
Browse files Browse the repository at this point in the history
… tests) (#2944)

* test: fix htlc e2e tests

* fix: htlc refund tx handler
use performGenericWalletChecks instead of super.throwIfCannotBeApplied
  • Loading branch information
air1one authored and spkjp committed Sep 19, 2019
1 parent 2334cd2 commit ec2002d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ module.exports = async options => {
secretHash: Crypto.HashAlgorithms.sha256(utils.htlcRecipient4.address.slice(0, 32)).toString("hex"),
expiration: {
type: 2,
value: lastHeight + 1,
value: lastHeight + 4,
},
},
utils.htlcRecipient4.address,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = async options => {
secretHash: Crypto.HashAlgorithms.sha256(utils.htlcRecipient1.address.slice(0, 32)).toString("hex"),
expiration: {
type: 2,
value: lastHeight + 1,
value: lastHeight + 4,
},
},
utils.htlcRecipient1.address,
Expand All @@ -42,7 +42,7 @@ module.exports = async options => {
secretHash: Crypto.HashAlgorithms.sha256(utils.htlcRecipient2.address.slice(0, 32)).toString("hex"),
expiration: {
type: 2,
value: lastHeight + 1,
value: lastHeight + 4,
},
},
utils.htlcRecipient2.address,
Expand Down
2 changes: 1 addition & 1 deletion packages/core-transactions/src/handlers/htlc-refund.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class HtlcRefundTransactionHandler extends TransactionHandler {
sender: State.IWallet,
databaseWalletManager: State.IWalletManager,
): Promise<void> {
await super.throwIfCannotBeApplied(transaction, sender, databaseWalletManager);
await this.performGenericWalletChecks(transaction, sender, databaseWalletManager);

// Specific HTLC refund checks
const refundAsset: Interfaces.IHtlcRefundAsset = transaction.data.asset.refund;
Expand Down

0 comments on commit ec2002d

Please sign in to comment.