minor fixes from rebase

This commit is contained in:
Victor Shyba 2019-11-03 20:57:39 -03:00 committed by Lex Berezhny
parent 77daf6812a
commit 56af4c2fcb
2 changed files with 6 additions and 10 deletions

View file

@ -204,15 +204,11 @@ class CommandTestCase(IntegrationTestCase):
""" Synchronous version of `out` method. """
return json.loads(jsonrpc_dumps_pretty(value, ledger=self.ledger))['result']
async def stream_repost(self, claim_id, name='repost', bid='1.0', **kwargs):
tx = await self.out(
self.daemon.jsonrpc_stream_repost(claim_id=claim_id, name=name, bid=bid, **kwargs)
def stream_repost(self, claim_id, name='repost', bid='1.0', confirm=True, **kwargs):
return self.confirm_and_render(
self.daemon.jsonrpc_stream_repost(claim_id=claim_id, name=name, bid=bid, **kwargs),
confirm
)
if kwargs.get('confirm', True):
await self.on_transaction_dict(tx)
await self.generate(1)
await self.on_transaction_dict(tx)
return tx
async def confirm_and_render(self, awaitable, confirm) -> Transaction:
tx = await awaitable

View file

@ -719,12 +719,12 @@ class StreamCommands(ClaimTestCase):
tx = await self.out(self.stream_create('newstuff', '1.1', channel_name='@goodies'))
claim_id = tx['outputs'][0]['claim_id']
await self.stream_repost(claim_id, 'newstuff-again', '1.1')
claim_list = await self.out(self.daemon.jsonrpc_claim_list())
claim_list = (await self.out(self.daemon.jsonrpc_claim_list()))['items']
reposts_on_claim_list = [claim for claim in claim_list if claim['value_type'] == 'repost']
self.assertEqual(len(reposts_on_claim_list), 1)
await self.out(self.channel_create('@reposting-goodies', '1.0'))
await self.stream_repost(claim_id, 'repost-on-channel', '1.1', channel_name='@reposting-goodies')
claim_list = await self.out(self.daemon.jsonrpc_claim_list())
claim_list = (await self.out(self.daemon.jsonrpc_claim_list()))['items']
reposts_on_claim_list = [claim for claim in claim_list if claim['value_type'] == 'repost']
self.assertEqual(len(reposts_on_claim_list), 2)
signed_reposts = [repost for repost in reposts_on_claim_list if repost.get('is_channel_signature_valid')]