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

Add clean state example #61

Merged
merged 5 commits into from
May 26, 2022
Merged

Add clean state example #61

merged 5 commits into from
May 26, 2022

Conversation

itegulov
Copy link
Contributor

Hopefully this is what we are looking for but lmk if you need anything more in-depth

@itegulov itegulov requested review from ailisp and volovyks as code owners May 25, 2022 04:14
# Clean state contract in JavaScript

This is an equivalent JavaScript implementation of the clean state example. Every user can send and receive a non-fungible token.

Copy link
Member

Choose a reason for hiding this comment

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

I suggest to add a short instruction about how to use this contract. In summary, the steps are:

  1. Deploy this contract to the account where you want to clean up state
  2. Call the contract with known state keys to clean state. If delete all keys doesn't fit gas limit, you may need to do it a few times
  3. Once finished clean up state, Deploy the original contract or delete the contract code with near js remove

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done, PTAL

Copy link
Member

@ailisp ailisp left a comment

Choose a reason for hiding this comment

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

Overall the implementation and test is good! Docs need some update to help new developers

itegulov and others added 2 commits May 25, 2022 15:12
Co-authored-by: Bo Yao <bo@near.org>
Copy link
Collaborator

@volovyks volovyks left a comment

Choose a reason for hiding this comment

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

Cool!
From now on we will need to add each example to the examples CI job (check .github/ folder).

@itegulov
Copy link
Contributor Author

@volovyk-s done!

@itegulov
Copy link
Contributor Author

itegulov commented May 25, 2022

@volovyk-s seems like the CI has run out of space. Can we upgrade the instance?

Or I guess alternatively clean up node_modules after we are done with each example

Copy link
Member

@ailisp ailisp left a comment

Choose a reason for hiding this comment

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

Looks great!

@ailisp ailisp merged commit 7ec561f into master May 26, 2022
@ailisp ailisp deleted the daniyar/clean-state-example branch May 26, 2022 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants