From c734aaa15d924470cec0f17b00ad2e47472b471f Mon Sep 17 00:00:00 2001 From: Glenn Willen Date: Tue, 29 Jan 2019 21:32:38 -0800 Subject: Split DecodePSBT into Base64 and Raw versions Split up DecodePSBT, which both decodes base64 and then deserializes a PartiallySignedTransaction, into two functions: DecodeBase64PSBT, which retains the old behavior, and DecodeRawPSBT, which only performs the deserialization. Add a test for base64 decoding failure. --- test/functional/rpc_psbt.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test/functional/rpc_psbt.py') diff --git a/test/functional/rpc_psbt.py b/test/functional/rpc_psbt.py index a82a5d0208..c98f105828 100755 --- a/test/functional/rpc_psbt.py +++ b/test/functional/rpc_psbt.py @@ -293,5 +293,8 @@ class PSBTTest(BitcoinTestFramework): psbt = self.nodes[1].walletcreatefundedpsbt([], [{p2pkh : 1}], 0, {"includeWatching" : True}, True) self.nodes[0].decodepsbt(psbt['psbt']) + # Test decoding error: invalid base64 + assert_raises_rpc_error(-22, "TX decode failed invalid base64", self.nodes[0].decodepsbt, ";definitely not base64;") + if __name__ == '__main__': PSBTTest().main() -- cgit v1.2.3