Skip to content

Commit

Permalink
allow 'kind' in setup steps
Browse files Browse the repository at this point in the history
  • Loading branch information
zeroXbrock committed Oct 4, 2024
1 parent a044fff commit 1e4e7ec
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions cli/univ2ConfigTest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ args = [
## add liquidity ###############################################################

[[setup]]
kind = "uniswap_v2"
to = "{uniRouterV2}"
from = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
signature = "addLiquidity(address tokenA, address tokenB, uint amountADesired, uint amountBDesired, uint amountAMin, uint amountBMin, address to, uint deadline) returns (uint amountA, uint amountB, uint liquidity)"
Expand Down
8 changes: 5 additions & 3 deletions src/generator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,11 @@ where
templater.find_fncall_placeholders(step, db, &mut placeholder_map)?;

// setup tx with template values
let tx: NamedTxRequest = templater
.template_function_call(step, &placeholder_map)?
.into();
let tx = NamedTxRequest::new(
templater.template_function_call(step, &placeholder_map)?,
None,
step.kind.to_owned(),
);

let handle = on_setup_step(tx.to_owned())?;
if let Some(handle) = handle {
Expand Down

0 comments on commit 1e4e7ec

Please sign in to comment.