This commit is contained in:
Lex Berezhny 2018-07-15 15:50:32 -04:00 committed by Jack Robison
parent aecc7c6643
commit f589410496
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2
3 changed files with 15 additions and 7 deletions

View file

@ -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'])
}

View file

@ -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']
)

View file

@ -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)