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

improve(tests): silence unsafeAllowDelegatecall warning in tests #820

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

bmzig
Copy link
Contributor

@bmzig bmzig commented Dec 23, 2024

Applies the function introduced by OZ in this PR: OpenZeppelin/openzeppelin-upgrades#228. This is only used on two test fixtures, so we still should see warnings when we deploy.

@bmzig bmzig marked this pull request as ready for review December 23, 2024 20:02
Copy link
Contributor

@james-a-morris james-a-morris left a comment

Choose a reason for hiding this comment

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

OOC will this potentially silence other warnings?

@bmzig
Copy link
Contributor Author

bmzig commented Dec 30, 2024

OOC will this potentially silence other warnings?

It would if there were other warnings thrown in those fixtures.

nicholaspai
nicholaspai previously approved these changes Dec 31, 2024
Copy link
Member

@nicholaspai nicholaspai left a comment

Choose a reason for hiding this comment

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

fixtures by design are only used in tests so this is nice. Is there way to target specific warnings?

Signed-off-by: bennett <[email protected]>
@bmzig
Copy link
Contributor Author

bmzig commented Dec 31, 2024

fixtures by design are only used in tests so this is nice. Is there way to target specific warnings?

I don't see a way to do this. I was referencing this post: https://forum.openzeppelin.com/t/logging-verbose-during-local-tests-with-upgradeable-contracts/4633, which seemed to have similar issues as ours. I changed this to just instead silence warnings for our contract tests only. The upside is that we should have a clean output for our tests, but the downside is that any warnings emitted from @openzeppelin/hardhat-upgrades will be silenced (e.g. the unsafeAllow options found here) I think this is OK, since we still will need to explicitly supply the unsafeAllow type when deploying the contract.

Edit: I'm reverting this change and going to back to what I originally had since if we don't suppress the warnings in the fixtures, then we will get spammed in the other repositories, e.g. the relayer.

Signed-off-by: bennett <[email protected]>
Signed-off-by: bennett <[email protected]>
Copy link

socket-security bot commented Dec 31, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report↗︎

Signed-off-by: bennett <[email protected]>
Copy link

Report too large to display inline

View full report↗︎

Copy link
Contributor

@james-a-morris james-a-morris left a comment

Choose a reason for hiding this comment

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

Curious about Nick's comment. This is what I was probing at. If we can't and this looks good I will approve so that I'm not a blocker

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