feat: Add protocol state to Swap object

- This consists of lots of necessary battles with lifetimes.
This commit is contained in:
TAMARA LIPOWSKI
2025-07-22 12:13:39 -04:00
parent a057588270
commit c217702560
18 changed files with 210 additions and 39 deletions

View File

@@ -48,6 +48,7 @@ fn test_uniswap_v3_uniswap_v2() {
token_out: wbtc.clone(),
split: 0f64,
user_data: None,
protocol_state: None,
};
let swap_wbtc_usdc = Swap {
component: ProtocolComponent {
@@ -59,6 +60,7 @@ fn test_uniswap_v3_uniswap_v2() {
token_out: usdc.clone(),
split: 0f64,
user_data: None,
protocol_state: None,
};
let encoder = get_tycho_router_encoder(UserTransferType::TransferFrom);
@@ -127,6 +129,7 @@ fn test_uniswap_v3_uniswap_v3() {
token_out: wbtc.clone(),
split: 0f64,
user_data: None,
protocol_state: None,
};
let swap_wbtc_usdc = Swap {
component: ProtocolComponent {
@@ -146,6 +149,7 @@ fn test_uniswap_v3_uniswap_v3() {
token_out: usdc.clone(),
split: 0f64,
user_data: None,
protocol_state: None,
};
let encoder = get_tycho_router_encoder(UserTransferType::TransferFrom);
@@ -213,6 +217,7 @@ fn test_uniswap_v3_curve() {
token_out: wbtc.clone(),
split: 0f64,
user_data: None,
protocol_state: None,
};
let swap_wbtc_usdt = Swap {
@@ -242,6 +247,7 @@ fn test_uniswap_v3_curve() {
token_out: usdt.clone(),
split: 0f64,
user_data: None,
protocol_state: None,
};
let encoder = get_tycho_router_encoder(UserTransferType::TransferFrom);
@@ -301,6 +307,7 @@ fn test_balancer_v2_uniswap_v2() {
token_out: wbtc.clone(),
split: 0f64,
user_data: None,
protocol_state: None,
};
let swap_wbtc_usdc = Swap {
@@ -313,6 +320,7 @@ fn test_balancer_v2_uniswap_v2() {
token_out: usdc.clone(),
split: 0f64,
user_data: None,
protocol_state: None,
};
let encoder = get_tycho_router_encoder(UserTransferType::TransferFrom);
@@ -375,6 +383,7 @@ fn test_multi_protocol() {
token_out: weth.clone(),
split: 0f64,
user_data: None,
protocol_state: None,
};
let balancer_swap_weth_wbtc = Swap {
@@ -387,6 +396,7 @@ fn test_multi_protocol() {
token_out: wbtc.clone(),
split: 0f64,
user_data: None,
protocol_state: None,
};
let curve_swap_wbtc_usdt = Swap {
@@ -416,6 +426,7 @@ fn test_multi_protocol() {
token_out: usdt.clone(),
split: 0f64,
user_data: None,
protocol_state: None,
};
// Ekubo
@@ -438,6 +449,7 @@ fn test_multi_protocol() {
token_out: usdc.clone(),
split: 0f64,
user_data: None,
protocol_state: None,
};
// USV4
@@ -461,6 +473,7 @@ fn test_multi_protocol() {
token_out: eth.clone(),
split: 0f64,
user_data: None,
protocol_state: None,
};
let encoder = get_tycho_router_encoder(UserTransferType::TransferFromPermit2);
@@ -533,6 +546,7 @@ fn test_uniswap_v3_balancer_v3() {
token_out: wbtc.clone(),
split: 0f64,
user_data: None,
protocol_state: None,
};
let swap_wbtc_qnt = Swap {
component: ProtocolComponent {
@@ -544,6 +558,7 @@ fn test_uniswap_v3_balancer_v3() {
token_out: qnt.clone(),
split: 0f64,
user_data: None,
protocol_state: None,
};
let encoder = get_tycho_router_encoder(UserTransferType::TransferFrom);