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

fix: mutable self required for dispatchable ink! methods #235

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

chungquantin
Copy link
Collaborator

In our current pop-api contracts, we do not mark self as mutable because the contract storage is not being modified directly; instead, the runtime storage is mutated by the pop-api. However, on the client side, when using libraries that support ink! (such as PJS or Dedot), these methods are perceived as query rather than tx, as the contract itself does not undergo changes.

While it's unclear whether pop-api will be utilized in immutable methods in production, it is crucial to clearly state this requirement in the documentation. This will help ensure that developers understand how pop-api behaves and how it might impact the perception and execution of methods in client-side libraries.

cc: @Daanvdplas @peterwht

@chungquantin chungquantin added documentation Improvements or additions to documentation question Further information is requested api Pop API labels Aug 26, 2024
@chungquantin chungquantin self-assigned this Aug 26, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 34.08%. Comparing base (6482a43) to head (c10f15c).
Report is 1 commits behind head on daan/api.

@@            Coverage Diff            @@
##           daan/api     #235   +/-   ##
=========================================
  Coverage     34.08%   34.08%           
=========================================
  Files            34       34           
  Lines          3013     3013           
  Branches       3013     3013           
=========================================
  Hits           1027     1027           
  Misses         1954     1954           
  Partials         32       32           

Copy link
Collaborator

@Daanvdplas Daanvdplas left a comment

Choose a reason for hiding this comment

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

Nice find!

@Daanvdplas Daanvdplas merged commit 8d1c085 into daan/api Aug 26, 2024
8 checks passed
@Daanvdplas Daanvdplas deleted the chungquantin/docs-mutable_required branch August 26, 2024 15:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Pop API documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants