assert_raises_rpc_error(-5,"'not a pubkey' is not hex",wallet.fundrawtransaction,raw_tx,{"solving_data":{"pubkeys":["not a pubkey"]}})
assert_raises_rpc_error(-5,"'01234567890a0b0c0d0e0f' is not a valid public key",wallet.fundrawtransaction,raw_tx,{"solving_data":{"pubkeys":["01234567890a0b0c0d0e0f"]}})
assert_raises_rpc_error(-5,"'not a script' is not hex",wallet.fundrawtransaction,raw_tx,{"solving_data":{"scripts":["not a script"]}})
assert_raises_rpc_error(-8,"Unable to parse descriptor 'not a descriptor'",wallet.fundrawtransaction,raw_tx,{"solving_data":{"descriptors":["not a descriptor"]}})
# But funding should work when the solving data is provided
@ -16,6 +18,7 @@ from test_framework.util import (
assert_raises_rpc_error,
find_output,
)
fromtest_framework.wallet_utilimportbytes_to_wif
importjson
importos
@ -608,5 +611,42 @@ class PSBTTest(BitcoinTestFramework):
assert_raises_rpc_error(-25,'Inputs missing or spent',self.nodes[0].walletprocesspsbt,'cHNidP8BAJoCAAAAAkvEW8NnDtdNtDpsmze+Ht2LH35IJcKv00jKAlUs21RrAwAAAAD/////S8Rbw2cO1020OmybN74e3Ysffkglwq/TSMoCVSzbVGsBAAAAAP7///8CwLYClQAAAAAWABSNJKzjaUb3uOxixsvh1GGE3fW7zQD5ApUAAAAAFgAUKNw0x8HRctAgmvoevm4u1SbN7XIAAAAAAAEAnQIAAAACczMa321tVHuN4GKWKRncycI22aX3uXgwSFUKM2orjRsBAAAAAP7///9zMxrfbW1Ue43gYpYpGdzJwjbZpfe5eDBIVQozaiuNGwAAAAAA/v///wIA+QKVAAAAABl2qRT9zXUVA8Ls5iVqynLHe5/vSe1XyYisQM0ClQAAAAAWABRmWQUcjSjghQ8/uH4Bn/zkakwLtAAAAAAAAQEfQM0ClQAAAAAWABRmWQUcjSjghQ8/uH4Bn/zkakwLtAAAAA==')
# Test that we can fund psbts with external inputs specified
eckey=ECKey()
eckey.generate()
privkey=bytes_to_wif(eckey.get_bytes())
# Make a weird but signable script. sh(pkh()) descriptor accomplishes this