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

rpc: have raw transaction decoding infer output descriptors #16795

Open
wants to merge 1 commit into
base: master
from

Conversation

@instagibbs
Copy link
Member

instagibbs commented Sep 3, 2019

Following discussion in #16725 this is complementary data to expose. All outputs are inferred.

@DrahtBot DrahtBot added the Tests label Sep 3, 2019
@DrahtBot

This comment has been minimized.

Copy link
Contributor

DrahtBot commented Sep 3, 2019

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

No conflicts as of last run.

@NicolasDorier

This comment has been minimized.

Copy link
Member

NicolasDorier commented Sep 4, 2019

that's cool utACK

@instagibbs

This comment has been minimized.

Copy link
Member Author

instagibbs commented Sep 4, 2019

forgot to add description in RPC help, added.

@instagibbs instagibbs force-pushed the instagibbs:decode_descriptor branch from 1863168 to 8cd521e Sep 4, 2019
@fanquake fanquake added RPC/REST/ZMQ and removed Tests labels Sep 6, 2019
@fanquake fanquake changed the title have raw transaction decoding infer output descriptors rpc: have raw transaction decoding infer output descriptors Sep 6, 2019
@instagibbs instagibbs force-pushed the instagibbs:decode_descriptor branch from 8cd521e to c772728 Sep 9, 2019
@meshcollider

This comment has been minimized.

Copy link
Member

meshcollider commented Sep 9, 2019

utACK c772728

@DrahtBot

This comment has been minimized.

Copy link
Contributor

DrahtBot commented Sep 10, 2019

Needs rebase
@instagibbs instagibbs force-pushed the instagibbs:decode_descriptor branch from c772728 to 7fcf811 Sep 10, 2019
@instagibbs

This comment has been minimized.

Copy link
Member Author

instagibbs commented Sep 10, 2019

rebased

@fanquake fanquake removed the Needs rebase label Sep 10, 2019
@meshcollider

This comment has been minimized.

Copy link
Member

meshcollider commented Sep 10, 2019

You need to update the help-text for the RPCs affected by this change (decoderawtransaction, decodescript, getrawtransaction) to include the additional field

@laanwj

This comment has been minimized.

Copy link
Member

laanwj commented Sep 10, 2019

Travis found a real problem here (for a change !!! 🎉 )

/usr/bin/python3.6 ../test/util/bitcoin-util-test.py

2019-09-10 01:34:27,547 - ERROR - Output data mismatch for txcreateoutpubkey1.json (format json)

2019-09-10 01:34:27,548 - ERROR - Output formatting mismatch for txcreateoutpubkey1.json:

*** txcreateoutpubkey1.json

--- returned

***************

*** 15,22 ****

              "scriptPubKey": {

                  "asm": "02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397 OP_CHECKSIG",

                  "hex": "2102a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397ac",

!                 "type": "pubkey",

!                 "desc": "pk(02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397)#rk5v7uqw"

              }

          }

      ],

--- 15,21 ----

              "scriptPubKey": {

                  "asm": "02a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397 OP_CHECKSIG",

                  "hex": "2102a5613bd857b7048924264d1e70e08fb2a7e6527d32b7ab1bb993ac59964ff397ac",

!                 "type": "pubkey"

              }

          }

      ],

2019-09-10 01:34:30,728 - ERROR - FAILED_TESTCASES:

['Creates a new transaction with a single pay-to-pubkey output (output as json)']
@instagibbs instagibbs force-pushed the instagibbs:decode_descriptor branch 2 times, most recently from 326f322 to 9018d63 Sep 10, 2019
@instagibbs

This comment has been minimized.

Copy link
Member Author

instagibbs commented Sep 10, 2019

fixed rebase error, now all outputs are inferred. added description to decodescript

src/core_write.cpp Outdated Show resolved Hide resolved
src/core_write.cpp Outdated Show resolved Hide resolved
src/core_write.cpp Outdated Show resolved Hide resolved
@instagibbs instagibbs force-pushed the instagibbs:decode_descriptor branch from 9018d63 to 9b94596 Sep 16, 2019
luke-jr added a commit to bitcoinknots/bitcoin that referenced this pull request Sep 21, 2019
Copy link
Contributor

ariard left a comment

ACK 9b94596 minus gettouxt/rest_getuxtos doc fixs

Tested getrawtransaction, decoderawtransaction, decodescript, work as expected.

@@ -157,6 +158,8 @@ void ScriptPubKeyToUniv(const CScript& scriptPubKey,
int nRequired;

out.pushKV("asm", ScriptToAsmStr(scriptPubKey));
out.pushKV("desc", InferDescriptor(scriptPubKey, DUMMY_SIGNING_PROVIDER)->ToString());

This comment has been minimized.

Copy link
@ariard

ariard Nov 4, 2019

Contributor

Need to update help-debug of gettxout and also maybe REST-interface.md on rest_getutxos.

Do you want also to extend feature to decodepsbt ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
8 participants
You can’t perform that action at this time.