Struct substreams_ethereum::pb::eth::v2::Call

source ·
pub struct Call {
Show 27 fields pub index: u32, pub parent_index: u32, pub depth: u32, pub call_type: i32, pub caller: Vec<u8>, pub address: Vec<u8>, pub value: Option<BigInt>, pub gas_limit: u64, pub gas_consumed: u64, pub return_data: Vec<u8>, pub input: Vec<u8>, pub executed_code: bool, pub suicide: bool, pub keccak_preimages: HashMap<String, String>, pub storage_changes: Vec<StorageChange>, pub balance_changes: Vec<BalanceChange>, pub nonce_changes: Vec<NonceChange>, pub logs: Vec<Log>, pub code_changes: Vec<CodeChange>, pub gas_changes: Vec<GasChange>, pub status_failed: bool, pub status_reverted: bool, pub failure_reason: String, pub state_reverted: bool, pub begin_ordinal: u64, pub end_ordinal: u64, pub account_creations: Vec<AccountCreation>,
}

Fields§

§index: u32§parent_index: u32§depth: u32§call_type: i32§caller: Vec<u8>§address: Vec<u8>§value: Option<BigInt>§gas_limit: u64§gas_consumed: u64§return_data: Vec<u8>§input: Vec<u8>§executed_code: bool§suicide: bool§keccak_preimages: HashMap<String, String>

hex representation of the hash -> preimage

§storage_changes: Vec<StorageChange>§balance_changes: Vec<BalanceChange>§nonce_changes: Vec<NonceChange>§logs: Vec<Log>§code_changes: Vec<CodeChange>§gas_changes: Vec<GasChange>§status_failed: bool

In Ethereum, a call can be either:

  • Successfull, execution passes without any problem encountered
  • Failed, execution failed, and remaining gas should be consumed
  • Reverted, execution failed, but only gas consumed so far is billed, remaining gas is refunded

When a call is either failed or reverted, the status_failed field below is set to true. If the status is reverted, then both status_failed and status_reverted are going to be set to true.

§status_reverted: bool§failure_reason: String

Populated when a call either failed or reverted, so when status_failed == true, see above for details about those flags.

§state_reverted: bool

This field represents wheter or not the state changes performed by this call were correctly recorded by the blockchain.

On Ethereum, a transaction can record state changes even if some of its inner nested calls failed. This is problematic however since a call will invalidate all its state changes as well as all state changes performed by its child call. This means that even if a call has a status of SUCCESS, the chain might have reverted all the state changes it performed.

   Trx 1
    Call #1 <Failed>
      Call #2 <Execution Success>
      Call #3 <Execution Success>
      |--- Failure here
    Call #4

In the transaction above, while Call #2 and Call #3 would have the status EXECUTED.

If you check all calls and check only state_reverted flag, you might be missing some balance changes and nonce changes. This is because when a full transaction fails in ethereum (e.g. calls.all(x.state_reverted == true)), there is still the transaction fee that are recorded to the chain.

Refer to [TransactionTrace#status] field for more details about the handling you must perform.

§begin_ordinal: u64

The block’s global ordinal when the call started executing, refer to [Block] documentation for further information about ordinals and total ordering.

§end_ordinal: u64

The block’s global ordinal when the call finished executing, refer to [Block] documentation for further information about ordinals and total ordering.

§account_creations: Vec<AccountCreation>

Implementations§

source§

impl Call

source

pub fn call_type(&self) -> CallType

Returns the enum value of call_type, or the default if the field is set to an invalid enum value.

source

pub fn set_call_type(&mut self, value: CallType)

Sets call_type to the provided enum value.

Trait Implementations§

source§

impl AsRef<Call> for Call

source§

fn as_ref(&self) -> &Call

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

impl AsRef<Call> for CallView<'_>

source§

fn as_ref(&self) -> &Call

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

impl Clone for Call

source§

fn clone(&self) -> Call

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Call

source§

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

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

impl Default for Call

source§

fn default() -> Call

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

impl Message for Call

source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
source§

fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, Self: Sized,

Encodes the message to a buffer. Read more
source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
source§

fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
source§

fn decode<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes an instance of the message from a buffer. Read more
source§

fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes a length-delimited instance of the message from the buffer.
source§

fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
source§

fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
source§

impl PartialEq for Call

source§

fn eq(&self, other: &Call) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for Call

Auto Trait Implementations§

§

impl Freeze for Call

§

impl RefUnwindSafe for Call

§

impl Send for Call

§

impl Sync for Call

§

impl Unpin for Call

§

impl UnwindSafe for Call

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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
source§

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

source§

fn vzip(self) -> V