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 assert_valid_signature utility #1223

Open
ericnordelo opened this issue Nov 18, 2024 · 3 comments
Open

Add assert_valid_signature utility #1223

ericnordelo opened this issue Nov 18, 2024 · 3 comments

Comments

@ericnordelo
Copy link
Member

🧐 Motivation

We have a few places where this code snippet is being used:

let is_valid_signature_felt = ISRC6Dispatcher { contract_address: voter }
                .is_valid_signature(hash, signature.into());

// 3. Check either 'VALID' or true for backwards compatibility
let is_valid_signature = is_valid_signature_felt == starknet::VALIDATED
                || is_valid_signature_felt == 1;

assert(is_valid_signature, Errors::INVALID_SIGNATURE);

We can refactor it into a single utility to avoid repeating it further.

@baitcode
Copy link

baitcode commented Dec 5, 2024

@ericnordelo do you accept external contributions?

@ericnordelo
Copy link
Member Author

Hey @baitcode, yes, we happily accept external contributions! Always confirm with us before starting to work on an issue, since we may not accept external contributions for specific ones depending on priorities, complexity, maturity, etc... but this one is not the case, feel free to open a PR and we will review it.

@baitcode
Copy link

baitcode commented Dec 5, 2024

@ericnordelo
This time I was just asking, already have responsibility for 4 issues. But will watch your repos from now on. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 📋 Backlog
Development

No branches or pull requests

2 participants