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
58
59
60
61
62
63
64
65
66
67
#[cfg(not(feature = "std"))]
use alloc::Vec;
#[cfg(not(feature = "std"))] use alloc::rc::Rc;
#[cfg(feature = "std")] use std::rc::Rc;
use bigint::{U256, Address, Gas};
#[cfg(feature = "std")]
use block::Header;
#[derive(Debug, Clone)]
pub struct HeaderParams {
pub beneficiary: Address,
pub timestamp: u64,
pub number: U256,
pub difficulty: U256,
pub gas_limit: Gas
}
#[cfg(feature = "std")]
impl<'a> From<&'a Header> for HeaderParams {
fn from(val: &'a Header) -> HeaderParams {
HeaderParams {
beneficiary: val.beneficiary,
timestamp: val.timestamp,
number: val.number,
difficulty: val.difficulty,
gas_limit: val.gas_limit,
}
}
}
#[derive(Debug, Clone)]
pub struct Context {
pub address: Address,
pub caller: Address,
pub code: Rc<Vec<u8>>,
pub data: Rc<Vec<u8>>,
pub gas_limit: Gas,
pub gas_price: Gas,
pub origin: Address,
pub value: U256,
pub apprent_value: U256,
pub is_system: bool,
}
pub use block_core::Log;