Enum Instruction

Source
pub enum Instruction {
Show 17 variants CreateService { code_hash: CodeHash, code_len: u64, min_item_gas: UnsignedGas, min_memo_gas: UnsignedGas, endowment: Balance, memo: Memo, }, Upgrade { code_hash: CodeHash, min_item_gas: UnsignedGas, min_memo_gas: UnsignedGas, }, Transfer { destination: ServiceId, amount: Balance, gas_limit: UnsignedGas, memo: Memo, }, Zombify { ejector: ServiceId, }, Eject { target: ServiceId, code_hash: CodeHash, }, DeleteItems { storage_items: Vec<Vec<u8>>, }, Solicit { hash: AnyHash, len: u64, }, Forget { hash: AnyHash, len: u64, }, Lookup { service: ServiceId, hash: AnyHash, }, Import { items: Vec<(u64, u64)>, }, Export { data: Vec<Vec<u8>>, }, Bless { manager: ServiceId, assign: ServiceId, designate: ServiceId, auto_acc: Vec<(ServiceId, UnsignedGas)>, }, Assign { core: CoreIndex, queue: AuthQueue, }, Designate { keys: OpaqueValKeysets, }, Yield { hash: Hash, }, Checkpoint, Panic, // some variants omitted
}
Expand description

Bootstrap service instruction.

Used to form the work item payload for the JAM Bootstrap service.

Variants§

§

CreateService

Create a new service.

Fields

§code_hash: CodeHash

Hash of the code of the new service.

§code_len: u64

Length of the code of the new service.

§min_item_gas: UnsignedGas

Minimum gas required for each work-item to be accumulated.

§min_memo_gas: UnsignedGas

Minimum gas required for each incoming transfer.

§endowment: Balance

The balance to be transferred to the new service.

§memo: Memo

The memo to be attached to the transfer.

§

Upgrade

Upgrade the code of the Bootstrap service.

Fields

§code_hash: CodeHash

Hash of the code to be upgraded. This must already be in the service’s preimage store.

§min_item_gas: UnsignedGas

Minimum gas required for each work-item to be accumulated.

§min_memo_gas: UnsignedGas

Minimum gas required for each incoming transfer.

§

Transfer

Transfer funds to another service.

Fields

§destination: ServiceId

The destination service.

§amount: Balance

The amount to be transferred.

§gas_limit: UnsignedGas

The amount of gas for the processing of the transfer by the destination service.

§memo: Memo

The memo to give the destination service for the transfer.

§

Zombify

Turn the current service into a zombie.

Fields

§ejector: ServiceId

The service which will be able to eject the zombie.

§

Eject

Destroy a zombie service with this as its ejector.

Fields

§target: ServiceId

The target service. This must have empty storage and exactly one preimage, whose hash is code_hash and which must be unrequested and droppable.

§code_hash: CodeHash

The code hash of the target service, which should be unrequested and droppable.

§

DeleteItems

Delete some items from the storage of the service.

Fields

§storage_items: Vec<Vec<u8>>

List of keys to be deleted.

§

Solicit

Request that preimage data be placed in the service’s preimage store.

Fields

§hash: AnyHash

The hash of the data to solicit.

§len: u64

The length of the data to solicit.

§

Forget

Revoke request that preimage data be placed in the service’s preimage store or drop preimage data once they have sat without request for sufficiently long.

Fields

§hash: AnyHash

The hash of the previously requested data.

§len: u64

The length of the previously requested data.

§

Lookup

Look up preimage data.

Fields

§service: ServiceId

Service ID which has the preimage data in its preimage store.

§hash: AnyHash

The hash of the data.

§

Import

Import segments from the JAM D3L.

Fields

§items: Vec<(u64, u64)>

The index and length pairs of each of the segments to be imported.

§

Export

Export segments to the JAM D3L.

Fields

§data: Vec<Vec<u8>>

The blobs of data to be exported.

§

Bless

Reset the JAM privileged services.

Fields

§manager: ServiceId

The manager service ID.

§assign: ServiceId

The assigner service ID.

§designate: ServiceId

The designator service ID.

§auto_acc: Vec<(ServiceId, UnsignedGas)>

The auto-accumulator service IDs, together with the baseline gas they get.

§

Assign

Assign the queue of a core.

Fields

§core: CoreIndex

The index of the core to be assigned.

§queue: AuthQueue

The authorization queue to assign.

§

Designate

Designate the new validator key set.

Fields

§keys: OpaqueValKeysets

The keys of the new validator set.

§

Yield

Specify a value for accumulate to return.

Fields

§hash: Hash

The hash to be yielded.

§

Checkpoint

Checkpoint the accumulation state.

§

Panic

Panic.

Trait Implementations§

Source§

impl Debug for Instruction

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Decode for Instruction

Source§

fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy, ) -> Result<Self, Error>

Attempt to deserialise the value from input.
Source§

fn decode_into<I>( input: &mut I, dst: &mut MaybeUninit<Self>, ) -> Result<DecodeFinished, Error>
where I: Input,

Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
Source§

fn skip<I>(input: &mut I) -> Result<(), Error>
where I: Input,

Attempt to skip the encoded value from input. Read more
Source§

fn encoded_fixed_size() -> Option<usize>

Returns the fixed encoded size of the type. Read more
Source§

impl Encode for Instruction

Source§

fn size_hint(&self) -> usize

If possible give a hint of expected size of the encoding. Read more
Source§

fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy, )

Convert self to a slice and append it to the destination.
Source§

fn encode(&self) -> Vec<u8>

Convert self to an owned vector.
Source§

fn using_encoded<R, F>(&self, f: F) -> R
where F: FnOnce(&[u8]) -> R,

Convert self to a slice and then invoke the given closure with it.
Source§

fn encoded_size(&self) -> usize

Calculates the encoded size. Read more
Source§

impl From<Instruction> for WorkPayload

Source§

fn from(i: Instruction) -> Self

Converts to this type from the input type.
Source§

impl EncodeLike for Instruction

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> DecodeAll for T
where T: Decode,

Source§

fn decode_all(input: &mut &[u8]) -> Result<T, Error>

Decode Self and consume all of the given input data. Read more
Source§

impl<T> DecodeLimit for T
where T: Decode,

Source§

fn decode_all_with_depth_limit( limit: u32, input: &mut &[u8], ) -> Result<T, Error>

Decode Self and consume all of the given input data. Read more
Source§

fn decode_with_depth_limit<I>(limit: u32, input: &mut I) -> Result<T, Error>
where I: Input,

Decode Self with the given maximum recursion depth and advance input by the number of bytes consumed. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> KeyedVec for T
where T: Codec,

Source§

fn to_keyed_vec(&self, prepend_key: &[u8]) -> Vec<u8>

Return an encoding of Self prepended by given slice.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S> Codec for S
where S: Decode + Encode,

Source§

impl<T> EncodeLike<&&T> for T
where T: Encode,

Source§

impl<T> EncodeLike<&T> for T
where T: Encode,

Source§

impl<T> EncodeLike<&mut T> for T
where T: Encode,

Source§

impl<T> EncodeLike<Arc<T>> for T
where T: Encode,

Source§

impl<T> EncodeLike<Box<T>> for T
where T: Encode,

Source§

impl<T> EncodeLike<Rc<T>> for T
where T: Encode,

Source§

impl<S> FullCodec for S
where S: Decode + FullEncode,

Source§

impl<S> FullEncode for S
where S: Encode + EncodeLike,

Source§

impl<T> JsonSchemaMaybe for T