-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
23 additions
and
2 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,28 @@ | ||
use ethereum_types::H256; | ||
|
||
/// Empty code hash value | ||
/// Hash value of account empty EVM code. | ||
/// 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 | ||
pub const EMPTY_CODE_HASH: H256 = H256([ | ||
197, 210, 70, 1, 134, 247, 35, 60, 146, 126, 125, 178, 220, 199, 3, 192, 229, 0, 182, 83, 202, | ||
130, 39, 59, 123, 250, 216, 4, 93, 133, 164, 112, | ||
]); | ||
|
||
/// The hash of an empty trie. | ||
/// The hash of an empty Merkle Patricia trie. | ||
/// 0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421 | ||
pub const EMPTY_TRIE_HASH: H256 = H256([ | ||
86, 232, 31, 23, 27, 204, 85, 166, 255, 131, 69, 230, 146, 192, 248, 110, 91, 72, 224, 27, 153, | ||
108, 173, 192, 1, 98, 47, 181, 227, 99, 180, 33, | ||
]); | ||
|
||
#[test] | ||
fn test_code_hash() { | ||
assert_eq!(EMPTY_CODE_HASH, keccak_hash::keccak([])); | ||
} | ||
|
||
#[test] | ||
fn test_empty_trie_hash() { | ||
assert_eq!( | ||
EMPTY_TRIE_HASH, | ||
keccak_hash::keccak(bytes::Bytes::from_static(&rlp::NULL_RLP)) | ||
); | ||
} |