fix: Do not count intermediary tokens in indices
To achieve this, a small refactor was necessary with the introduction of a SwapGroup object, and a separate method to create a vec of these objects. This then separates all logic related to combining protocol data nicely and cleanly into its own method with its own tests. TODO: - Deal with split swaps and add test for split swap scenario - Clean up all existing PR comments
This commit is contained in:
@@ -65,7 +65,7 @@ pub enum NativeAction {
|
||||
}
|
||||
|
||||
/// Represents a swap operation to be performed on a pool.
|
||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
||||
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
|
||||
pub struct Swap {
|
||||
/// Protocol component from tycho indexer
|
||||
pub component: ProtocolComponent,
|
||||
@@ -111,6 +111,7 @@ pub struct Transaction {
|
||||
/// * `receiver`: Address of the receiver of the out token after the swaps are completed.
|
||||
/// * `exact_out`: true if the solution is a buy order, false if it is a sell order.
|
||||
/// * `router_address`: Address of the router contract to be used for the swaps.
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct EncodingContext {
|
||||
pub receiver: Bytes,
|
||||
pub exact_out: bool,
|
||||
|
||||
Reference in New Issue
Block a user