-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into agustin-mcopy-instr…
…uction
- Loading branch information
Showing
56 changed files
with
669 additions
and
1,064 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,15 @@ | ||
[workspace] | ||
members = [ | ||
"interpreter", | ||
"jsontests", | ||
"precompile", | ||
"tracer", | ||
] | ||
resolver = "2" | ||
|
||
[workspace.package] | ||
edition = "2021" | ||
rust-version = "1.60.0" | ||
license = "Apache-2.0" | ||
authors = ["rust-evm Developers <[email protected]>"] | ||
repository = "https://github.com/rust-ethereum/evm" | ||
|
@@ -7,7 +18,8 @@ keywords = ["no_std", "ethereum", "evm"] | |
[package] | ||
name = "evm" | ||
version = "1.0.0-dev" | ||
edition = "2021" | ||
edition = { workspace = true } | ||
rust-version = { workspace = true } | ||
license = { workspace = true } | ||
authors = { workspace = true } | ||
repository = { workspace = true } | ||
|
@@ -27,20 +39,12 @@ std = [ | |
"sha3/std", | ||
"evm-interpreter/std", | ||
] | ||
with-codec = [ | ||
scale = [ | ||
"primitive-types/codec", | ||
"primitive-types/scale-info", | ||
"evm-interpreter/with-codec", | ||
"evm-interpreter/scale", | ||
] | ||
with-serde = [ | ||
serde = [ | ||
"primitive-types/impl-serde", | ||
"evm-interpreter/with-serde", | ||
] | ||
|
||
[workspace] | ||
members = [ | ||
"interpreter", | ||
"jsontests", | ||
"precompile", | ||
"tracer", | ||
"evm-interpreter/serde", | ||
] |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
mod exit; | ||
mod trap; | ||
|
||
pub use self::{exit::*, trap::*}; | ||
|
||
/// Capture represents the result of execution. | ||
#[derive(Clone, Copy, Debug, Eq, PartialEq)] | ||
pub enum Capture<E, T> { | ||
/// The machine has exited. It cannot be executed again. | ||
Exit(E), | ||
/// The machine has trapped. It is waiting for external information, and can | ||
/// be executed again. | ||
Trap(T), | ||
} | ||
|
||
impl<E, T> Capture<E, T> { | ||
pub fn exit(self) -> Option<E> { | ||
match self { | ||
Self::Exit(e) => Some(e), | ||
Self::Trap(_) => None, | ||
} | ||
} | ||
|
||
pub fn trap(self) -> Option<T> { | ||
match self { | ||
Self::Exit(_) => None, | ||
Self::Trap(t) => Some(t), | ||
} | ||
} | ||
} |
Oops, something went wrong.