pub struct CallContext {
    pub is_view_call: bool,
    pub from: Address,
    pub to: Address,
    pub nonce: U256,
    pub gas: U256,
    pub gas_price: U256,
    pub value: U256,
}
Expand description

Information about method call that’s being processed.

Fields§

§is_view_call: bool

If true, this is a view call, otherwise this is a transaction.

§from: Address

Account that issued a view call or a transaction.

Can be zero in case of a view call.

§to: Address

Address of the current contract.

§nonce: U256

Current nonce of the account that issued a view call or a transaction.

§gas: U256

Maximum gas amount that this operation is allowed to spend.

Mock node does not simulate gas consumption, so this value does not affect anything if you don’t check it in your test code.

§gas_price: U256

Gas price for this view call or transaction.

Mock node does not simulate gas consumption, so this value does not affect anything if you don’t check it in your test code.

§value: U256

Amount of ETH that’s transferred with the call.

This value is only non-zero if the method is payable.

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
§

impl<T> Any for Twhere T: Any,

§

fn into_any(self: Box<T, Global>) -> Box<dyn Any, Global>

§

fn into_any_rc(self: Rc<T, Global>) -> Rc<dyn Any, Global>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for Twhere T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T, Global>) -> Arc<dyn Any + Sync + Send, Global>

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