Function pallet_gear::pallet::dispatchables::create_program

source ·
pub fn create_program<T: Config>(
    code_id: CodeId,
    salt: Vec<u8>,
    init_payload: Vec<u8>,
    gas_limit: u64,
    value: <<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance,
    keep_alive: bool,
)
Expand description

Creates program via code_id from storage.

Parameters:

  • code_id: wasm code id in the code storage.
  • salt: randomness term (a seed) to allow programs with identical code to be created independently.
  • init_payload: encoded parameters of the wasm module init 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:

  • InitMessageEnqueued(MessageInfo) when init message is placed in the queue.

§NOTE

For the details of this extrinsic, see upload_code.

§Warning: Doc-Only

This function is an automatically generated, and is doc-only, uncallable stub. See the real version in Pallet::create_program.