-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Handling Invalid Output Scripts. Closes #1230 #1231
Conversation
fa7f313
to
a23b364
Compare
var output = new Output({ | ||
satoshis: 1000, | ||
script: 'bad' | ||
}); | ||
}).should.throw('Invalid hex string'); |
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.
Would it be better to throw a more specific error? (i.e: errors.Transaction.Output.InvalidScript
)?
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.
This is an error from Buffer that will take the else path, so we can handle an InvalidScript
but not other types of errors.
9e19411
to
cb9996f
Compare
- Changed toObject serialization to always use a hexa string for a script - Updated inspect method to handle a null script - Roundtrip toObject/fromObject with an invalid script - Additional test coverage for Output
cb9996f
to
458abe0
Compare
Looks good to me |
Handling Invalid Output Scripts. Closes #1230
toObject
serialization to always use a hexa string for a scripttoObject
with an invalid script