Skip to content

Commit

Permalink
supported cw4 group addr query member both old & new ver
Browse files Browse the repository at this point in the history
  • Loading branch information
ducphamle2 committed Mar 23, 2023
1 parent 0b38758 commit c1adb69
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion contracts/cw3-flex-multisig/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ fn is_member(
height: Option<u64>,
) -> StdResult<Option<u64>> {
let cfg = CONFIG.load(storage)?;
match height {
let mut old_ver_height = match height {
Some(height) => cfg
.group_addr
.member_at_height(querier, member.to_string(), height.into()),
Expand All @@ -488,7 +488,12 @@ fn is_member(
cfg.group_addr.addr(),
api.addr_canonicalize(member.as_str())?.to_vec(),
),
}?;
// if None then we try to query using the new way
if old_ver_height.is_none() {
old_ver_height = Map::new(MEMBERS_KEY).query(querier, cfg.group_addr.addr(), member)?;
}
Ok(old_ver_height)
}

fn query_voter(deps: Deps, voter: String) -> StdResult<VoterResponse> {
Expand Down

0 comments on commit c1adb69

Please sign in to comment.