Struct zksync_vm2::testonly::TestWorld

source ·
pub struct TestWorld<T> { /* private fields */ }
Expand description

Test World implementation.

Implementations§

source§

impl<T: Tracer> TestWorld<T>

source

pub fn new(contracts: &[(Address, Program<T, Self>)]) -> Self

Creates a test world with the provided programs.

§Panics

Panics if the provided Programs are malformed.

Trait Implementations§

source§

impl<T: Debug> Debug for TestWorld<T>

source§

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

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

impl<T> StorageInterface for TestWorld<T>

source§

fn read_storage(&mut self, contract: H160, key: U256) -> StorageSlot

Reads the specified slot from the storage. Read more
source§

fn cost_of_writing_storage( &mut self, _initial_slot: StorageSlot, _new_value: U256, ) -> u32

Computes the cost of writing a storage slot.
source§

fn is_free_storage_slot(&self, _contract: &H160, _key: &U256) -> bool

Returns if the storage slot is free both in terms of gas and pubdata.
source§

fn read_storage_value(&mut self, contract: H160, key: U256) -> U256

Same as Self::read_storage(), but doesn’t request the initialness flag for the read slot. Read more
source§

impl<T: Tracer> World<T> for TestWorld<T>

source§

fn decommit(&mut self, hash: U256) -> Program<T, Self>

Loads a bytecode with the specified hash. Read more
source§

fn decommit_code(&mut self, hash: U256) -> Vec<u8>

Loads bytecode bytes for the decommit opcode.

Auto Trait Implementations§

§

impl<T> Freeze for TestWorld<T>

§

impl<T> RefUnwindSafe for TestWorld<T>

§

impl<T> Send for TestWorld<T>

§

impl<T> Sync for TestWorld<T>

§

impl<T> Unpin for TestWorld<T>

§

impl<T> UnwindSafe for TestWorld<T>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where 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 T
where 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 T
where V: MultiLane<T>,

§

fn vzip(self) -> V