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

Migrate contracts to 0.15.0 #318

Merged
merged 44 commits into from
Jul 6, 2021
Merged

Migrate contracts to 0.15.0 #318

merged 44 commits into from
Jul 6, 2021

Conversation

orkunkl
Copy link
Contributor

@orkunkl orkunkl commented Jun 30, 2021

All contracts migrated to 0.15.
New cw-plus version is 0.7.0.
After merge cut we can cut new release.

Closes #298

contracts/cw1-subkeys/src/msg.rs Outdated Show resolved Hide resolved
contracts/cw1-whitelist/src/msg.rs Outdated Show resolved Hide resolved
contracts/cw20-bonding/src/curves.rs Show resolved Hide resolved
contracts/cw3-fixed-multisig/src/msg.rs Outdated Show resolved Hide resolved
messages: vec![],
attributes: vec![
attr("action", "set_permissions"),
attr("owner", info.sender),
attr("spender", spender),
attr("permissions", perm),
],
events: vec![],
Copy link
Member

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.

contracts/cw20-bonding/src/curves.rs Show resolved Hide resolved
msgs: vec![execute_mint_msg.into()],
msgs: vec![CosmosMsg::Wasm(execute_mint_msg)],
Copy link
Member

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>>,
Copy link
Member

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>>,
Copy link
Member

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>>,
Copy link
Member

Choose a reason for hiding this comment

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

here too

Comment on lines 39 to 42
let min_bond = Uint128::new(match msg.min_bond.u128() {
0 => 1,
v => v,
};
});
Copy link
Member

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?

@@ -129,7 +129,7 @@ where
pub id: u64,
pub title: String,
pub description: String,
pub msgs: Vec<CosmosMsg<T>>,
pub msgs: Vec<SubMsg<T>>,
Copy link
Member

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

@@ -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>>,
Copy link
Member

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

@uint uint requested a review from webmaster128 July 6, 2021 14:19
@webmaster128 webmaster128 merged commit 2db7cd9 into main Jul 6, 2021
@webmaster128 webmaster128 deleted the v0.7.x branch July 6, 2021 22:12
@ethanfrey
Copy link
Member

Thank you for handling this

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.

Upgrade to CosmWasm 0.15
4 participants