Skip to content
Merged
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
2 changes: 1 addition & 1 deletion cli/test-utils/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ impl TestProject {

/// Adds DSTest as a source under "test.sol"
pub fn insert_ds_test(&self) -> PathBuf {
let s = include_str!("../../../forge/testdata/DsTest.sol");
let s = include_str!("../../../testdata/lib/ds-test/src/test.sol");
self.inner().add_source("test.sol", s).unwrap()
}

Expand Down
32 changes: 0 additions & 32 deletions cli/testdata/run_test.sol

This file was deleted.

38 changes: 0 additions & 38 deletions cli/testdata/run_test_lib_linking.sol

This file was deleted.

2 changes: 1 addition & 1 deletion evm/src/executor/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use super::{
Executor,
};

#[derive(Default)]
#[derive(Default, Debug)]
pub struct ExecutorBuilder {
/// The execution environment configuration.
env: Env,
Expand Down
1 change: 0 additions & 1 deletion evm/src/executor/inspector/cheatcodes/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ fn get_code(path: &str) -> Result<Bytes, Bytes> {
let file = parts[0];
let contract_name =
if parts.len() == 1 { parts[0].replace(".sol", "") } else { parts[1].to_string() };

let out_dir = ProjectPathsConfig::find_artifacts_dir(Path::new("./"));
out_dir.join(format!("{}/{}.json", file, contract_name))
};
Expand Down
2 changes: 1 addition & 1 deletion evm/src/executor/inspector/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub use stack::InspectorStack;
mod cheatcodes;
pub use cheatcodes::Cheatcodes;

#[derive(Default, Clone)]
#[derive(Default, Clone, Debug)]
pub struct InspectorStackConfig {
/// Whether or not cheatcodes are enabled
pub cheatcodes: bool,
Expand Down
2 changes: 1 addition & 1 deletion evm/src/trace/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ impl fmt::Display for CallTrace {
}

/// Specifies the kind of trace.
#[derive(Clone, Debug, Serialize, Deserialize)]
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub enum TraceKind {
Deployment,
Setup,
Expand Down
29 changes: 20 additions & 9 deletions forge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ pub use foundry_evm::*;
pub mod test_helpers {
use crate::TestFilter;
use ethers::{
prelude::Lazy,
solc::{AggregatedCompilerOutput, Project, ProjectPathsConfig},
types::U256,
prelude::{Lazy, ProjectCompileOutput},
solc::{Project, ProjectPathsConfig},
types::{Address, U256},
};
use foundry_evm::{
executor::{
Expand All @@ -35,17 +35,28 @@ pub mod test_helpers {
fuzz::FuzzedExecutor,
CALLER,
};

pub static COMPILED: Lazy<AggregatedCompilerOutput> = Lazy::new(|| {
let paths =
ProjectPathsConfig::builder().root("testdata").sources("testdata").build().unwrap();
use std::str::FromStr;

pub static COMPILED: Lazy<ProjectCompileOutput> = Lazy::new(|| {
let paths = ProjectPathsConfig::builder()
.root("../testdata")
.sources("../testdata")
.build()
.unwrap();
let project = Project::builder().paths(paths).ephemeral().no_artifacts().build().unwrap();
project.compile().unwrap().output()
project.compile().unwrap()
});

pub static EVM_OPTS: Lazy<EvmOpts> = Lazy::new(|| EvmOpts {
env: Env { gas_limit: 18446744073709551615, chain_id: Some(99), ..Default::default() },
env: Env {
gas_limit: 18446744073709551615,
chain_id: Some(99),
tx_origin: Address::from_str("00a329c0648769a73afac7f9381e08fb43dbea72").unwrap(),
..Default::default()
},
sender: Address::from_str("00a329c0648769a73afac7f9381e08fb43dbea72").unwrap(),
initial_balance: U256::MAX,
ffi: true,
..Default::default()
});

Expand Down
Loading