diff --git a/tests/integration/blockchain/test_resolve_command.py b/tests/integration/blockchain/test_resolve_command.py index ccc1ac060..f688f8cf3 100644 --- a/tests/integration/blockchain/test_resolve_command.py +++ b/tests/integration/blockchain/test_resolve_command.py @@ -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