lint
This commit is contained in:
parent
3f3e370d36
commit
fa75895131
1 changed files with 8 additions and 3 deletions
|
@ -57,11 +57,16 @@ class FullEndpoint(Service):
|
|||
start_height=start_height, end_height=end_height, granularity=granularity
|
||||
)
|
||||
|
||||
async def search_transactions(self, txids):
|
||||
async def search_transactions(self, txids, raw: bool = False):
|
||||
tx_hashes = [unhexlify(txid)[::-1] for txid in txids]
|
||||
if raw:
|
||||
return {
|
||||
hexlify(tx['tx_hash'][::-1]).decode(): hexlify(tx['raw']).decode()
|
||||
for tx in await self.db.get_raw_transactions(tx_hash__in=tx_hashes)
|
||||
}
|
||||
return {
|
||||
hexlify(tx['tx_hash'][::-1]).decode(): hexlify(tx['raw']).decode()
|
||||
for tx in await self.db.get_transactions(tx_hashes=tx_hashes)
|
||||
tx.id: hexlify(tx.raw).decode()
|
||||
for tx in await self.db.get_transactions(tx_hash__in=tx_hashes)
|
||||
}
|
||||
|
||||
async def broadcast(self, tx):
|
||||
|
|
Loading…
Add table
Reference in a new issue