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

feat: whitelist proposal validation #476

Closed
wants to merge 5 commits into from

Conversation

pscott
Copy link
Contributor

@pscott pscott commented Aug 11, 2023

Based on the merkle implementation of the voting strategy.

Closes #473

@pscott pscott requested a review from Orland0x August 11, 2023 15:08
@Orland0x
Copy link
Contributor

hard to see the actual diff cuz of changing paths. I just need to review starknet/src/proposal_validation_strategies/merkle_whitelist.cairo and starknet/src/tests/proposal_validation_strategies/test_merkle_whitelist.cairo the rest didnt change right?

let mut user_params = ArrayTrait::<felt252>::new();
let fake_leaf = Leaf {
address: UserAddress::Starknet(contract_address_const::<0x1337>()),
voting_power: leaf.voting_power + 1,
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like the voting power and address are both modified

struct Storage {}

#[derive(Drop, Serde)]
struct Input {
Copy link
Contributor

@Orland0x Orland0x Aug 16, 2023

Choose a reason for hiding this comment

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

could call something like StrategyParams, which we could use in all strategies to define the deserialization of params so its clear what this refers to.

use starknet::contract_address_const;
use sx::types::UserAddress;

// Checks that that the leaf at the given index is correclty accepted or rejected (given a certain `threshold`).
Copy link
Contributor

Choose a reason for hiding this comment

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

correctly

let members = generate_n_members(20);
let threshold = 3_u256; // Voting power required to submit a proposal

let (contract, _) = deploy_syscall(
Copy link
Contributor

Choose a reason for hiding this comment

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

could put following 10 lines into a setup() utility as its duplicated in every test

@pscott
Copy link
Contributor Author

pscott commented Aug 16, 2023

closed in favor of #496

@pscott pscott closed this Aug 16, 2023
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.

Whitelist proposal validation strategy
2 participants