chore: add build_bebop_calldata helper and fix user_data building

This commit is contained in:
pedrobergamini
2025-08-05 20:33:23 -03:00
parent 504a4db702
commit f065abbdc9
3 changed files with 157 additions and 56 deletions

View File

@@ -15,7 +15,7 @@ use tycho_execution::encoding::{
};
use crate::common::{
build_bebop_user_data, encoding::encode_tycho_router_call, eth, eth_chain, get_signer,
build_bebop_calldata, encoding::encode_tycho_router_call, eth, eth_chain, get_signer,
get_tycho_router_encoder, ondo, pepe, usdc, weth,
};
@@ -623,8 +623,8 @@ fn test_single_encoding_strategy_bebop() {
// Real signature from mainnet
let signature = hex::decode("eb5419631614978da217532a40f02a8f2ece37d8cfb94aaa602baabbdefb56b474f4c2048a0f56502caff4ea7411d99eed6027cd67dc1088aaf4181dcb0df7051c").unwrap();
// Build user_data with the quote and signature
let user_data = build_bebop_user_data(
// Build user_data with the quote and signature using new calldata format
let user_data = build_bebop_calldata(
BebopOrderType::Single,
U256::ZERO, // 0 means fill entire order
&quote_data,
@@ -751,7 +751,7 @@ fn test_single_encoding_strategy_bebop_aggregate() {
(sig2, 0u8), // ETH_SIGN for maker 2
];
let user_data = build_bebop_user_data(
let user_data = build_bebop_calldata(
BebopOrderType::Aggregate,
U256::from(0), // 0 means fill entire aggregate order
&quote_data,