diff --git a/app.py b/app.py index a0b3869..038c251 100644 --- a/app.py +++ b/app.py @@ -16,7 +16,7 @@ from config import Cfg from db_provider import get_history_token_price -service_version = "20220622.01" +service_version = "20220630.01" Welcome = 'Welcome to ref datacenter API server, version '+service_version+', indexer %s' % Cfg.NETWORK[Cfg.NETWORK_ID]["INDEXER_HOST"][-3:] # Instantiation, which can be regarded as fixed format app = Flask(__name__) diff --git a/indexer_provider.py b/indexer_provider.py index 4a22eb5..283ab90 100644 --- a/indexer_provider.py +++ b/indexer_provider.py @@ -5,6 +5,7 @@ from config import Cfg import psycopg2 import decimal +import time class DecimalEncoder(json.JSONEncoder): def default(self, o): @@ -50,7 +51,10 @@ def get_actions(network_id, account_id): password=Cfg.NETWORK[network_id]["INDEXER_PWD"], host=Cfg.NETWORK[network_id]["INDEXER_HOST"], port=Cfg.NETWORK[network_id]["INDEXER_PORT"]) - cur=conn.cursor() + cur=conn.cursor() + + now_time = int(time.time()) + old_time = (now_time - (30 * 24 * 60 * 60)) * 1000000000 sql1 = ( "select " @@ -63,7 +67,7 @@ def get_actions(network_id, account_id): "status " "from action_receipt_actions join receipts using(receipt_id) " "join execution_outcomes using(receipt_id) " - "where action_kind = 'FUNCTION_CALL' and ( " + "where action_kind = 'FUNCTION_CALL' and included_in_block_timestamp > %s and ( " % old_time ) sql2 = """(predecessor_account_id = %s and """