Enum cosmwasm_std::WasmMsg[][src]

#[non_exhaustive]
pub enum WasmMsg {
    Execute {
        contract_addr: String,
        msg: Binary,
        funds: Vec<Coin>,
    },
    Instantiate {
        admin: Option<String>,
        code_id: u64,
        msg: Binary,
        funds: Vec<Coin>,
        label: String,
    },
    Migrate {
        contract_addr: String,
        new_code_id: u64,
        msg: Binary,
    },
    UpdateAdmin {
        contract_addr: String,
        admin: String,
    },
    ClearAdmin {
        contract_addr: String,
    },
}
Expand description

The message types of the wasm module.

See https://github.com/CosmWasm/wasmd/blob/v0.14.0/x/wasm/internal/types/tx.proto

Variants (Non-exhaustive)

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Execute

Dispatches a call to another contract at a known address (with known ABI).

This is translated to a MsgExecuteContract. sender is automatically filled with the current contract’s address.

Show fields

Fields of Execute

contract_addr: Stringmsg: Binary

msg is the json-encoded ExecuteMsg struct (as raw Binary)

funds: Vec<Coin>
Instantiate

Instantiates a new contracts from previously uploaded Wasm code.

This is translated to a MsgInstantiateContract. sender is automatically filled with the current contract’s address.

Show fields

Fields of Instantiate

admin: Option<String>code_id: u64msg: Binary

msg is the JSON-encoded InstantiateMsg struct (as raw Binary)

funds: Vec<Coin>label: String

A human-readbale label for the contract

Migrate

Migrates a given contracts to use new wasm code. Passes a MigrateMsg to allow us to customize behavior.

Only the contract admin (as defined in wasmd), if any, is able to make this call.

This is translated to a MsgMigrateContract. sender is automatically filled with the current contract’s address.

Show fields

Fields of Migrate

contract_addr: Stringnew_code_id: u64

the code_id of the new logic to place in the given contract

msg: Binary

msg is the json-encoded MigrateMsg struct that will be passed to the new code

UpdateAdmin

Sets a new admin (for migrate) on the given contract. Fails if this contract is not currently admin of the target contract.

Show fields

Fields of UpdateAdmin

contract_addr: Stringadmin: String
ClearAdmin

Clears the admin on the given contract, so no more migration possible. Fails if this contract is not currently admin of the target contract.

Show fields

Fields of ClearAdmin

contract_addr: String

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Performs the conversion.

The name of the generated JSON Schema. Read more

Generates a JSON Schema for this type. Read more

Whether JSON Schemas generated for this type should be re-used where possible using the $ref keyword. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Converts self into a target type. Read more

Causes self to use its Binary implementation when Debug-formatted.

Causes self to use its Display implementation when Debug-formatted. Read more

Causes self to use its LowerExp implementation when Debug-formatted. Read more

Causes self to use its LowerHex implementation when Debug-formatted. Read more

Causes self to use its Octal implementation when Debug-formatted.

Causes self to use its Pointer implementation when Debug-formatted. Read more

Causes self to use its UpperExp implementation when Debug-formatted. Read more

Causes self to use its UpperHex implementation when Debug-formatted. Read more

Performs the conversion.

Performs the conversion.

Pipes a value into a function that cannot ordinarily be called in suffix position. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait borrow into a function that cannot normally be called in suffix position. Read more

Pipes a trait mutable borrow into a function that cannot normally be called in suffix position. Read more

Pipes a dereference into a function that cannot normally be called in suffix position. Read more

Pipes a mutable dereference into a function that cannot normally be called in suffix position. Read more

Pipes a reference into a function that cannot ordinarily be called in suffix position. Read more

Pipes a mutable reference into a function that cannot ordinarily be called in suffix position. Read more

Should always be Self

Provides immutable access for inspection. Read more

Calls tap in debug builds, and does nothing in release builds.

Provides mutable access for modification. Read more

Calls tap_mut in debug builds, and does nothing in release builds.

Provides immutable access to the reference for inspection.

Calls tap_ref in debug builds, and does nothing in release builds.

Provides mutable access to the reference for modification.

Calls tap_ref_mut in debug builds, and does nothing in release builds.

Provides immutable access to the borrow for inspection. Read more

Calls tap_borrow in debug builds, and does nothing in release builds.

Provides mutable access to the borrow for modification.

Calls tap_borrow_mut in debug builds, and does nothing in release builds. Read more

Immutably dereferences self for inspection.

Calls tap_deref in debug builds, and does nothing in release builds.

Mutably dereferences self for modification.

Calls tap_deref_mut in debug builds, and does nothing in release builds. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

Attempts to convert self into a target type. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.