-
Notifications
You must be signed in to change notification settings - Fork 26
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
Tx json #23
Conversation
Codecov Report
@@ Coverage Diff @@
## v2 #23 +/- ##
==========================================
- Coverage 76.98% 75.37% -1.61%
==========================================
Files 18 18
Lines 808 922 +114
==========================================
+ Hits 622 695 +73
- Misses 119 149 +30
- Partials 67 78 +11
Continue to review full report at Codecov.
|
…unmarshallers for input and output so we can unmarshall correctly in the event of the txJSON not having a hex field. We will check this field first however and attempt to map it with hex before falling back to to further unmarshalling process
no need to check in the vendor mondules @theflyingcodr |
@@ -24,6 +25,79 @@ Txout-script / scriptPubKey Script <out-s | |||
type Output struct { | |||
Satoshis uint64 | |||
LockingScript *bscript.Script | |||
index int |
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.
@theflyingcodr yo i just realised this, don't think this should be in here... do you?
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.
I think I was using this to track the vout, I'll need to double the code again as it's been a while!
Transactions can now be properly serialised and deserialised as JSON.
This is achieved by implementing a custom marshaler and unmarshaler which will produce JSON as shown:
It also adds some new convenience methods to script to get the current type of script as a string and to return all addresses contained within a script (multisig support still TODO).
In the opcodes I updated all raw bytes to use the correct opcode constants to make it easier to read.