-
Notifications
You must be signed in to change notification settings - Fork 564
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: extract statetest models/structs to standalone crate (#1808)
* feat: split test models to statetest-tests * chore: attempt documentation * Update Cargo.toml * Update Cargo.toml ---------
- Loading branch information
1 parent
411d0ef
commit ca5b2fe
Showing
19 changed files
with
277 additions
and
200 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
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,5 +1,4 @@ | ||
pub mod merkle_trie; | ||
pub mod models; | ||
mod runner; | ||
pub mod utils; | ||
|
||
|
This file was deleted.
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
Empty file.
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 @@ | ||
[package] | ||
name = "revm-statetest-types" | ||
description = "State test types for revm" | ||
version = "1.0.0" | ||
authors.workspace = true | ||
edition.workspace = true | ||
keywords.workspace = true | ||
license.workspace = true | ||
repository.workspace = true | ||
readme.workspace = true | ||
|
||
[package.metadata.docs.rs] | ||
all-features = true | ||
rustdoc-args = ["--cfg", "docsrs"] | ||
|
||
[lints.rust] | ||
unreachable_pub = "warn" | ||
unused_must_use = "deny" | ||
rust_2018_idioms = "deny" | ||
|
||
[lints.rustdoc] | ||
all = "warn" | ||
|
||
[dependencies] | ||
# revm | ||
revm = { workspace = true, features = ["std", "serde"] } | ||
serde = { version = "1.0", features = ["derive", "rc"] } | ||
serde_json = { version = "1.0", features = ["preserve_order"] } |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2021-2024 draganrakita | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,15 @@ | ||
use revm::primitives::{Bytes, HashMap, U256}; | ||
use serde::Deserialize; | ||
|
||
use crate::deserializer::deserialize_str_as_u64; | ||
|
||
/// Account information. | ||
#[derive(Clone, Debug, PartialEq, Eq, Deserialize)] | ||
#[serde(rename_all = "camelCase", deny_unknown_fields)] | ||
pub struct AccountInfo { | ||
pub balance: U256, | ||
pub code: Bytes, | ||
#[serde(deserialize_with = "deserialize_str_as_u64")] | ||
pub nonce: u64, | ||
pub storage: HashMap<U256, U256>, | ||
} |
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,24 @@ | ||
use revm::primitives::{Address, B256, U256}; | ||
use serde::Deserialize; | ||
|
||
/// Environment variables. | ||
#[derive(Debug, PartialEq, Eq, Deserialize)] | ||
#[serde(rename_all = "camelCase", deny_unknown_fields)] | ||
pub struct Env { | ||
pub current_coinbase: Address, | ||
#[serde(default)] | ||
pub current_difficulty: U256, | ||
pub current_gas_limit: U256, | ||
pub current_number: U256, | ||
pub current_timestamp: U256, | ||
pub current_base_fee: Option<U256>, | ||
pub previous_hash: Option<B256>, | ||
|
||
pub current_random: Option<B256>, | ||
pub current_beacon_root: Option<B256>, | ||
pub current_withdrawals_root: Option<B256>, | ||
|
||
pub parent_blob_gas_used: Option<U256>, | ||
pub parent_excess_blob_gas: Option<U256>, | ||
pub current_excess_blob_gas: Option<U256>, | ||
} |
Oops, something went wrong.