decode .errors json
This commit is contained in:
parent
6b7140fa3a
commit
70d08fd2a4
|
@ -28,7 +28,7 @@
|
|||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<div class="align-items-center text-truncate" style="width:300px">
|
||||
<div class="d-flex align-items-center text-truncate" style="width:300px">
|
||||
<span class="font-monospace">
|
||||
{% if tx.is_executed %}
|
||||
<a href="https://explorer.solana.com/tx/{{tx.signature}}?cluster={{config.cluster}}">{{tx.signature}}</a>
|
||||
|
@ -44,8 +44,8 @@
|
|||
{% for error in tx.errors_array %}
|
||||
<tr>
|
||||
<td>
|
||||
<span class="font-monospace text-danger">
|
||||
{{error}}
|
||||
<span class="font-monospace text-danger" title="Slot {{error.slot}}">
|
||||
{{error.count}}x {{error.error}}
|
||||
</span>
|
||||
</td>
|
||||
</tr>
|
||||
|
|
|
@ -36,8 +36,7 @@ def run_query():
|
|||
|
||||
for index, row in enumerate(maprows):
|
||||
row['pos'] = index + 1
|
||||
row['errors_array'] = json.loads(row['errors'])
|
||||
row['accounts_used_array'] = json.loads(row['accounts_used'])
|
||||
map_jsons_in_row(row)
|
||||
|
||||
return maprows
|
||||
|
||||
|
@ -72,12 +71,18 @@ def find_transaction_by_sig(tx_sig: str):
|
|||
assert len(maprows) <= 1, "Tx Sig is primary key - find zero or one"
|
||||
|
||||
for row in maprows:
|
||||
row['errors_array'] = json.loads(row['errors'])
|
||||
row['accounts_used_array'] = json.loads(row['accounts_used'])
|
||||
map_jsons_in_row(row)
|
||||
|
||||
return maprows
|
||||
|
||||
|
||||
def map_jsons_in_row(row):
|
||||
if row['errors']:
|
||||
row['errors_array'] = json.loads(row['errors'])
|
||||
if row['accounts_used']:
|
||||
row['accounts_used_array'] = json.loads(row['accounts_used'])
|
||||
|
||||
|
||||
def main():
|
||||
run_query()
|
||||
|
||||
|
|
Loading…
Reference in New Issue