Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_fundrawtransaction.py
Show First 20 Lines • Show All 482 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
# drain the keypool | # drain the keypool | ||||
self.nodes[1].getnewaddress() | self.nodes[1].getnewaddress() | ||||
self.nodes[1].getrawchangeaddress() | self.nodes[1].getrawchangeaddress() | ||||
inputs = [] | inputs = [] | ||||
outputs = {self.nodes[0].getnewaddress(): 1.1} | outputs = {self.nodes[0].getnewaddress(): 1.1} | ||||
rawTx = self.nodes[1].createrawtransaction(inputs, outputs) | rawTx = self.nodes[1].createrawtransaction(inputs, outputs) | ||||
# fund a transaction that requires a new key for the change output | # fund a transaction that requires a new key for the change output | ||||
# creating the key must be impossible because the wallet is locked | # creating the key must be impossible because the wallet is locked | ||||
assert_raises_rpc_error( | assert_raises_rpc_error(-4, "Keypool ran out, please call keypoolrefill first", | ||||
-4, "Insufficient funds", self.nodes[1].fundrawtransaction, rawtx) | self.nodes[1].fundrawtransaction, rawTx) | ||||
# refill the keypool | # refill the keypool | ||||
self.nodes[1].walletpassphrase("test", 100) | self.nodes[1].walletpassphrase("test", 100) | ||||
# need to refill the keypool to get an internal change address | # need to refill the keypool to get an internal change address | ||||
self.nodes[1].keypoolrefill(8) | self.nodes[1].keypoolrefill(8) | ||||
self.nodes[1].walletlock() | self.nodes[1].walletlock() | ||||
assert_raises_rpc_error(-13, "walletpassphrase", self.nodes[ | assert_raises_rpc_error(-13, "walletpassphrase", self.nodes[ | ||||
▲ Show 20 Lines • Show All 282 Lines • Show Last 20 Lines |