Page MenuHomePhabricator

Create utility RPCs for PSBT
ClosedPublic

Authored by deadalnix on Nov 2 2019, 01:40.

Details

Summary

decodepsbt takes a PSBT and decodes it to JSON

combinepsbt takes multiple PSBTs for the same tx and combines them.

finalizepsbt takes a PSBT and finalizes the inputs. If all inputs
are final, it extracts the network serialized transaction and returns
that instead of a PSBT unless instructed otherwise.

createpsbt is like createrawtransaction but for PSBTs instead of
raw transactions.

convertpsbt takes a network serialized transaction and converts it
into a psbt. The resulting psbt will lose all signature data and
an explicit flag must be set to allow transactions with signature
data to be converted.

This is a partial backport of Core PR13557 : https://github.com/bitcoin/bitcoin/pull/13557/commits/c27fe419efb3b6588c400d764122ffb33375e028

Test Plan

Unfortunately, the test have all been dumped at once at the end.

Diff Detail

Repository
rABC Bitcoin ABC
Branch
utilityrpcpsbt
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 8014
Build 14026: Bitcoin ABC Buildbot (legacy)
Build 14025: arc lint + arc unit

Event Timeline

Fabien requested changes to this revision.Nov 4 2019, 12:32
Fabien added a subscriber: Fabien.

This deserves release notes.

src/rpc/rawtransaction.cpp
1525 ↗(On Diff #13868)

Should be in an else statement.

This revision now requires changes to proceed.Nov 4 2019, 12:32
src/rpc/rawtransaction.cpp
1525 ↗(On Diff #13868)

I'm glad there are no tests for that shit...

Good catch.

The release notes discussion from D4357 applies here as well.
For reference, these changes are documented for core in the 0.17.0 release notes.

I'll green this diff because the code looks good, and this is a large PR so the release notes can (should ?) be added at the end of the backport, together with the BIP174 addition to the bips.md file.

This revision is now accepted and ready to land.Nov 6 2019, 07:43
This revision was automatically updated to reflect the committed changes.