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

Counter-v3 #31

Merged
merged 5 commits into from
Apr 16, 2024
Merged

Counter-v3 #31

merged 5 commits into from
Apr 16, 2024

Conversation

sczembor
Copy link
Contributor

Add new Counter Contract (v3) & Testing

  • Introduces contract-v3 demonstrating adding named keys (LAST_UPDATED_KEY) and entry points (get_last_updated_at) during upgrades.
  • Refactors integration tests with helper functions for better readability and debugging.
  • Improves test comments for clarity.
  • Shows how to test time sensitive functions in a smart contract

@ACStone-MTS ACStone-MTS requested a review from deuszex March 20, 2024 15:50
// The given key doesn't exist, so install the contract.
install_counter();
// Next, upgrade the contract.
upgrade_counter();
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you upgrade the contract you just deployed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is done the same way as the existing contract-v2. I believe this is done so the code from upgrade_contract is not repeated in install contract function

Copy link

@ACStone-MTS ACStone-MTS left a comment

Choose a reason for hiding this comment

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

I don't see any reason to hold this up, as we've had eyes on it and it isn't load bearing beyond the docs - if we find issues down the line, we can always revisit.

@sczembor sczembor merged commit 1af7bde into master Apr 16, 2024
2 checks passed
@sczembor sczembor deleted the contract_migrations branch April 16, 2024 13:00
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