chore: rename straight_to_pool to direct_execution
This commit is contained in:
@@ -34,7 +34,7 @@ impl<S: StrategySelector, A: UserApprovalsManager> RouterEncoder<S, A> for EVMRo
|
|||||||
let mut transactions: Vec<Transaction> = Vec::new();
|
let mut transactions: Vec<Transaction> = Vec::new();
|
||||||
for solution in solutions.iter() {
|
for solution in solutions.iter() {
|
||||||
let exact_out = solution.exact_out;
|
let exact_out = solution.exact_out;
|
||||||
let straight_to_pool = solution.straight_to_pool;
|
let straight_to_pool = solution.direct_execution;
|
||||||
|
|
||||||
let strategy = self
|
let strategy = self
|
||||||
.strategy_selector
|
.strategy_selector
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ mod tests {
|
|||||||
// The receiver was generated with `makeAddr("bob") using forge`
|
// The receiver was generated with `makeAddr("bob") using forge`
|
||||||
receiver: Bytes::from_str("0x1d96f2f6bef1202e4ce1ff6dad0c2cb002861d3e").unwrap(),
|
receiver: Bytes::from_str("0x1d96f2f6bef1202e4ce1ff6dad0c2cb002861d3e").unwrap(),
|
||||||
swaps: vec![swap],
|
swaps: vec![swap],
|
||||||
straight_to_pool: true,
|
direct_execution: true,
|
||||||
router_address: Some(Bytes::zero(20)),
|
router_address: Some(Bytes::zero(20)),
|
||||||
slippage: None,
|
slippage: None,
|
||||||
native_action: None,
|
native_action: None,
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ pub struct EVMStrategySelector;
|
|||||||
|
|
||||||
impl StrategySelector for EVMStrategySelector {
|
impl StrategySelector for EVMStrategySelector {
|
||||||
fn select_strategy(&self, solution: &Solution) -> Box<dyn StrategyEncoder> {
|
fn select_strategy(&self, solution: &Solution) -> Box<dyn StrategyEncoder> {
|
||||||
if solution.straight_to_pool {
|
if solution.direct_execution {
|
||||||
Box::new(ExecutorStrategyEncoder {})
|
Box::new(ExecutorStrategyEncoder {})
|
||||||
} else {
|
} else {
|
||||||
Box::new(SplitSwapStrategyEncoder {})
|
Box::new(SplitSwapStrategyEncoder {})
|
||||||
|
|||||||
@@ -23,10 +23,10 @@ pub struct Solution {
|
|||||||
pub receiver: Bytes,
|
pub receiver: Bytes,
|
||||||
/// List of swaps to fulfill the solution.
|
/// List of swaps to fulfill the solution.
|
||||||
pub swaps: Vec<Swap>,
|
pub swaps: Vec<Swap>,
|
||||||
/// If set to true, the solution will be encoded to be sent directly to the SwapExecutor and
|
/// If set to true, the solution will be encoded to be sent directly to the Executor and
|
||||||
/// skip the router. The user is responsible for managing necessary approvals and token
|
/// skip the router. The user is responsible for managing necessary approvals and token
|
||||||
/// transfers.
|
/// transfers.
|
||||||
pub straight_to_pool: bool,
|
pub direct_execution: bool,
|
||||||
// if not set, then the Propeller Router will be used
|
// if not set, then the Propeller Router will be used
|
||||||
pub router_address: Option<Bytes>,
|
pub router_address: Option<Bytes>,
|
||||||
// if set, it will be applied to check_amount
|
// if set, it will be applied to check_amount
|
||||||
|
|||||||
Reference in New Issue
Block a user