tests
This commit is contained in:
parent
aecc7c6643
commit
f589410496
3 changed files with 15 additions and 7 deletions
|
@ -1599,11 +1599,11 @@ class Daemon(AuthJSONRPCServer):
|
|||
script = tx.outputs[0].script
|
||||
result = {
|
||||
"success": True,
|
||||
"txid": tx.hex_id.decode(),
|
||||
"txid": tx.id,
|
||||
"nout": 0,
|
||||
"tx": hexlify(tx.raw),
|
||||
"fee": str(Decimal(tx.fee) / COIN),
|
||||
"claim_id": tx.get_claim_id(0),
|
||||
"claim_id": hexlify(tx.get_claim_id(0)),
|
||||
"value": hexlify(script.values['claim']),
|
||||
"claim_address": self.ledger.hash160_to_address(script.values['pubkey_hash'])
|
||||
}
|
||||
|
|
|
@ -92,8 +92,8 @@ class CommandTestCase(IntegrationTestCase):
|
|||
lbry_conf.settings.node_id = None
|
||||
|
||||
await d2f(self.account.ensure_address_gap())
|
||||
address = (await d2f(self.account.receiving.get_usable_addresses(1)))[0]
|
||||
sendtxid = await self.blockchain.send_to_address(address.decode(), 10)
|
||||
address = (await d2f(self.account.receiving.get_addresses(1, only_usable=True)))[0]
|
||||
sendtxid = await self.blockchain.send_to_address(address, 10)
|
||||
await self.on_transaction_id(sendtxid)
|
||||
await self.blockchain.generate(1)
|
||||
await self.on_transaction_id(sendtxid)
|
||||
|
@ -135,9 +135,9 @@ class ChannelNewCommandTests(CommandTestCase):
|
|||
@defer.inlineCallbacks
|
||||
def test_new_channel(self):
|
||||
result = yield self.daemon.jsonrpc_channel_new('@bar', 1*COIN)
|
||||
self.assertIn('txid', result)
|
||||
self.assertTrue(result['success'])
|
||||
yield self.ledger.on_transaction.deferred_where(
|
||||
lambda e: e.tx.hex_id.decode() == result['txid']
|
||||
lambda e: e.tx.id == result['txid']
|
||||
)
|
||||
|
||||
|
||||
|
|
|
@ -87,5 +87,13 @@ class BasicTransactionTest(IntegrationTestCase):
|
|||
await self.blockchain.generate(1)
|
||||
await self.on_transaction(abandon_tx)
|
||||
|
||||
response = await d2f(self.ledger.resolve(0, 5, 'lbry://@bar/foo'))
|
||||
await self.blockchain.generate(1)
|
||||
await self.blockchain.generate(1)
|
||||
await self.blockchain.generate(1)
|
||||
await self.blockchain.generate(1)
|
||||
await self.blockchain.generate(1)
|
||||
|
||||
await asyncio.sleep(5)
|
||||
|
||||
response = await d2f(self.ledger.resolve(0, 10, 'lbry://@bar/foo'))
|
||||
self.assertNotIn('lbry://@bar/foo', response)
|
||||
|
|
Loading…
Add table
Reference in a new issue