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

tx create doesn't parse the output of decoderawtransaction #30

Open
psgreco opened this issue Oct 10, 2022 · 2 comments
Open

tx create doesn't parse the output of decoderawtransaction #30

psgreco opened this issue Oct 10, 2022 · 2 comments

Comments

@psgreco
Copy link
Contributor

psgreco commented Oct 10, 2022

decoderawtransaction shows values in float, while hal expects this value to be u64 in sats.
Also, some fields change from camelCase to underscore_separated

scriptSig vs script_sig
scriptPubKey vs script_pub_key

@stevenroose
Copy link
Owner

Hmm, well, it's never been a design goal to match any specific other format. We could in theory try that with core. But I can't really see in what scenario you would want to pipe decoderawtransaction into tx create? Wouldn't you be recreating the same tx? Well you could mix up parts of the tx with external input I guess.

There are some options we could take here:

  • have name aliases on some fields so that it accepts Core (or just generally more) formats; but like you mention units might differ which is tricky.
  • have a Core->hal conversion command like bitcoin-cli decoderawtransaction <hex> | hal core convert tx | hal tx create or something. Could have hal core convert output etc. Not sure what the value of this would be, but I guess it'd be fairly easy to add.

@psgreco
Copy link
Contributor Author

psgreco commented Jun 7, 2023

I don't remember exactly what I was trying to do, but yeah, sounds like I wanted to do some weird piping

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