Trait ink_lang::reflect::ContractDispatchableMessages
source · [−]Expand description
Reflects the sequence of all dispatchable ink! messages of the ink! smart contract.
Note
This is automatically implemented by all ink! smart contracts.
Usage
use ink_lang as ink;
#[ink::contract]
pub mod contract {
#[ink(storage)]
pub struct Contract {}
impl Contract {
#[ink(constructor)]
pub fn constructor1() -> Self { Contract {} }
#[ink(message, selector = 1234)]
pub fn message1(&self) {}
#[ink(message, selector = 0xC0DECAFE)]
pub fn message2(&self) {}
#[ink(message)]
pub fn message3(&self) {}
}
}
use contract::Contract;
fn main() {
assert_eq!(
<Contract as ContractDispatchableMessages<{
<Contract as ContractAmountDispatchables>::MESSAGES
}>>::IDS,
[1234, 0xC0DECAFE, selector_id!("message3")],
);
}