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 upgrade_and_call #1148

Merged
merged 26 commits into from
Oct 14, 2024

Conversation

andrew-fleming
Copy link
Collaborator

@andrew-fleming andrew-fleming commented Sep 14, 2024

Fixes #694.

This PR proposes to add upgrade_and_call to UpgradeableComponent's InternalImpl. This PR also proposes to add IUpgradeAndCall interface which includes both upgrade and upgrade_and_call.

PR Checklist

Copy link
Member

@ericnordelo ericnordelo left a comment

Choose a reason for hiding this comment

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

Looking good Andrew. Left some comments.

packages/upgrades/src/upgradeable.cairo Outdated Show resolved Hide resolved
packages/upgrades/src/interface.cairo Outdated Show resolved Hide resolved
docs/modules/ROOT/pages/api/upgrades.adoc Show resolved Hide resolved
docs/modules/ROOT/pages/api/upgrades.adoc Outdated Show resolved Hide resolved
docs/modules/ROOT/pages/api/upgrades.adoc Show resolved Hide resolved
Copy link
Collaborator

@immrsd immrsd left a comment

Choose a reason for hiding this comment

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

Good job, Andrew!
I've left a couple of comments

packages/upgrades/src/upgradeable.cairo Show resolved Hide resolved
packages/upgrades/src/tests/test_upgradeable.cairo Outdated Show resolved Hide resolved
docs/modules/ROOT/pages/api/upgrades.adoc Outdated Show resolved Hide resolved
Copy link

codecov bot commented Sep 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.53%. Comparing base (c5cd715) to head (d3fb1df).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1148      +/-   ##
==========================================
+ Coverage   91.51%   91.53%   +0.02%     
==========================================
  Files          46       46              
  Lines        1178     1182       +4     
==========================================
+ Hits         1078     1082       +4     
  Misses        100      100              
Files with missing lines Coverage Δ
packages/upgrades/src/upgradeable.cairo 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c5cd715...d3fb1df. Read the comment docs.

Copy link
Collaborator

@immrsd immrsd left a comment

Choose a reason for hiding this comment

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

Left a couple of minor suggestions. Apart from that, I think we are ready to go

docs/modules/ROOT/pages/api/upgrades.adoc Show resolved Hide resolved
packages/upgrades/src/tests/test_upgradeable.cairo Outdated Show resolved Hide resolved
}

#[test]
#[ignore] // REASON:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's not forget to add a reason or un-ignore the test

packages/upgrades/src/upgradeable.cairo Outdated Show resolved Hide resolved
andrew-fleming and others added 2 commits September 25, 2024 15:54
Co-authored-by: immrsd <103599616+immrsd@users.noreply.github.com>
Copy link
Member

@ericnordelo ericnordelo left a comment

Choose a reason for hiding this comment

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

LGTM! Let's just add the reason to the ignored tests, and I think we can merge this and fix the test later when we get more information about the test env issue since we already tested it on testnet.

@andrew-fleming andrew-fleming merged commit f7b7a7b into OpenZeppelin:main Oct 14, 2024
8 checks passed
@andrew-fleming andrew-fleming deleted the add-upgrade-and-call branch October 14, 2024 17:38
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.

Add upgrade_and_call as utility
3 participants