hal icon indicating copy to clipboard operation
hal copied to clipboard

tx create doesn't parse the output of decoderawtransaction

Open psgreco opened this issue 3 years ago • 2 comments

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

psgreco avatar Oct 10 '22 23:10 psgreco

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.

stevenroose avatar Jun 07 '23 19:06 stevenroose

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

psgreco avatar Jun 07 '23 22:06 psgreco