Skip to content

Commit

Permalink
Merge pull request #224 from shariffdev/fix/txn_result_gas_burnt
Browse files Browse the repository at this point in the history
fix: txn_result gas burnt
  • Loading branch information
ailisp authored Nov 21, 2023
2 parents ee9ed82 + 51fed8d commit 50d1100
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/js/dist/transaction-result.d.ts

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

2 changes: 1 addition & 1 deletion packages/js/dist/transaction-result.d.ts.map

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

3 changes: 2 additions & 1 deletion packages/js/dist/transaction-result.js

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

2 changes: 1 addition & 1 deletion packages/js/dist/transaction-result.js.map

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

3 changes: 2 additions & 1 deletion packages/js/src/transaction-result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ export class TransactionResult {
}

get gas_burnt(): Gas {
return Gas.from(this.result.transaction_outcome.outcome.gas_burnt);
const receipts_gas = this.receipts_outcomes.reduce((acc, cur) => acc + cur.outcome.gas_burnt, 0);
return Gas.from(this.result.transaction_outcome.outcome.gas_burnt + receipts_gas);
}

receiptFailureMessagesContain(pattern: string | RegExp): boolean {
Expand Down

0 comments on commit 50d1100

Please sign in to comment.