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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ensure option is used to remove warning #910

Merged
merged 3 commits into from Feb 14, 2024

Conversation

glihm
Copy link
Contributor

@glihm glihm commented Feb 13, 2024

When testing with the new 0.9.0 version, we had some warning when compiling a project:

warning: Unhandled `#[must_use]` type `core::option::Option::<@core::felt252>`
 --> /home/.cache/scarb/registry/git/checkouts/cairo-contracts-9cboa8jg3jldq/861fc41/src/tests/utils.cairo:26:5
    keys.pop_front();
    ^**************^

warning: Unhandled `#[must_use]` type `core::option::Option::<(core::array::Span::<core::felt252>, core::array::Span::<core::felt252>)>`
 --> /home/.cache/scarb/registry/git/checkouts/cairo-contracts-9cboa8jg3jldq/861fc41/src/tests/utils.cairo:51:5
    testing::pop_log_raw(address);
    ^***************************^

warning: Unhandled `#[must_use]` type `core::option::Option::<@core::felt252>`
 --> /home/.cache/scarb/registry/git/checkouts/cairo-contracts-9cboa8jg3jldq/861fc41/src/tests/utils.cairo:26:5
    keys.pop_front();
    ^**************^

warning: Unhandled `#[must_use]` type `core::option::Option::<(core::array::Span::<core::felt252>, core::array::Span::<core::felt252>)>`
 --> /home/.cache/scarb/registry/git/checkouts/cairo-contracts-9cboa8jg3jldq/861fc41/src/tests/utils.cairo:51:5
    testing::pop_log_raw(address);
    ^***************************^

Checking on main, this issue is still present.
This PR aims at using the Option to avoid warnings.

PR Checklist

It's a very small fix for warnings, the test suite passes but I've not deployed a contract on public network as the issue is related to testing only. Not sure if the CHANGELOG applies in this occasion, but will be happy to complete any missing item. 馃憤

  • Tests
  • Documentation
  • Added entry to CHANGELOG.md
  • Tried the feature on a public network

@ericnordelo ericnordelo mentioned this pull request Feb 13, 2024
4 tasks
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.

Thanks for reporting and taking the time!

src/tests/utils.cairo Outdated Show resolved Hide resolved
src/tests/utils.cairo Outdated Show resolved Hide resolved
glihm and others added 2 commits February 13, 2024 09:15
We should always have at least one key for the selector, as this function is not meant to be used with components.

Co-authored-by: Eric Nordelo <eric.nordelo39@gmail.com>
Co-authored-by: Eric Nordelo <eric.nordelo39@gmail.com>
@glihm
Copy link
Contributor Author

glihm commented Feb 13, 2024

@ericnordelo sorry then for the lack of pertinence here, appreciate your feedback and context. 馃憤

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!

Copy link
Collaborator

@andrew-fleming andrew-fleming left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks, @glihm!

@ericnordelo ericnordelo merged commit 44b5259 into OpenZeppelin:main Feb 14, 2024
5 checks passed
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.

None yet

3 participants