pub struct ContractResult<R, Balance> {
pub gas_consumed: Weight,
pub gas_required: Weight,
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: Weight
How much weight was consumed during execution.
gas_required: Weight
How much weight is required as gas limit in order to execute this call.
This value should be used to determine the weight 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§
source§impl<R, Balance> Decode for ContractResult<R, Balance>where
StorageDeposit<Balance>: Decode,
R: Decode,
impl<R, Balance> Decode for ContractResult<R, Balance>where
StorageDeposit<Balance>: Decode,
R: Decode,
source§impl<R, Balance> Encode for ContractResult<R, Balance>where
StorageDeposit<Balance>: Encode,
R: Encode,
impl<R, Balance> Encode for ContractResult<R, Balance>where
StorageDeposit<Balance>: Encode,
R: Encode,
source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
source§fn using_encoded<R, F>(&self, f: F) -> Rwhere
F: FnOnce(&[u8]) -> R,
fn using_encoded<R, F>(&self, f: F) -> Rwhere
F: FnOnce(&[u8]) -> R,
source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
source§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>
source§fn eq(&self, other: &ContractResult<R, Balance>) -> bool
fn eq(&self, other: &ContractResult<R, Balance>) -> bool
self
and other
values to be equal, and is used
by ==
.impl<R, Balance> EncodeLike<ContractResult<R, Balance>> for ContractResult<R, Balance>where
StorageDeposit<Balance>: Encode,
R: Encode,
impl<R: Eq, Balance: Eq> Eq for ContractResult<R, Balance>
impl<R, Balance> StructuralEq for ContractResult<R, Balance>
impl<R, Balance> StructuralPartialEq for ContractResult<R, Balance>
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§
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
source§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
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
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T
. Read more§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.