BP-WG / bp-std

Modern & lightweight implementation of bitcoin standards without rust-bitcoin/miniscript dependencies
Apache License 2.0
16 stars 16 forks source link

fix: p2sh address from script #37

Closed ghost closed 2 months ago

ghost commented 2 months ago

Reference: https://github.com/BP-WG/bp-core/blob/master/consensus/src/script.rs#L143-L148

the p2sh script length is 23, skip first 2 bytes, there remain 21 bytes, it will panic

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 36.8%. Comparing base (82a9b01) to head (ebb1209). Report is 2 commits behind head on master.

Files Patch % Lines
invoice/src/address.rs 0.0% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #37 +/- ## ====================================== Coverage 36.8% 36.8% ====================================== Files 24 24 Lines 4153 4153 ====================================== Hits 1528 1528 Misses 2625 2625 ``` | [Flag](https://app.codecov.io/gh/BP-WG/bp-std/pull/37/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BP-WG) | Coverage Δ | | |---|---|---| | [rust](https://app.codecov.io/gh/BP-WG/bp-std/pull/37/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BP-WG) | `36.8% <0.0%> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BP-WG#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.