Skip to content

Commit

Permalink
FIX: findTransactionError extracted exit_code incorrectly: should che…
Browse files Browse the repository at this point in the history
…ck compute phase presence
  • Loading branch information
melsomino committed Dec 14, 2022
1 parent e671d36 commit 3f348a8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
4 changes: 2 additions & 2 deletions contracts/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,10 @@ export function findTransactionError(
const {
id,
aborted,
compute: { exit_code },
account_addr,
} = transaction;
const errorCode = exit_code !== 0 ? exit_code : altErrorCode;
const exitCode = transaction.compute?.exit_code ?? 0;
const errorCode = exitCode !== 0 ? exitCode : altErrorCode;
if (!aborted && errorCode === 0) {
return undefined;
}
Expand Down
6 changes: 4 additions & 2 deletions dist/contracts/errors.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/flex/web3/accounts.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ export type DerivativeTransaction = {
out_messages: DerivativeTransactionMessage[];
account_addr: string;
aborted: boolean;
compute: {
exit_code: number;
compute?: {
exit_code?: number;
};
lt: string;
};
Expand Down
2 changes: 1 addition & 1 deletion dist/tsconfig.tsbuildinfo

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions flex/web3/accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ export type DerivativeTransaction = {
out_messages: DerivativeTransactionMessage[];
account_addr: string;
aborted: boolean;
compute: {
exit_code: number;
compute?: {
exit_code?: number;
};
lt: string;
};
Expand Down

0 comments on commit 3f348a8

Please sign in to comment.