Skip to content

Commit dd67359

Browse files
committed
add deferred transactions
1 parent ded2e89 commit dd67359

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

scripts/blockchain_audit_tool.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,13 +143,23 @@ def getJSONResp(conn, rpc, req_body="", exitOnError=True):
143143
prot_feats = prot_feats['activated_protocol_features']
144144
data['activated_protocol_features'] = prot_feats
145145

146+
# get deferred transactions
147+
limit = 100
148+
req_body = '{' + f'"limit" : {limit}' + '}'
149+
trx = getJSONResp(conn, "/v1/chain/get_scheduled_transactions", req_body, exitOnError=False)
150+
deferred_trx = []
151+
while 'more' in trx and len(trx['more']) > 0:
152+
deferred_trx.append(trx['transactions'])
153+
req_body = '{' + f'"limit" : {limit}, "more" : {trx["more"]}' + '}'
154+
155+
trx = getJSONResp(conn, "/v1/chain/get_scheduled_transactions", req_body, exitOnError=False)
156+
146157
# get the server info again
147158
server_info_end = getJSONResp(conn, "/v1/chain/get_info")
148159

149160
data['server_info_begin'] = server_info_begin
150161
data['server_info_end'] = server_info_end
151162

152-
153163
# print out results
154164
try:
155165
print(" EOSIO BLOCKCHAIN AUDIT RESULTS\n")
@@ -266,6 +276,14 @@ def getJSONResp(conn, rpc, req_body="", exitOnError=True):
266276
if not atLeastOne:
267277
print("(None)")
268278

279+
print("\n\n ====== DEFERRED TRANSACTIONS ======")
280+
print("---------------------------------------------------------------------------------------------------------")
281+
if len(deferred_trx) == 0:
282+
print("(None)")
283+
else:
284+
for trx in deferred_trx:
285+
print(trx)
286+
269287
print("\nFULL SERVER INFO:\n")
270288
for k, v in server_info_end.items():
271289
print(f"{k:>30} : {v}")

0 commit comments

Comments
 (0)