Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sBTC] Add stx_address method to PegOutRequestOp #3649

Merged
merged 4 commits into from
Apr 13, 2023

Conversation

netrome
Copy link
Contributor

@netrome netrome commented Apr 6, 2023

This PR adds a PegOutRequestOp::stx_address() method to derive the stacks address of an sBTC holder requesting to peg out.

Closes #3647

@netrome netrome linked an issue Apr 6, 2023 that may be closed by this pull request
@netrome netrome changed the base branch from master to next April 6, 2023 17:51
@netrome netrome requested review from kantai and jferrant April 6, 2023 17:53
@igorsyl
Copy link
Contributor

igorsyl commented Apr 8, 2023

@kantai I would be grateful for your attention to this PR given it's one of the last remaining pieces for a working sBTC Alpha.

Copy link
Member

@kantai kantai left a comment

Choose a reason for hiding this comment

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

This LGTM, but it needs two more kinds of tests:

  1. A test that uses a test vector (i.e., just a hex encoded bitcoin transaction) as input, with a hard coded expected stx_address.
  2. Test coverage for the two error cases

@netrome netrome self-assigned this Apr 11, 2023
@netrome netrome added the sbtc label Apr 11, 2023
@netrome
Copy link
Contributor Author

netrome commented Apr 12, 2023

This LGTM, but it needs two more kinds of tests:

1. A test that uses a test vector (i.e., just a hex encoded bitcoin transaction) as input, with a hard coded expected `stx_address`.

2. Test coverage for the two error cases

Thank you for the feedback. I have added a test case with the test vector and another one for one of the error cases. I discovered that the other error case was infallible, so I changed the method and return type to reflect that.

It would be great if you could have another look @kantai 🙏

@netrome netrome requested a review from kantai April 12, 2023 09:07
@codecov
Copy link

codecov bot commented Apr 12, 2023

Codecov Report

Merging #3649 (5620634) into next (5ce2b54) will increase coverage by 2.11%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             next    #3649      +/-   ##
==========================================
+ Coverage   29.36%   31.47%   +2.11%     
==========================================
  Files         309      309              
  Lines      278266   278468     +202     
==========================================
+ Hits        81702    87661    +5959     
+ Misses     196564   190807    -5757     
Impacted Files Coverage Δ
src/chainstate/burn/operations/peg_out_request.rs 13.21% <0.00%> (-9.21%) ⬇️

... and 91 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@netrome netrome force-pushed the 3647-sbtc-add-sender-field-to-pegoutrequestop branch from c5068ac to 5620634 Compare April 12, 2023 15:05
Copy link
Member

@kantai kantai left a comment

Choose a reason for hiding this comment

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

LGTM!

@netrome netrome marked this pull request as ready for review April 12, 2023 16:03
@igorsyl
Copy link
Contributor

igorsyl commented Apr 13, 2023

Thank you @kantai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Status: ✅ Done
Archived in project
Development

Successfully merging this pull request may close these issues.

[sBTC] Add stx_address() public method to PegOutRequestOp
4 participants