Skip to content

Commit

Permalink
fix: use auto-switching of versions inside tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gakonst committed Sep 13, 2021
1 parent 4843a16 commit be00b10
Showing 1 changed file with 20 additions and 7 deletions.
27 changes: 20 additions & 7 deletions src/dapp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -587,10 +587,11 @@ mod tests {

#[test]
fn can_call_vm_directly() {
// TODO: Is there a cleaner way to initialize them all together in a function?
let cfg = Config::istanbul();

let compiled = Solc::new(&format!("./GreetTest.sol")).build().unwrap();
let compiled = SolcBuilder::new("./*.sol", &[], &[])
.unwrap()
.build_all()
.unwrap();
let compiled = compiled.get("Greeter").expect("could not find contract");

let addr = "0x1000000000000000000000000000000000000000"
Expand Down Expand Up @@ -630,7 +631,10 @@ mod tests {
fn solidity_unit_test() {
let cfg = Config::istanbul();

let compiled = Solc::new(&format!("./GreetTest.sol")).build().unwrap();
let compiled = SolcBuilder::new("./*.sol", &[], &[])
.unwrap()
.build_all()
.unwrap();
let compiled = compiled
.get("GreeterTest")
.expect("could not find contract");
Expand Down Expand Up @@ -672,7 +676,10 @@ mod tests {
fn failing_with_no_reason_if_no_setup() {
let cfg = Config::istanbul();

let compiled = Solc::new(&format!("./GreetTest.sol")).build().unwrap();
let compiled = SolcBuilder::new("./*.sol", &[], &[])
.unwrap()
.build_all()
.unwrap();
let compiled = compiled
.get("GreeterTest")
.expect("could not find contract");
Expand Down Expand Up @@ -702,7 +709,10 @@ mod tests {
fn failing_solidity_unit_test() {
let cfg = Config::istanbul();

let compiled = Solc::new(&format!("./GreetTest.sol")).build().unwrap();
let compiled = SolcBuilder::new("./*.sol", &[], &[])
.unwrap()
.build_all()
.unwrap();
let compiled = compiled
.get("GreeterTest")
.expect("could not find contract");
Expand Down Expand Up @@ -745,7 +755,10 @@ mod tests {
fn test_runner() {
let cfg = Config::istanbul();

let compiled = Solc::new(&format!("./GreetTest.sol")).build().unwrap();
let compiled = SolcBuilder::new("./*.sol", &[], &[])
.unwrap()
.build_all()
.unwrap();
let compiled = compiled
.get("GreeterTest")
.expect("could not find contract");
Expand Down

0 comments on commit be00b10

Please sign in to comment.