Skip to content

Commit

Permalink
fix: return overlow if accountKeys errors out
Browse files Browse the repository at this point in the history
  • Loading branch information
k0beLeenders committed Feb 3, 2025
1 parent 42a3fc6 commit 4693b21
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,15 @@ export function getAccountKeys(
): number {
const isVersioned = isV0Tx(tx);

if (isVersioned) {
const message = TransactionMessage.decompile(tx.message, { addressLookupTableAccounts: lookupTableAccounts });
return message.compileToLegacyMessage().getAccountKeys().length;
// return tx.message.getAccountKeys().length;
} else {
return tx.compileMessage().getAccountKeys().length;
try {
if (isVersioned) {
const message = TransactionMessage.decompile(tx.message, { addressLookupTableAccounts: lookupTableAccounts });
return message.compileToLegacyMessage().getAccountKeys().length;
} else {
return tx.compileMessage().getAccountKeys().length;
}
} catch (error) {
return 9999;
}
}

Expand Down

0 comments on commit 4693b21

Please sign in to comment.