revm_interpreter/interpreter/
input.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use crate::interpreter_types::InputsTrait;
use primitives::{Address, Bytes, U256};
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};

#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
pub struct InputsImpl {
    pub target_address: Address,
    pub caller_address: Address,
    pub input: Bytes,
    pub call_value: U256,
}

impl InputsTrait for InputsImpl {
    fn target_address(&self) -> Address {
        self.target_address
    }

    fn caller_address(&self) -> Address {
        self.caller_address
    }

    fn input(&self) -> &[u8] {
        &self.input
    }

    fn call_value(&self) -> U256 {
        self.call_value
    }
}