pub struct ContractResult<R, Balance> {
pub gas_consumed: u64,
pub gas_required: u64,
pub storage_deposit: StorageDeposit<Balance>,
pub debug_message: Vec<u8>,
pub result: R,
}
Expand description
Result type of a bare_call
or bare_instantiate
call.
It contains the execution result together with some auxiliary information.
Fields
gas_consumed: u64
How much gas was consumed during execution.
gas_required: u64
How much gas is required as gas limit in order to execute this call.
This value should be used to determine the gas limit for on-chain execution.
Note
This can only different from Self::gas_consumed
when weight pre charging
is used. Currently, only seal_call_runtime
makes use of pre charging.
Additionally, any seal_call
or seal_instantiate
makes use of pre-charging
when a non-zero gas_limit
argument is supplied.
storage_deposit: StorageDeposit<Balance>
How much balance was deposited and reserved during execution in order to pay for storage.
The storage deposit is never actually charged from the caller in case of Self::result
is Err
. This is because on error all storage changes are rolled back.
debug_message: Vec<u8>
An optional debug message. This message is only filled when explicitly requested by the code that calls into the contract. Otherwise it is empty.
The contained bytes are valid UTF-8. This is not declared as String
because
this type is not allowed within the runtime.
Clients should not make any assumptions about the format of the buffer. They should just display it as-is. It is not only a collection of log lines provided by a contract but a formatted buffer with different sections.
Note
The debug message is never generated during on-chain execution. It is reserved for RPC calls.
result: R
The execution result of the wasm code.
Trait Implementations
impl<R, Balance> Decode for ContractResult<R, Balance> where
StorageDeposit<Balance>: Decode,
StorageDeposit<Balance>: Decode,
R: Decode,
R: Decode,
impl<R, Balance> Decode for ContractResult<R, Balance> where
StorageDeposit<Balance>: Decode,
StorageDeposit<Balance>: Decode,
R: Decode,
R: Decode,
impl<'de, R, Balance> Deserialize<'de> for ContractResult<R, Balance> where
R: Deserialize<'de>,
Balance: TryFrom<NumberOrHex>,
impl<'de, R, Balance> Deserialize<'de> for ContractResult<R, Balance> where
R: Deserialize<'de>,
Balance: TryFrom<NumberOrHex>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<R, Balance> Encode for ContractResult<R, Balance> where
StorageDeposit<Balance>: Encode,
StorageDeposit<Balance>: Encode,
R: Encode,
R: Encode,
impl<R, Balance> Encode for ContractResult<R, Balance> where
StorageDeposit<Balance>: Encode,
StorageDeposit<Balance>: Encode,
R: Encode,
R: Encode,
impl<R: PartialEq, Balance: PartialEq> PartialEq<ContractResult<R, Balance>> for ContractResult<R, Balance>
impl<R: PartialEq, Balance: PartialEq> PartialEq<ContractResult<R, Balance>> for ContractResult<R, Balance>
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
impl<R, Balance> Serialize for ContractResult<R, Balance> where
R: Serialize,
Balance: Copy + Into<NumberOrHex>,
impl<R, Balance> Serialize for ContractResult<R, Balance> where
R: Serialize,
Balance: Copy + Into<NumberOrHex>,
impl<R, Balance> EncodeLike<ContractResult<R, Balance>> for ContractResult<R, Balance> where
StorageDeposit<Balance>: Encode,
StorageDeposit<Balance>: Encode,
R: Encode,
R: Encode,
Auto Trait Implementations
impl<R, Balance> RefUnwindSafe for ContractResult<R, Balance> where
Balance: RefUnwindSafe,
R: RefUnwindSafe,
impl<R, Balance> Send for ContractResult<R, Balance> where
Balance: Send,
R: Send,
impl<R, Balance> Sync for ContractResult<R, Balance> where
Balance: Sync,
R: Sync,
impl<R, Balance> Unpin for ContractResult<R, Balance> where
Balance: Unpin,
R: Unpin,
impl<R, Balance> UnwindSafe for ContractResult<R, Balance> where
Balance: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>ⓘimpl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>ⓘimpl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;
impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
fn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
Convert from a value of T
into an equivalent instance of Self
. Read more
fn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of T
. Read more
The counterpart to unchecked_from
.
pub fn unique_saturated_into(self) -> T
pub fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of T
.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more