-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Error message:
Error decoding instruction: list index out of range
It comes from this code:
def get_account_key(index: int) -> str:
if index >= len(accounts):
return "N/A"
account_index = accounts[index]
return base58.b58encode(keys[account_index]).decode()Cause
- accounts[index] gives account_index.
- For some instructions, account_index is >= len(keys), so keys[account_index] throws IndexError.
Fix
Make the function check both bounds:
def get_account_key(index: int) -> str:
if index >= len(accounts):
return "N/A"
account_index = accounts[index]
if account_index >= len(keys):
return "N/A"
return base58.b58encode(keys[account_index]).decode()Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels