diff --git a/lbrynet/testcase.py b/lbrynet/testcase.py index 40f95beac..579f9dc69 100644 --- a/lbrynet/testcase.py +++ b/lbrynet/testcase.py @@ -151,11 +151,15 @@ class CommandTestCase(IntegrationTestCase): await self.blockchain.generate(blocks) await self.ledger.on_header.where(self.blockchain.is_expected_block) - def blockchain_claim_name(self, name: str, value: str, amount: str): - return self.blockchain._cli_cmnd('claimname', name, value, amount) + async def blockchain_claim_name(self, name: str, value: str, amount: str): + txid = await self.blockchain._cli_cmnd('claimname', name, value, amount) + await self.generate(1) + return txid - def blockchain_update_name(self, txid: str, value: str, amount: str): - return self.blockchain._cli_cmnd('updateclaim', txid, value, amount) + async def blockchain_update_name(self, txid: str, value: str, amount: str): + txid = await self.blockchain._cli_cmnd('updateclaim', txid, value, amount) + await self.generate(1) + return txid async def out(self, awaitable): """ Serializes lbrynet API results to JSON then loads and returns it as dictionary. """ diff --git a/tests/integration/test_file_commands.py b/tests/integration/test_file_commands.py index 1c6d8ccb1..11164d860 100644 --- a/tests/integration/test_file_commands.py +++ b/tests/integration/test_file_commands.py @@ -34,12 +34,10 @@ class FileCommands(CommandTestCase): claim = claim['lbry://foo']['claim']['protobuf'].decode() await self.daemon.jsonrpc_file_delete(claim_name='foo') txid = await self.blockchain_claim_name('bar', claim, '0.01') - await self.generate(1) await self.daemon.jsonrpc_get('lbry://bar') claim = Claim.from_bytes(unhexlify(claim)) claim.stream.description = "fix typos, fix the world" await self.blockchain_update_name(txid, hexlify(claim.to_bytes()).decode(), '0.01') - await self.generate(1) await self.daemon.jsonrpc_resolve('lbry://bar') file_list = self.daemon.jsonrpc_file_list() self.assertEqual(file_list[0].stream_claim_info.claim.stream.description, claim.stream.description) diff --git a/tests/integration/test_resolve_command.py b/tests/integration/test_resolve_command.py index 2418493b3..43b1d8859 100644 --- a/tests/integration/test_resolve_command.py +++ b/tests/integration/test_resolve_command.py @@ -72,7 +72,6 @@ class ResolveCommand(CommandTestCase): # resolve handles invalid data txid = await self.blockchain_claim_name( "gibberish", hexlify(b"{'invalid':'json'}").decode(), "0.1") - await self.generate(1) response = await self.resolve("lbry://gibberish") self.assertSetEqual({'lbry://gibberish'}, set(response)) claim = response['lbry://gibberish']['claim']