[wallet] Ensure wallet is unlocked before signing

Github-Pull: #14310
Rebased-From: db15805668
This commit is contained in:
gustavonalle 2018-09-24 16:10:23 +01:00 committed by Anthony Fieroni
parent c33bab30d2
commit 7871dd58fe

View file

@ -58,6 +58,14 @@ class SignRawTransactionsTest(BitcoinTestFramework):
assert_raises_rpc_error(-13, "Please enter the wallet passphrase with walletpassphrase first", self.nodes[0].signrawtransactionwithwallet, rawTx)
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.