Skip to content

Commit

Permalink
Add test that walletprocesspsbt requires unlocked wallet when signing
Browse files Browse the repository at this point in the history
  • Loading branch information
meshcollider committed Sep 28, 2021
1 parent 0e89521 commit 0f3acec
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/functional/rpc_psbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,16 @@ def run_test(self):
psbtx = self.nodes[1].walletprocesspsbt(psbtx1)['psbt']
assert_equal(psbtx1, psbtx)

# Node 0 should not be able to sign the transaction with the wallet is locked
self.nodes[0].encryptwallet("password")
assert_raises_rpc_error(-13, "Please enter the wallet passphrase with walletpassphrase first", self.nodes[0].walletprocesspsbt, psbtx)

# Node 0 should be able to process without signing though
unsigned_tx = self.nodes[0].walletprocesspsbt(psbtx, False)
assert_equal(unsigned_tx['complete'], False)

self.nodes[0].walletpassphrase(passphrase="password", timeout=1000000)

# Sign the transaction and send
signed_tx = self.nodes[0].walletprocesspsbt(psbtx)['psbt']
final_tx = self.nodes[0].finalizepsbt(signed_tx)['hex']
Expand Down

0 comments on commit 0f3acec

Please sign in to comment.