-
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.
chore: add common crate for project wide definitions (#500)
* chore: add common crate for project wide definitions * fix: labeling * fix: review * fix: nitpick
- Loading branch information
Showing
9 changed files
with
69 additions
and
19 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[package] | ||
name = "zk_evm_common" | ||
version = "0.1.0" | ||
edition.workspace = true | ||
license.workspace = true | ||
repository.workspace = true | ||
homepage.workspace = true | ||
keywords.workspace = true | ||
categories.workspace = true | ||
|
||
[dependencies] | ||
ethereum-types = { workspace = true } | ||
keccak-hash = { workspace = true } | ||
|
||
[dev-dependencies] | ||
bytes = { workspace = true } | ||
rlp = { workspace = true } |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use ethereum_types::H256; | ||
|
||
/// The hash value of an 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 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_empty_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)) | ||
); | ||
} |
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
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