Function pallet_gear::pallet::dispatchables::send_message
source · pub fn send_message<T: Config>(
destination: ProgramId,
payload: Vec<u8>,
gas_limit: u64,
value: <<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance,
keep_alive: bool,
)
Expand description
Sends a message to a program or to another account.
The origin must be Signed and the sender must have sufficient funds to pay
for gas
and value
(in case the latter is being transferred).
To avoid an undefined behavior a check is made that the destination address is not a program in uninitialized state. If the opposite holds true, the message is not enqueued for processing.
Parameters:
destination
: the message destination.payload
: in case of a program destination, parameters of thehandle
function.gas_limit
: maximum amount of gas the program can spend before it is halted.value
: balance to be transferred to the program once it’s been created.
Emits the following events:
DispatchMessageEnqueued(MessageInfo)
when dispatch message is placed in the queue.
§Warning: Doc-Only
This function is an automatically generated, and is doc-only, uncallable
stub. See the real version in
Pallet::send_message
.