mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-13 12:33:42 +02:00
Add pegin double spend test to functional test
This commit is contained in:
parent
7f6351782a
commit
99d8840046
1 changed files with 16 additions and 0 deletions
|
|
@ -203,6 +203,14 @@ class FedPegTest(BitcoinTestFramework):
|
|||
# Should succeed via wallet lookup for address match, and when given
|
||||
pegtxid1 = sidechain.claimpegin(raw, proof)
|
||||
|
||||
# Make sure a double spend of the pegin doesn't get accepted while another is in mempool.
|
||||
try:
|
||||
pegtxid1 = sidechain.claimpegin(raw, proof)
|
||||
raise Exception("double spending a pegin should not be accepted in mempool!")
|
||||
except JSONRPCException as e:
|
||||
print('RPC ERROR:', e.error['message'])
|
||||
assert("pegin-already-claimed" in e.error["message"])
|
||||
|
||||
# Will invalidate the block that confirms this transaction later
|
||||
self.sync_all()
|
||||
blockhash = sidechain2.generate(1)
|
||||
|
|
@ -240,6 +248,14 @@ class FedPegTest(BitcoinTestFramework):
|
|||
if sidechain.gettransaction(pegtxid1)["confirmations"] != 6:
|
||||
raise Exception("Peg-in should be back to 6 confirms.")
|
||||
|
||||
# Make sure a double spend of the pegin doesn't get accepted while another is confirmed.
|
||||
try:
|
||||
pegtxid1 = sidechain.claimpegin(raw, proof)
|
||||
raise Exception("double spending a pegin should not be accepted in mempool!")
|
||||
except JSONRPCException as e:
|
||||
print('RPC ERROR:', e.error['message'])
|
||||
assert("pegin-already-claimed" in e.error["message"])
|
||||
|
||||
# Do multiple claims in mempool
|
||||
n_claims = 6
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue