Skip to content

Commit

Permalink
add foundry-test-generator
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-chia committed Oct 20, 2023
1 parent 5a61380 commit c828f76
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/evm/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,10 +312,16 @@ impl ConciseEVMInput {
}

impl TestTx for ConciseEVMInput {
#[cfg(feature = "flashloan_v2")]
fn is_borrow(&self) -> bool {
self.input_type == EVMInputTy::Borrow
}

#[cfg(not(feature = "flashloan_v2"))]
fn is_borrow(&self) -> bool {
false
}

fn caller(&self) -> String {
format!("0x{}", hex::encode(self.caller))
}
Expand Down Expand Up @@ -358,9 +364,15 @@ impl TestTx for ConciseEVMInput {
"".to_string()
}

#[cfg(feature = "flashloan_v2")]
fn liq_percent(&self) -> u8 {
self.liquidation_percent
}

#[cfg(not(feature = "flashloan_v2"))]
fn liq_percent(&self) -> u8 {
0
}
}

impl HasLen for EVMInput {
Expand Down

0 comments on commit c828f76

Please sign in to comment.