Page MenuHomePhabricator

Create utility RPCs for PSBT
ClosedPublic

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

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABC6e5278d36615: Create utility RPCs for PSBT
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
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

deadalnix created this revision.Sat, Nov 2, 01:40
Herald added a reviewer: Restricted Project. · View Herald TranscriptSat, Nov 2, 01:40
Fabien requested changes to this revision.Mon, Nov 4, 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.Mon, Nov 4, 12:32
deadalnix added inline comments.Tue, Nov 5, 23:55
src/rpc/rawtransaction.cpp
1525 ↗(On Diff #13868)

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

Good catch.

deadalnix updated this revision to Diff 13957.Wed, Nov 6, 00:00

Fix missing else

Fabien accepted this revision.Wed, Nov 6, 07:43

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.Wed, Nov 6, 07:43
This revision was automatically updated to reflect the committed changes.