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
DRY changes and adding support for BIP-239 Extended Transaction Format #130
Conversation
… support (extended transaction format)
Codecov ReportBase: 83.86% // Head: 83.70% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #130 +/- ##
==========================================
- Coverage 83.86% 83.70% -0.17%
==========================================
Files 34 34
Lines 3670 3701 +31
==========================================
+ Hits 3078 3098 +20
- Misses 426 434 +8
- Partials 166 169 +3
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Thanks for this Simon, will get at a look it. A quick Google has failed me though, where can I find info on BIP-239 |
Hi Mark
You're a bit too quick!
We haven't finished writing the BIP yet because we wanted to include references to go-bt and another JavaScript library along with code examples. The go-bt work is done (as you know) and the JS was finished 1 hour ago. Now, we need to complete the BIP.
Regards
Simon
On 11 Nov 2022, at 17:00, Mark Smith ***@***.***> wrote:
Thanks for this Simon, will get at a look it. A quick Google has failed me though, where can I find info on BIP-239
—
Reply to this email directly, view it on GitHub<#130 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAAROAVESXQPS6YZLGJUDRTWHZ3TDANCNFSM6AAAAAAR4XVKOE>.
You are receiving this because you were assigned.Message ID: ***@***.***>
|
I see, that explains why I can't find it, hard to review the PR in that case :) One thing, is it likely that will be other Tx formats / extensions such as this, if so we should probably think of a nice way of handling those additions other than adding additional boolean flags to the various methods like this https://github.com/libsv/go-bt/pull/130/files#diff-8ef97170810c3ede0de2d34df9b1656ec156498c289d7ab2dea5ed8c28e92acdR51 as they will just grow and grow. Perhaps an option and a handler func like map[string]TXExtensionFunc that will get executed depending on tx settings? |
Also thanks for picking up those linter failures, do you think this will be WiP for a bit, I could fix these linter failures in another PR in the mean time to unblock another 2 PRs that are failing because of them. (we run the linter github action which always uses latest linter so it will no doubt pick up stuff the old runs didn't) |
@@ -233,13 +233,32 @@ func (s *Script) ToASM() (string, error) { | |||
parts, err := DecodeParts(*s) | |||
// if err != nil, we will append [error] to the ASM script below (as done in the node). | |||
|
|||
data := false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data := false | |
data := len(*s) > 1 && ((*s)[0] == OpRETURN || ((*s)[0] == OpFALSE && (*s)[1] == OpRETURN)) |
All TX parsing functions now delegate to the tx.ReadFrom() function. All duplicate code has been removed.
Added support for parsing raw transactions that are using the BIP-239 Extended Transaction Format.