aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGlenn Willen <gwillen@nerdnet.org>2019-01-29 21:32:38 -0800
committerGlenn Willen <gwillen@nerdnet.org>2019-02-11 12:23:14 -0800
commitc734aaa15d924470cec0f17b00ad2e47472b471f (patch)
tree57a374ce9179e44ba453c2d48014b5375268f965 /test
parent162ffefd2f562169725559906601c25c579aa91c (diff)
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.
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/rpc_psbt.py3
1 files changed, 3 insertions, 0 deletions
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()