Change data endpoint to block range

This commit is contained in:
nolash
2021-05-18 18:16:02 +02:00
parent f035bd3e9f
commit dd9305a0f2
6 changed files with 33 additions and 19 deletions

View File

@@ -31,7 +31,7 @@ def list_transactions_mined(
def list_transactions_mined_with_data(
session,
offset,
limit,
end,
):
"""Executes db query to return all confirmed transactions according to the specified offset and limit.
@@ -42,12 +42,12 @@ def list_transactions_mined_with_data(
:result: Result set
:rtype: SQLAlchemy.ResultProxy
"""
s = "SELECT tx_hash, block_number, date_block, sender, recipient, from_value, to_value, source_token, destination_token, domain, value FROM tx LEFT JOIN tag_tx_link ON tx.id = tag_tx_link.tx_id LEFT JOIN tag ON tag_tx_link.tag_id = tag.id"
s = "SELECT tx_hash, block_number, date_block, sender, recipient, from_value, to_value, source_token, destination_token, domain, value FROM tx LEFT JOIN tag_tx_link ON tx.id = tag_tx_link.tx_id LEFT JOIN tag ON tag_tx_link.tag_id = tag.id WHERE block_number >= {} AND block_number <= {} ORDER BY block_number ASC, tx_index ASC".format(offset, end)
r = session.execute(s)
return r
def list_transactions_account_mined(
session,
address,