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

Provide a method to peek at a serialized transaction to determine whether it's an elements transaction or not #140

Open
cdecker opened this issue Sep 25, 2019 · 1 comment

Comments

@cdecker
Copy link
Member

cdecker commented Sep 25, 2019

The code internally already has methods that detect serialization formats, but it is not exposed anywhere. It'd be nice to be able to peek at a serialized transaction and determine its serialization type.

Currently the only alternative is to know ahead of time, or first try one method, and if that fails try the other, which is a bit cumbersome.

For an example of this see this commit: we have to pass in is_elements in the wire message before parsing the transaction included in the same message so we can set that global variable and parse correctly.

@glslang
Copy link
Contributor

glslang commented Sep 25, 2019

This would be my preferred option as opposed to #139. if we were to do this then we could simply remove the ELEMENTS flag altogether since tx_from_hex/bytes is the only place where is/should be needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants