|
| 1 | +use crate::nibble_utils::Nibbles; |
1 | 2 | use crate::types::Byte; |
2 | 3 | use ethereum_types::H256; |
3 | | -use crate::nibble_utils::Nibbles; |
4 | 4 |
|
5 | 5 | pub const ZERO_BYTE: u8 = 0u8; |
6 | | -pub const HASH_LENGTH: usize = 32; |
7 | | -pub const HASH_HEX_CHARS: usize = 64; |
| 6 | +pub const HASH_LENGTH: usize = 32; |
| 7 | +pub const HASH_HEX_CHARS: usize = 64; |
8 | 8 | pub const HEX_PREFIX_LENGTH: usize = 2; |
9 | 9 | pub const NUM_BITS_IN_NIBBLE: usize = 4; |
10 | 10 | pub const REQWEST_TIMEOUT_TIME: u64 = 5; |
11 | 11 | pub const NUM_NIBBLES_IN_BYTE: usize = 2; |
12 | 12 | pub const HIGH_NIBBLE_MASK: Byte = 15u8; // NOTE: 15u8 == [0,0,0,0,1,1,1,1] |
13 | | -pub static DOT_ENV_PATH: &'static str = "./.env"; |
14 | | -pub static LOG_FILE_PATH: &'static str = "logs/"; |
15 | | -pub static LEAF_NODE_STRING: &'static str = "leaf"; |
16 | | -pub static BRANCH_NODE_STRING: &'static str = "branch"; |
17 | | -pub static EXTENSION_NODE_STRING: &'static str = "extension"; |
| 13 | +pub static DOT_ENV_PATH: &str = "./.env"; |
| 14 | +pub static LEAF_NODE_STRING: &str = "leaf"; |
| 15 | +pub static BRANCH_NODE_STRING: &str = "branch"; |
| 16 | +pub static EXTENSION_NODE_STRING: &str = "extension"; |
18 | 17 | pub const HASHED_NULL_NODE: H256 = H256(HASHED_NULL_NODE_BYTES); |
19 | | -pub static DEFAULT_ENDPOINT: &'static str = "http://localhost:8545/"; |
20 | | -pub const EMPTY_NIBBLES: Nibbles = Nibbles { data: Vec::new(), offset: 0 }; |
| 18 | +pub static DEFAULT_ENDPOINT: &str = "http://localhost:8545/"; |
| 19 | +pub const EMPTY_NIBBLES: Nibbles = Nibbles { |
| 20 | + data: Vec::new(), |
| 21 | + offset: 0, |
| 22 | +}; |
21 | 23 |
|
22 | | -const HASHED_NULL_NODE_BYTES: [u8; 32] = [ // NOTE: keccak hash of the RLP of null |
23 | | - 0x56, 0xe8, 0x1f, 0x17, 0x1b, 0xcc, 0x55, 0xa6, |
24 | | - 0xff, 0x83, 0x45, 0xe6, 0x92, 0xc0, 0xf8, 0x6e, |
25 | | - 0x5b, 0x48, 0xe0, 0x1b, 0x99, 0x6c, 0xad, 0xc0, |
26 | | - 0x01, 0x62, 0x2f, 0xb5, 0xe3, 0x63, 0xb4, 0x21 |
| 24 | +const HASHED_NULL_NODE_BYTES: [u8; 32] = [ |
| 25 | + // NOTE: keccak hash of the RLP of null |
| 26 | + 0x56, 0xe8, 0x1f, 0x17, 0x1b, 0xcc, 0x55, 0xa6, 0xff, 0x83, 0x45, 0xe6, 0x92, 0xc0, 0xf8, 0x6e, |
| 27 | + 0x5b, 0x48, 0xe0, 0x1b, 0x99, 0x6c, 0xad, 0xc0, 0x01, 0x62, 0x2f, 0xb5, 0xe3, 0x63, 0xb4, 0x21, |
27 | 28 | ]; |
0 commit comments