From 6ee599af68f59181acf4a6ce534189019fe4dedc Mon Sep 17 00:00:00 2001 From: Vivek Teega Date: Sun, 6 Oct 2019 13:55:10 +0530 Subject: [PATCH] adding more Token count and Smart Contract count to getSystemData api --- ranchimallflo_api.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ranchimallflo_api.py b/ranchimallflo_api.py index fcfffc1..5477445 100644 --- a/ranchimallflo_api.py +++ b/ranchimallflo_api.py @@ -813,6 +813,8 @@ async def systemData(): conn = sqlite3.connect(os.path.join(dbfolder, 'system.db')) c = conn.cursor() tokenAddressCount = c.execute('select count(distinct tokenAddress) from tokenAddressMapping').fetchall()[0][0] + tokenCount = c.execute('select count(distinct token) from tokenAddressMapping').fetchall()[0][0] + contractCount = c.execute('select count(distinct contractName) from contractParticipantMapping').fetchall()[0][0] conn.close() # query for total number of validated blocks @@ -822,7 +824,7 @@ async def systemData(): validatedTransactionCount = c.execute('select count(distinct transactionHash) from latestTransactions').fetchall()[0][0] conn.close() - return jsonify(systemAddressCount=tokenAddressCount, systemBlockCount=validatedBlockCount, systemTransactionCount=validatedTransactionCount ,result='ok') + return jsonify(systemAddressCount=tokenAddressCount, systemBlockCount=validatedBlockCount, systemTransactionCount=validatedTransactionCount , systemSmartContractCount=contractCount, systemTokenCount=tokenCount, result='ok')