pub struct MemoryClient { /* private fields */ }
Expand description

Client implementation with in-memory storage backend.

Implementations§

source§

impl MemoryClient

source

pub fn new( storage: MemoryStorage, params: ConsensusParameters, gas_costs: GasCosts ) -> Self

Create a new instance of the memory client out of a provided storage.

source

pub fn from_txtor(transactor: Transactor<MemoryStorage, Script>) -> Self

Create a new instance of the memory client out of a provided storage.

source

pub fn backtrace(&self) -> Option<Backtrace>

If a transaction was executed and produced a VM panic, returns the backtrace; return None otherwise.

source

pub fn receipts(&self) -> Option<&[Receipt]>

If a transaction was successfully executed, returns the produced receipts; return None otherwise.

source

pub fn state_transition(&self) -> Option<StateTransitionRef<'_, Script>>

State transition representation after the execution of a transaction.

source

pub fn deploy(&mut self, tx: Checked<Create>) -> Option<Create>

Deploys a Create transaction.

source

pub fn transact(&mut self, tx: Checked<Script>) -> &[Receipt]

Execute a transaction.

Since the memory storage is Infallible, associatively, the memory client should also be.

source

pub fn persist(&mut self)

Persist the changes caused by Self::transact.

source

pub const fn params(&self) -> &ConsensusParameters

Consensus parameters

source

pub const fn tx_offset(&self) -> usize

Tx memory offset

source

pub fn gas_costs(&self) -> &GasCosts

Gas costs for opcodes

Trait Implementations§

source§

impl AsMut<MemoryStorage> for MemoryClient

source§

fn as_mut(&mut self) -> &mut MemoryStorage

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl AsRef<MemoryStorage> for MemoryClient

source§

fn as_ref(&self) -> &MemoryStorage

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Debug for MemoryClient

source§

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

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

impl Default for MemoryClient

source§

fn default() -> MemoryClient

Returns the “default value” for a type. Read more
source§

impl From<MemoryClient> for Transactor<MemoryStorage, Script>

source§

fn from(client: MemoryClient) -> Self

Converts to this type from the input type.
source§

impl From<MemoryStorage> for MemoryClient

source§

fn from(s: MemoryStorage) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> AnyDebug for Twhere T: Any + Debug,

source§

fn as_any_ref(&self) -> &(dyn Any + 'static)

Returns a reference to the underlying type as Any.
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. 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 Twhere 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> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> StorageAsMut for T

source§

fn storage<Type>(&mut self) -> StorageMut<'_, Self, Type>where Type: Mappable,

source§

fn storage_as_mut<Type>(&mut self) -> StorageMut<'_, Self, Type>where Type: Mappable,

source§

impl<T> StorageAsRef for T

source§

fn storage<Type>(&self) -> StorageRef<'_, Self, Type>where Type: Mappable,

source§

fn storage_as_ref<Type>(&self) -> StorageRef<'_, Self, Type>where Type: Mappable,

source§

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

§

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 Twhere U: TryFrom<T>,

§

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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V