Skip to content

Commit

Permalink
qa: Prettify feature_fedpeg test
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenroose committed Sep 25, 2018
1 parent fc106df commit e380a7f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions qa/rpc-tests/feature_fedpeg.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ def run_test(self):
sidechain.generate(101)

addrs = sidechain.getpeginaddress()
addr = parent.validateaddress(addrs["mainchain_address"])
addr = addrs["mainchain_address"]
print('addrs', addrs)
print('addr', addr)
txid1 = parent.sendtoaddress(addrs["mainchain_address"], 24)
print(parent.validateaddress(addr))
txid1 = parent.sendtoaddress(addr, 24)
# 10+2 confirms required to get into mempool and confirm
parent.generate(1)
time.sleep(2)
Expand All @@ -183,14 +183,15 @@ def run_test(self):
pegtxid = sidechain.claimpegin(raw, proof)
raise Exception("Peg-in should not be mature enough yet, need another block.")
except JSONRPCException as e:
print('ERROR:', e.error)
assert("Peg-in Bitcoin transaction needs more confirmations to be sent." in e.error["message"])

# Should fail due to non-witness
try:
pegtxid = sidechain.claimpegin(raw, proof, get_new_unconfidential_address(sidechain))
raise Exception("Peg-in with non-matching claim_script should fail.")
except JSONRPCException as e:
print(e.error["message"])
print('ERROR:', e.error)
assert("Given or recovered script is not a witness program." in e.error["message"])

# # Should fail due to non-matching wallet address
Expand Down Expand Up @@ -309,7 +310,7 @@ def run_test(self):

print ("Now test failure to validate peg-ins based on intermittant bitcoind rpc failure")
stop_node(self.nodes[1], 1)
txid = parent.sendtoaddress(addrs["mainchain_address"], 1)
txid = parent.sendtoaddress(addr, 1)
parent.generate(12)
proof = parent.gettxoutproof([txid])
raw = parent.getrawtransaction(txid)
Expand Down

0 comments on commit e380a7f

Please sign in to comment.