[][src]Struct solana_libra_language_e2e_tests::data_store::FakeDataStore

pub struct FakeDataStore { /* fields omitted */ }

An in-memory implementation of [StateView] and [RemoteCache] for the VM.

Tests use this to set up state, and pass in a reference to the cache whenever a StateView or RemoteCache is needed.

Methods

impl FakeDataStore[src]

pub fn new(data: HashMap<AccessPath, Vec<u8>>) -> Self[src]

Creates a new FakeDataStore with the provided initial data.

pub fn add_write_set(&mut self, write_set: &WriteSet)[src]

Adds a [WriteSet] to this data store.

pub fn set(
    &mut self,
    access_path: AccessPath,
    data_blob: Vec<u8>
) -> Option<Vec<u8>>
[src]

Sets a (key, value) pair within this data store.

Returns the previous data if the key was occupied.

pub fn remove(&mut self, access_path: &AccessPath) -> Option<Vec<u8>>[src]

Deletes a key from this data store.

Returns the previous data if the key was occupied.

pub fn add_account_data(&mut self, account_data: &AccountData)[src]

Adds an AccountData to this data store.

pub fn add_module(&mut self, module_id: &ModuleId, module: &CompiledModule)[src]

Adds a [CompiledModule] to this data store.

Does not do any sort of verification on the module.

Trait Implementations

impl Default for FakeDataStore[src]

impl Debug for FakeDataStore[src]

impl StateView for FakeDataStore[src]

impl RemoteCache for FakeDataStore[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Clear for T where
    T: InitializableFromZeroed + ?Sized

impl<T> InitializableFromZeroed for T where
    T: Default

impl<T> Same<T> for T

type Output = T

Should always be Self

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

impl<T> Erased for T

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized

impl<T> Erased for T

impl<T> Typeable for T where
    T: Any

fn get_type(&self) -> TypeId

Get the TypeId of this object.