Skip to content

Commit

Permalink
Merge pull request #250 from CosmWasm/HandleMsg-to-ExecuteMsg
Browse files Browse the repository at this point in the history
Handle msg to execute msg
  • Loading branch information
ethanfrey authored Mar 29, 2021
2 parents 34504b0 + fe07daf commit 97b26e9
Show file tree
Hide file tree
Showing 103 changed files with 514 additions and 510 deletions.
6 changes: 3 additions & 3 deletions PATTERNS.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub struct InitMsg {
}

// dispatch (like cw20 send), the callback contract
// must support a superset of this in HandleMsg
// must support a superset of this in ExecuteMsg
pub enum CallbackMsg {
Instantiated{
contract: HumanAddr,
Expand Down Expand Up @@ -83,7 +83,7 @@ pub fn init(deps: DepsMut,
messages.push(wasm.into())
}

Ok(HandleResponse{
Ok(Response{
messages,
})
}
Expand Down Expand Up @@ -139,7 +139,7 @@ while a proposal is open.
* [Definition of the hooks in cw4 spec](https://github.com/CosmWasm/cosmwasm-plus/blob/c5e8fc92c0412fecd6cdd951c2c0261aa3c9445a/packages/cw4/src/hook.rs)
* [Adding/removing hooks](https://github.com/CosmWasm/cosmwasm-plus/blob/11400ddcc18d56961b0592a655e3da9cba7fd5d8/contracts/cw4-group/src/contract.rs#L156-L190) - which may be refactored into common code
* [Dispatching updates to all registered hooks](https://github.com/CosmWasm/cosmwasm-plus/blob/11400ddcc18d56961b0592a655e3da9cba7fd5d8/contracts/cw4-group/src/contract.rs#L91-L98)
* [`cw3-flex-multisig` registers HandleMsg variant](https://github.com/CosmWasm/cosmwasm-plus/blob/db560558c901a2bda933d035dbbc30321c3c66ff/contracts/cw3-flex-multisig/src/msg.rs#L38-L39)
* [`cw3-flex-multisig` registers ExecuteMsg variant](https://github.com/CosmWasm/cosmwasm-plus/blob/0e58f7ebc24c8a16d27e04a0507bac2e11489d0b/contracts/cw3-flex-multisig/src/msg.rs#L126-L127)
* [`cw3-flex-multisig` updates state based on the hook](https://github.com/CosmWasm/cosmwasm-plus/blob/61f436c2203bde7770d9b13724e6548ba26615e7/contracts/cw3-flex-multisig/src/contract.rs#L276-L309)

### Listeners
Expand Down
2 changes: 1 addition & 1 deletion contracts/cw1-subkeys/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ on creation, it can be setup with `SetupPermission` message.
This adds 2 messages beyond the `cw1` spec:

```rust
enum HandleMsg {
enum ExecuteMsg {
IncreaseAllowance {
spender: HumanAddr,
denom: String,
Expand Down
4 changes: 2 additions & 2 deletions contracts/cw1-subkeys/examples/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::fs::create_dir_all;

use cosmwasm_schema::{export_schema, export_schema_with_title, remove_schemas, schema_for};

use cw1_subkeys::msg::{AllAllowancesResponse, HandleMsg, QueryMsg};
use cw1_subkeys::msg::{AllAllowancesResponse, ExecuteMsg, QueryMsg};
use cw1_subkeys::state::Allowance;
use cw1_whitelist::msg::{AdminListResponse, InstantiateMsg};

Expand All @@ -14,7 +14,7 @@ fn main() {
remove_schemas(&out_dir).unwrap();

export_schema(&schema_for!(InstantiateMsg), &out_dir);
export_schema_with_title(&mut schema_for!(HandleMsg), &out_dir, "HandleMsg");
export_schema_with_title(&mut schema_for!(ExecuteMsg), &out_dir, "ExecuteMsg");
export_schema_with_title(&mut schema_for!(QueryMsg), &out_dir, "QueryMsg");
export_schema(&schema_for!(Allowance), &out_dir);
export_schema(&schema_for!(AdminListResponse), &out_dir);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "HandleMsg",
"title": "ExecuteMsg",
"anyOf": [
{
"description": "Execute requests the contract to re-dispatch all these messages with the contract's address as sender. Every implementation has it's own logic to determine in",
Expand Down
Loading

0 comments on commit 97b26e9

Please sign in to comment.