Skip to content

Commit

Permalink
feat: change fundTransaction default to false on contract get (#503)
Browse files Browse the repository at this point in the history
  • Loading branch information
luizstacio authored Sep 10, 2022
1 parent 5828934 commit 7d01caa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/short-cobras-remain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@fuel-ts/contract": minor
---

Change contract get to not fund transaction by default
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,14 @@ export class BaseInvocationScope<TReturn = any> {
/**
* Executes a readonly contract method call.
*
* Under the hood it uses the `dryRun` method.
* Under the hood it uses the `dryRun` method but don't fund the transaction
* with coins by default, for emulating executions with forward coins use `dryRun`
* or pass the options.fundTransaction as true
*/
async get<T = TReturn>(options?: CallOptions): Promise<InvocationCallResult<T>> {
return this.dryRun<T>(options);
return this.dryRun<T>({
fundTransaction: false,
...options,
});
}
}

1 comment on commit 7d01caa

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coverage report

St.
Category Percentage Covered / Total
🟢 Statements 89.97% 3220/3579
🟡 Branches 70.3% 594/845
🟢 Functions 87.06% 646/742
🟢 Lines 89.82% 3087/3437

Test suite run success

487 tests passing in 44 suites.

Report generated by 🧪jest coverage report action from 7d01caa

Please sign in to comment.