Skip to content

Commit

Permalink
Merge pull request #926 from AbdulBaseerKhan/NAJ-61-deploy-contract-t…
Browse files Browse the repository at this point in the history
…hrows-but-the-transaction-actually-succeeded

fix: NAJ-61
  • Loading branch information
esaminu authored Sep 6, 2022
2 parents d097026 + a927efb commit fcbd34c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/near-api-js/src/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ export class Account {
}, []);
this.printLogsAndFailures(signedTx.transaction.receiverId, flatLogs);

if (!returnError && typeof result.status === 'object' && typeof result.status.Failure === 'object') {
// Should be falsy if result.status.Failure is null
if (!returnError && typeof result.status === 'object' && typeof result.status.Failure === 'object' && result.status.Failure !== null) {
// if error data has error_message and error_type properties, we consider that node returned an error in the old format
if (result.status.Failure.error_message && result.status.Failure.error_type) {
throw new TypedError(
Expand Down

0 comments on commit fcbd34c

Please sign in to comment.