fix: Expect decimal during encoding, add assert to test

- The util function was previously expecting a value between 0 and 100, which we felt was a weird UI.
- In integration test - make sure we spent all input tokens
This commit is contained in:
TAMARA LIPOWSKI
2025-01-31 12:04:53 -05:00
parent ff3c7aa629
commit 5a81ed6be5
3 changed files with 13 additions and 6 deletions

View File

@@ -442,7 +442,9 @@ mod tests {
},
token_in: weth.clone(),
token_out: wbtc.clone(),
split: 0.5f64,
// This represents the remaining 50%, but to avoid any rounding errors we set this to
// 0 to signify "the remainder of the WETH value". It should still be very close to 50%
split: 0f64,
};
let swap_dai_usdc = Swap {
component: ProtocolComponent {
@@ -485,5 +487,6 @@ mod tests {
.unwrap();
let _hex_calldata = encode(&calldata);
println!("{}", _hex_calldata);
}
}