test abandoning claim at a loss, required a fix in torba

This commit is contained in:
Lex Berezhny 2018-11-06 19:16:55 -05:00
parent 340c5addab
commit 83c0baa3cb

View file

@ -606,10 +606,40 @@ class PublishCommand(CommandTestCase):
))
class SupportingSupports(CommandTestCase):
class AbandonCommand(CommandTestCase):
VERBOSITY = logging.INFO
async def test_abandoning_claim_at_loss(self):
self.assertEqual('10.0', await self.daemon.jsonrpc_account_balance())
# create the initial name claim
with tempfile.NamedTemporaryFile() as file:
file.write(b'hi!')
file.flush()
claim = await self.out(self.daemon.jsonrpc_publish(
'hovercraft', '0.0001', file_path=file.name
))
self.assertTrue(claim['success'])
await self.on_transaction_dict(claim['tx'])
await self.generate(1)
self.assertEqual('9.979793', await self.daemon.jsonrpc_account_balance())
abandon = await self.out(self.daemon.jsonrpc_claim_abandon(claim['claim_id']))
await self.on_transaction_dict(abandon['tx'])
await self.generate(1)
self.assertEqual('9.97968399', await self.daemon.jsonrpc_account_balance())
class SupportingSupports(CommandTestCase):
VERBOSITY = logging.WARN
async def test_regular_supports_and_tip_supports(self):
# account2 will be used to send tips and supports to account1
account2_id = (await self.daemon.jsonrpc_account_create('second account'))['id']