test_early_takeover_abandoned_controlling_support

This commit is contained in:
Jack Robison 2021-05-25 18:42:39 -04:00
parent 3eb9d23108
commit 77cde411f1
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -455,6 +455,32 @@ class ResolveClaimTakeovers(BaseResolveTestCase):
await self.generate(1)
await self.assertMatchClaimIsWinning(name, third_claim_id)
async def test_early_takeover_abandoned_controlling_support(self):
name = 'derp'
# block 207
first_claim_id = (await self.stream_create(name, '0.1', allow_duplicate_name=True))['outputs'][0][
'claim_id']
tx = await self.daemon.jsonrpc_support_create(first_claim_id, '0.2')
await self.ledger.wait(tx)
await self.assertMatchClaimIsWinning(name, first_claim_id)
await self.generate(96)
# block 304, activates at 307
second_claim_id = (await self.stream_create(name, '0.2', allow_duplicate_name=True))['outputs'][0][
'claim_id']
# block 305, activates at 308 (but gets triggered early by the takeover by the second claim)
third_claim_id = (await self.stream_create(name, '0.3', allow_duplicate_name=True))['outputs'][0][
'claim_id']
self.assertNotEqual(first_claim_id, second_claim_id)
# takeover should not have happened yet
await self.assertMatchClaimIsWinning(name, first_claim_id)
await self.generate(1)
await self.assertMatchClaimIsWinning(name, first_claim_id)
await self.daemon.jsonrpc_txo_spend(type='support', txid=tx.id)
await self.generate(1)
await self.assertMatchClaimIsWinning(name, third_claim_id)
await self.generate(1)
await self.assertMatchClaimIsWinning(name, third_claim_id)
async def test_block_takeover_with_delay_1_support(self):
name = 'derp'
# initially claim the name