-
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
Migrate contracts to 0.15.0 #318
Conversation
Upgrade packages to cosmwasm 0.15.0
cw20-base: Upgrade to cw 0.15
messages: vec![], | ||
attributes: vec![ | ||
attr("action", "set_permissions"), | ||
attr("owner", info.sender), | ||
attr("spender", spender), | ||
attr("permissions", perm), | ||
], | ||
events: vec![], |
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.
Note, in other places Ethan started to write this as something like
let res = Response {
messages: vec![SubMsg::new(send)],
..Response::default()
}
to avoid listing all the unset fields. But it is fine either way.
msgs: vec![execute_mint_msg.into()], | ||
msgs: vec![CosmosMsg::Wasm(execute_mint_msg)], |
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.
This change could probably be reverted now
@@ -20,7 +20,7 @@ pub struct Proposal { | |||
pub title: String, | |||
pub description: String, | |||
pub expires: Expiration, | |||
pub msgs: Vec<CosmosMsg<Empty>>, | |||
pub msgs: Vec<SubMsg<Empty>>, |
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.
Let's leave this as CosmosMsg
as well. No need to store all the execution parameters.
@@ -109,7 +109,7 @@ pub enum ExecuteMsg { | |||
Propose { | |||
title: String, | |||
description: String, | |||
msgs: Vec<CosmosMsg<Empty>>, | |||
msgs: Vec<SubMsg<Empty>>, |
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.
Here we can keep CosmosMsg
too. It can be wrapped when the message is actually executed.
@@ -31,7 +31,7 @@ pub struct Proposal { | |||
pub description: String, | |||
pub start_height: u64, | |||
pub expires: Expiration, | |||
pub msgs: Vec<CosmosMsg<Empty>>, | |||
pub msgs: Vec<SubMsg<Empty>>, |
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.
here too
contracts/cw4-stake/src/contract.rs
Outdated
let min_bond = Uint128::new(match msg.min_bond.u128() { | ||
0 => 1, | ||
v => v, | ||
}; | ||
}); |
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.
Can't we use let min_bond = std::cmp::max(msg.min_bond, Uint128::new(1));
instead?
packages/cw3/src/query.rs
Outdated
@@ -129,7 +129,7 @@ where | |||
pub id: u64, | |||
pub title: String, | |||
pub description: String, | |||
pub msgs: Vec<CosmosMsg<T>>, | |||
pub msgs: Vec<SubMsg<T>>, |
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.
This should be CosmosMsg
as well since the proposal can simply be CosmosMsg
packages/multi-test/src/app.rs
Outdated
@@ -26,7 +26,7 @@ where | |||
C: Clone + fmt::Debug + PartialEq + JsonSchema, | |||
{ | |||
// TODO: allow T != Empty | |||
pub messages: Vec<CosmosMsg<C>>, | |||
pub messages: Vec<SubMsg<C>>, |
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.
This can probably be changed to CosmosMsg
too.
Also, the comment above is outdated. We now have support for the custom type C
and the comment was forgotten in this commit: ca59a96
Thank you for handling this |
All contracts migrated to
0.15
.New cw-plus version is
0.7.0
.After merge cut we can cut new release.
Closes #298