Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP #969

Draft
wants to merge 1 commit into
base: fe-v2
Choose a base branch
from
Draft

WIP #969

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
829 changes: 740 additions & 89 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion crates/test-runner/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ colored = "2.0"

# used by revm; we need to force the js feature for wasm support
getrandom = { version = "0.2.8", features = ["js"] }
revm = "3.0"
revm = "3.5.0"
alloy-primitives = { version = "0.4" }
14 changes: 8 additions & 6 deletions crates/test-runner/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use bytes::Bytes;
use alloy_primitives::{Address, Bytes};
use colored::Colorize;
use revm::primitives::{AccountInfo, Bytecode, Env, ExecutionResult, TransactTo, B160, U256};
use std::fmt::Display;
use revm::primitives::{AccountInfo, Bytecode, Env, ExecutionResult, TransactTo, U256};
use std::{fmt::Display, str::FromStr};

#[derive(Debug, Default)]
pub struct TestSink {
Expand Down Expand Up @@ -66,11 +66,13 @@ impl Display for TestSink {
}

pub fn execute(name: &str, bytecode: &str, sink: &mut TestSink) -> bool {
let bytecode = Bytecode::new_raw(Bytes::copy_from_slice(&hex::decode(bytecode).unwrap()));
let bytecode = Bytecode::new_raw(alloy_primitives::Bytes(
Bytes::copy_from_slice(&hex::decode(bytecode).unwrap()).into(),
));

let mut database = revm::InMemoryDB::default();
let test_address = B160::from(42);
let test_info = AccountInfo::new(U256::ZERO, 0, bytecode);
let test_address = Address::from_str("42").unwrap();
let test_info = AccountInfo::new(U256::ZERO, 0, bytecode.hash_slow(), bytecode);
database.insert_account_info(test_address, test_info);

let mut env = Env::default();
Expand Down
4 changes: 4 additions & 0 deletions fuzz/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
target
corpus
artifacts
coverage
Loading
Loading