Skip to content

Fly 1130/pegout validation extension#372

Merged
Luisfc68 merged 5 commits into
lbc-splitfrom
FLY-1130/pegout-validation-extension
Dec 11, 2025
Merged

Fly 1130/pegout validation extension#372
Luisfc68 merged 5 commits into
lbc-splitfrom
FLY-1130/pegout-validation-extension

Conversation

@Hakob23

@Hakob23 Hakob23 commented Nov 12, 2025

Copy link
Copy Markdown
Collaborator

What

The task

Why

The idea of this task is to add a new function to the PegOutContract which receives the transaction that is going to be used to call refundPegOut and validate if its ok

…ation, enhancing the PegOutContract. This function allows liquidity providers to verify Bitcoin transactions without requiring confirmations. Refactor existing validation logic into a private method for reuse. Add comprehensive tests to ensure correct behavior and error handling for various scenarios.
@github-actions

github-actions Bot commented Nov 12, 2025

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

OpenSSF Scorecard

PackageVersionScoreDetails

Scanned Files

Comment thread test/pegout/LpRefund.t.sol Outdated
// Test that a malformed Bitcoin transaction (too short) reverts
// Using a minimal invalid tx hex"010203" instead of properly formed tx
vm.prank(pegOutLp);
vm.expectRevert(); // MalformedTransaction

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

you're not asserting the error type

bytes memory btcTx = generateBtcTx(wrongAddressQuote, quoteHash);

vm.prank(pegOutLp);
vm.expectRevert(); // InvalidDestination

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

you're not asserting the error type

assertEq(returnedQuote.lbcAddress, quote.lbcAddress);
}

function test_ValidatePegout_DoesNotRequireConfirmations() public {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

isn't this test the same as the one above?

Comment thread test/pegout/LpRefund.t.sol
Comment thread test/pegout/LpRefund.t.sol
@Hakob23 Hakob23 requested a review from Luisfc68 November 29, 2025 14:05
@Luisfc68 Luisfc68 merged commit 8d09025 into lbc-split Dec 11, 2025
5 of 6 checks passed
@Luisfc68 Luisfc68 deleted the FLY-1130/pegout-validation-extension branch December 11, 2025 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants