[−][src]Struct solana_libra_language_e2e_tests::data_store::FakeDataStore
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]
&mut self,
access_path: AccessPath,
data_blob: Vec<u8>
) -> Option<Vec<u8>>
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]
fn default() -> FakeDataStore
[src]
impl Debug for FakeDataStore
[src]
impl StateView for FakeDataStore
[src]
fn get(&self, access_path: &AccessPath) -> Result<Option<Vec<u8>>>
[src]
fn multi_get(
&self,
_access_paths: &[AccessPath]
) -> Result<Vec<Option<Vec<u8>>>>
[src]
&self,
_access_paths: &[AccessPath]
) -> Result<Vec<Option<Vec<u8>>>>
fn is_genesis(&self) -> bool
[src]
impl RemoteCache for FakeDataStore
[src]
Auto Trait Implementations
impl Sync for FakeDataStore
impl Send for FakeDataStore
impl Unpin for FakeDataStore
impl RefUnwindSafe for FakeDataStore
impl UnwindSafe for FakeDataStore
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Clear for T where
T: InitializableFromZeroed + ?Sized,
T: InitializableFromZeroed + ?Sized,
fn clear(&mut self)
impl<T> InitializableFromZeroed for T where
T: Default,
T: Default,
unsafe fn initialize(place: *mut T)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
fn vzip(self) -> V
impl<T> Erased for T
impl<T> SendSyncUnwindSafe for T where
T: Send + Sync + UnwindSafe + ?Sized,
T: Send + Sync + UnwindSafe + ?Sized,
impl<T> Erased for T
impl<T> Typeable for T where
T: Any,
T: Any,