lbry-sdk/tests/integration/test_wallet_server.py

26 lines
1.1 KiB
Python
Raw Normal View History

2019-03-31 00:40:01 +01:00
from lbrynet.testcase import CommandTestCase
class TestClaimtrie(CommandTestCase):
def get_claim_id(self, tx):
return tx['outputs'][0]['claim_id']
async def assertWinningClaim(self, name, tx):
2019-05-05 05:47:28 +02:00
other = (await self.resolve(name))[name]
2019-03-31 00:40:01 +01:00
self.assertEqual(self.get_claim_id(tx), other['claim_id'])
async def test_designed_edge_cases(self):
tx1 = await self.channel_create('@foo', allow_duplicate_name=True)
await self.assertWinningClaim('@foo', tx1)
tx2 = await self.channel_create('@foo', allow_duplicate_name=True)
await self.assertWinningClaim('@foo', tx1)
tx3 = await self.channel_create('@foo', allow_duplicate_name=True)
await self.assertWinningClaim('@foo', tx1)
await self.support_create(self.get_claim_id(tx3), '0.09')
await self.assertWinningClaim('@foo', tx3)
await self.support_create(self.get_claim_id(tx2), '0.19')
await self.assertWinningClaim('@foo', tx2)
await self.support_create(self.get_claim_id(tx1), '0.19')
await self.assertWinningClaim('@foo', tx1)