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

refactor: N-02 Code Clarity Suggestions #588

Merged
merged 11 commits into from
Oct 9, 2023
Merged

refactor: N-02 Code Clarity Suggestions #588

merged 11 commits into from
Oct 9, 2023

Conversation

Orland0x
Copy link
Contributor

@Orland0x Orland0x commented Oct 6, 2023

closes #564

@Orland0x Orland0x requested a review from pscott October 6, 2023 12:01
@pscott pscott mentioned this pull request Oct 6, 2023
1 task
Copy link
Contributor

@pscott pscott left a comment

Choose a reason for hiding this comment

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

utACK

@@ -32,15 +32,12 @@ mod MerkleWhitelistVotingStrategy {
params: Span<felt252>, // [root: felt252]
user_params: Span<felt252>, // [leaf: Leaf, proof: Array<felt252>]
) -> u256 {
let cache = user_params; // cache
let mut params = params;
Copy link
Contributor

Choose a reason for hiding this comment

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

you can add mut keywrods to the params and user_params arguments directly, no need to re-bind :D

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oh nice, updated. think there some other situations where we can do this. will have a look

@@ -47,7 +47,7 @@ impl StoreFelt252Array of Store<Array<felt252>> {
offset += 1;

// Sequentially read all stored elements and append them to the array.
let exit = len + offset;
let exit = len * Store::<felt252>::size() + offset;
Copy link
Contributor

Choose a reason for hiding this comment

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

I did this, what do you think 73a9269 ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah thanks, that makes a lot of sense.

@Orland0x Orland0x merged commit 16742df into develop Oct 9, 2023
2 checks passed
@Orland0x Orland0x deleted the audit_n02 branch October 9, 2023 10:16
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.

audit: N-02 Code Clarity Suggestions
2 participants