diff options
author | gustavonalle <gustavonalle@gmail.com> | 2018-09-24 16:10:23 +0100 |
---|---|---|
committer | gustavonalle <gustavonalle@gmail.com> | 2018-09-24 18:13:22 +0100 |
commit | db15805668e923c3493d77122d20926496cf6a1a (patch) | |
tree | 82429ad993cdedecbada746600e82caaf9cd7c99 /test/functional/rpc_signrawtransaction.py | |
parent | 985d28cc90eda7f637b47cda78e74099d3df8734 (diff) |
[wallet] Ensure wallet is unlocked before signing
Diffstat (limited to 'test/functional/rpc_signrawtransaction.py')
-rwxr-xr-x | test/functional/rpc_signrawtransaction.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/functional/rpc_signrawtransaction.py b/test/functional/rpc_signrawtransaction.py index 5c07f2ccae..98648dd436 100755 --- a/test/functional/rpc_signrawtransaction.py +++ b/test/functional/rpc_signrawtransaction.py @@ -45,6 +45,14 @@ class SignRawTransactionsTest(BitcoinTestFramework): # 2) No script verification error occurred assert 'errors' not in rawTxSigned + def test_with_lock_outputs(self): + """Test correct error reporting when trying to sign a locked output""" + self.nodes[0].encryptwallet("password") + self.restart_node(0) + rawTx = '020000000156b958f78e3f24e0b2f4e4db1255426b0902027cb37e3ddadb52e37c3557dddb0000000000ffffffff01c0a6b929010000001600149a2ee8c77140a053f36018ac8124a6ececc1668a00000000' + + assert_raises_rpc_error(-13, "Please enter the wallet passphrase with walletpassphrase first", self.nodes[0].signrawtransactionwithwallet, rawTx) + def script_verification_error_test(self): """Create and sign a raw transaction with valid (vin 0), invalid (vin 1) and one missing (vin 2) input script. @@ -138,6 +146,7 @@ class SignRawTransactionsTest(BitcoinTestFramework): def run_test(self): self.successful_signing_test() self.script_verification_error_test() + self.test_with_lock_outputs() if __name__ == '__main__': |