RPC: descriptorprocesspsbt returns hex encoded tx if complete #28492

pull ismaelsadeeq wants to merge 3 commits into bitcoin:master from ismaelsadeeq:09-2023-return-final-psbt changing 3 files +23 −9
  1. ismaelsadeeq commented at 4:10 pm on September 15, 2023: member

    Coming from #28414 comment Same thing also for descriptorprocesspsbt.

    Before this PR descriptorprocesspsbt returns a boolean complete which indicates that the psbt is final, users then have to call finalizepsbt to get the hex encoded network transaction.

    In this PR if the psbt is complete the return object also has the hex encoded network transaction ready for broadcast with sendrawtransaction.

    This save users calling finalizepsbt with the descriptor, if it is already complete.

  2. rpc: `descriptorprocesspsbt` return hex encoded tx
    If processed psbt is complete return hex encoded network
    transaction in the output.
    c405207a18
  3. test: check `descriptorprocesspsbt` return hex encoded tx
    Test that if the processed psbt is complete the hex encoded tx
    is returned and remove unneccessary rpc call to finalize the
    psbt.
    2b4edf889a
  4. doc: add release note a99e9e655a
  5. DrahtBot commented at 4:10 pm on September 15, 2023: contributor

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

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK pinheadmz, ishaanam, achow101

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  6. DrahtBot added the label RPC/REST/ZMQ on Sep 15, 2023
  7. in doc/release-notes-28414.md:5 in a99e9e655a
    0@@ -1,5 +1,6 @@
    1 RPC Wallet
    2 ----------
    3 
    4-- RPC `walletprocesspsbt` return object now includes field `hex` (if the transaction
    5-is complete) containing the serialized transaction suitable for RPC `sendrawtransaction`. (#28414)
    6+- RPC `walletprocesspsbt`, and `descriptorprocesspsbt` return object now includes field `hex` (if the transaction
    7+is complete) containing the serialized transaction suitable for RPC `sendrawtransaction`.
    


    ishaanam commented at 6:01 pm on September 15, 2023:

    nit:

    0- The `walletprocesspsbt` and `descriptorprocesspsbt` RPCs' return objects now include field `hex` (if the transaction
    1is complete) containing the serialized transaction suitable for RPC `sendrawtransaction`.
    

    ismaelsadeeq commented at 7:55 pm on September 22, 2023:
    Thanks, this basically means the same thing IMO, resolving this.
  8. in test/functional/rpc_psbt.py:989 in a99e9e655a
    988-        decoded = self.nodes[2].decodepsbt(psbt)
    989+        # If psbt not finalized, test that result does not have hex
    990+        assert "hex" not in processed_psbt
    991+
    992+        processed_psbt = self.nodes[2].descriptorprocesspsbt(psbt=psbt, descriptors=[descriptor], sighashtype="ALL", bip32derivs=False, finalize=True)
    993+        decoded = self.nodes[2].decodepsbt(processed_psbt['psbt'])
    


    pinheadmz commented at 7:37 pm on September 15, 2023:
    nit: might be cleaner to not re-use variable names processed_psbt and decoded but im not sure how strict we are about stuff like that in tests

    ismaelsadeeq commented at 8:03 pm on September 22, 2023:
    Thanks for your review! Will use distinct variable names in future contribution, but happy to update this if another reviewer ask for it.
  9. pinheadmz approved
  10. pinheadmz commented at 7:41 pm on September 15, 2023: member

    ACK a99e9e655a58b2364a74aec5cafb827a73c6b0c4

    reviewed code and tested locally :+1:

     0-----BEGIN PGP SIGNED MESSAGE-----
     1Hash: SHA256
     2
     3ACK a99e9e655a58b2364a74aec5cafb827a73c6b0c4
     4-----BEGIN PGP SIGNATURE-----
     5
     6iQIzBAEBCAAdFiEE5hdzzW4BBA4vG9eM5+KYS2KJyToFAmUEszgACgkQ5+KYS2KJ
     7yTqdKA//XiTF0aXFKBoFAxJLU1oPrMNTD5RpgP9mvSu0rHuKf8g1KvAqUv1doeUH
     8A2/RpbWPxHJyivbg7S3h3Dfzfrzbh5TRCO+47zSiIKzINtJ92VG1CXwe+Uu7O35v
     9Ez6eUBk6tYeZOo+udIbtKXhQFfE8MQ8IiJ/qjJj4UGw1ehvJZ9FiKF80JHGv7HK0
    10pRVrZqNsYpQ44DYuwAxUJQuiz0uX/hPulpheAxdk1kAoFaVmWXH+YEhXfuvqwIPc
    11FyTZE/BWaVYTQaT9S0bT0QXntq5L9x/jQI9fANrPZ10REpySHgD9uuJxfF1ZZ077
    12rlLgq7S9+kY8kTr+mfXSgBJdr/dHQRnY9yrFrwUbLOZx0DI6Y439k0V1ZXmbuLmb
    13xVQ78rNNomEUE3KznhiTXAmFiJEYKOnpEqOf8Dny/UQ4nuNUvEtzPJmm2f4hFkfC
    14xM6C9bjZp2oYFyE0dKpp2Pcw6TDroUW8kdt4R21hm4rwWZ2gz0/JHlimPQP1qtPf
    15PFy5gWSMM9P0z4F5xFZfqgaPDCxYEPQ5Zsu/WonS1oE8glIhVPLeE++vAtd0iqAZ
    16Ibs8qTFQDaZUlfkdyEVB+Bx+OykD67sFUd5f62579d08LeCaat1Hlddk0tuWbNXs
    17TcTop9JnD9ihmWGyU6oM8agHO8EqXmJDccfEWXxf52BkutECzhM=
    18=R4/T
    19-----END PGP SIGNATURE-----
    

    pinheadmz’s public key is on keybase

  11. ishaanam commented at 1:52 am on September 16, 2023: contributor
    ACK a99e9e655a58b2364a74aec5cafb827a73c6b0c4
  12. achow101 commented at 3:47 pm on September 23, 2023: member
    ACK a99e9e655a58b2364a74aec5cafb827a73c6b0c4
  13. achow101 merged this on Sep 23, 2023
  14. achow101 closed this on Sep 23, 2023

  15. Frank-GER referenced this in commit c264a74f0f on Sep 25, 2023
  16. sidhujag referenced this in commit 9ad3a0a5ad on Sep 26, 2023
  17. ismaelsadeeq deleted the branch on Jun 27, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-09-28 22:12 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me