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

Fix min threshold in cw3-flex-multisig #528

Merged
merged 11 commits into from
Nov 16, 2021

Conversation

ueco-jb
Copy link
Contributor

@ueco-jb ueco-jb commented Nov 4, 2021

Closes #527

@ueco-jb ueco-jb self-assigned this Nov 4, 2021
@maurolacy maurolacy changed the title Fix threashold and vote power bug in cw3-flex-multisig Fix min threshold and vote power bugs in cw3-flex-multisig Nov 4, 2021
packages/cw4/src/helpers.rs Outdated Show resolved Hide resolved
packages/cw4/src/helpers.rs Outdated Show resolved Hide resolved
contracts/cw3-flex-multisig/src/contract.rs Outdated Show resolved Hide resolved
@ueco-jb
Copy link
Contributor Author

ueco-jb commented Nov 8, 2021

Put on hold (low prio) till all matters are clarified. #528 (comment)

@ueco-jb ueco-jb force-pushed the 527-cw3multisig-fix-threshold-and-weight branch from 12375c4 to 15c69c0 Compare November 11, 2021 14:31
@ueco-jb ueco-jb changed the title Fix min threshold and vote power bugs in cw3-flex-multisig Fix min threshold in cw3-flex-multisig Nov 11, 2021
@ueco-jb ueco-jb force-pushed the 527-cw3multisig-fix-threshold-and-weight branch from 15c69c0 to 3f89079 Compare November 11, 2021 14:35
@ueco-jb ueco-jb force-pushed the 527-cw3multisig-fix-threshold-and-weight branch 4 times, most recently from 5d2b562 to 2b26ae1 Compare November 11, 2021 15:23
@ueco-jb ueco-jb marked this pull request as ready for review November 11, 2021 15:24
@ueco-jb ueco-jb force-pushed the 527-cw3multisig-fix-threshold-and-weight branch 3 times, most recently from 30ec166 to 6078083 Compare November 15, 2021 12:37
@ueco-jb ueco-jb requested a review from maurolacy November 15, 2021 12:37
Copy link
Contributor

@maurolacy maurolacy left a comment

Choose a reason for hiding this comment

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

Looks good.

@@ -934,6 +945,12 @@ mod tests {
],
);

// VOTER1 cannot vote again
Copy link
Contributor

Choose a reason for hiding this comment

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

👍🏼

contracts/cw3-flex-multisig/src/error.rs Outdated Show resolved Hide resolved
) -> StdResult<Option<u64>> {
match height {
Some(height) => self.member_at_height(querier, member.to_string(), height.into()),
None => Map::new(MEMBERS_KEY).query(querier, self.addr(), member),
Copy link
Contributor

@maurolacy maurolacy Nov 15, 2021

Choose a reason for hiding this comment

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

Wouldn't a raw query make sense here? Not sure, but, given that you already have querier, maybe the usage is simpler / clearer.

Copy link
Member

Choose a reason for hiding this comment

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

Map::query does use a raw query under the hood (it calculated the final key in the other storage).

Querying at historical height does need smart query.

Copy link
Member

Choose a reason for hiding this comment

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

NB: This code infers the type of Map completely? Based on self.addr() and the return value? Wow!

@ueco-jb ueco-jb force-pushed the 527-cw3multisig-fix-threshold-and-weight branch from 95c8d9a to 8028c24 Compare November 16, 2021 09:01
@ueco-jb ueco-jb merged commit 15f9b64 into main Nov 16, 2021
@ueco-jb ueco-jb deleted the 527-cw3multisig-fix-threshold-and-weight branch November 16, 2021 09:13
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.

Fix min threshold and vote power bugs in cw3-flex-multisig
3 participants