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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
use ethereum_types::{Address, U256};
#[derive(Debug, Clone, Copy)]
pub struct Call {
pub sender: Address,
pub gas: U256,
pub gas_price: U256,
pub value: U256,
}
impl Call {
pub fn new(sender: Address) -> Self {
Self {
sender,
gas: 0.into(),
gas_price: 0.into(),
value: 0.into(),
}
}
pub fn sender<S: Into<Address>>(self, sender: S) -> Self {
Self {
sender: sender.into(),
..self
}
}
pub fn gas<E: Into<U256>>(self, gas: E) -> Self {
Self {
gas: gas.into(),
..self
}
}
pub fn gas_price<E: Into<U256>>(self, gas_price: E) -> Self {
Self {
gas_price: gas_price.into(),
..self
}
}
pub fn value<E: Into<U256>>(self, value: E) -> Self {
Self {
value: value.into(),
..self
}
}
}