-
Notifications
You must be signed in to change notification settings - Fork 355
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
Finish v0.11 migration #111
Conversation
Ey, thanks for finishing this! I can review it today / tomorrow. |
contracts/cw20-base/src/contract.rs
Outdated
@@ -902,7 +911,7 @@ mod tests { | |||
); | |||
|
|||
// run the migration | |||
let env = mock_env(HumanAddr::from("admin"), &[]); | |||
let (env, _info) = mock_env_info(HumanAddr::from("admin"), &[]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't we need to add info to migrate so it compiles in wasm mode?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes you are right. I did it locally but I suppose you are working on it don't want to tip toes.
@maurolacy can you give a quick review on these changes before merging them into your branch (you should be able to do that). Then I can merge your branch into master. And we have 0.11 support! I guess I wait til Monday to cut the v0.3.0 release |
.collect(); | ||
|
||
Ok(ProposalListResponse { proposals: props? }) | ||
} | ||
|
||
fn map_proposal(item: StdResult<(Vec<u8>, Proposal)>) -> StdResult<ProposalResponse> { | ||
fn map_proposal( | ||
block: &BlockInfo, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
Duration::Time(duration) => mock_env_time(VOTER4, env.block.time + duration + 1), | ||
Duration::Height(duration) => mock_env_height(VOTER4, env.block.height + duration + 1), | ||
Duration::Time(duration) => mock_env_time(duration + 1), | ||
Duration::Height(duration) => mock_env_height(duration + 1), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quick review, LGTM.
contracts/cw721-base/src/contract.rs
Outdated
}) | ||
.filter_map(|item| match item { | ||
Ok((k, expires)) => { | ||
// we remove all expired operators from the result |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure about this? I'm not sure, but listing expired operators can be useful for debugging / accountability issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I can keep them, but then add another flag to the response "is_expired: bool". Is it useful info on the client, without forcing calculations there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea.
Another option would be to add a boolean flag to the query, i. e. include_expired
or so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be addressed here: 09b7b31
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another option would be to add a boolean flag to the query, i. e. include_expired or so.
Just read this. I actually prefer this idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will undo my change and redo it the other way. Let me know which commit you prefer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I too think the query option is better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Look at 0525a34
contracts/cw721-base/src/contract.rs
Outdated
info.approvals | ||
.iter() | ||
.filter(|apr| !apr.expires.is_expired(block)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I didn't update this part... Just the above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed that in 471c86f
09b7b31
to
0525a34
Compare
This finishes up the great work started in @maurolacy 's branch and makes a final cosmwasm-plus PR for the upgrades