Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Executing read functions on Sway playground consumes gas #56

Closed
sdankel opened this issue Mar 22, 2024 · 1 comment · Fixed by #92
Closed

Executing read functions on Sway playground consumes gas #56

sdankel opened this issue Mar 22, 2024 · 1 comment · Fixed by #92
Assignees
Labels
bug Something isn't working p0

Comments

@sdankel
Copy link
Member

sdankel commented Mar 22, 2024

https://forum.fuel.network/t/executing-read-functions-on-sway-playground-consumes-gas/4914

Hi,
While exploring and interacting with the Sway playground, I found an issue while reading the state. To take the example of the default contract (counter). After compiling and deploying the contract, during the interaction, calling the get function requires gas to get the current state of the counter. I assume, all the function components are mapped to the same read-write functionality whereas it should be differentiated as read & read-write. Also, read functions don’t require a dry run as it will just return the current state.

@sdankel sdankel added the bug Something isn't working label Mar 22, 2024
@sdankel
Copy link
Member Author

sdankel commented Apr 11, 2024

We can use isReadOnly now to make all read functions dry-run: FuelLabs/fuels-ts#2008

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working p0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant