fix: async
This commit is contained in:
@@ -106,7 +106,7 @@ impl SwapEncoder for BalancerV2SwapEncoder {
|
|||||||
encoding_context.exact_out,
|
encoding_context.exact_out,
|
||||||
approval_needed,
|
approval_needed,
|
||||||
);
|
);
|
||||||
Ok(args.abi_encode())
|
Ok(args.abi_encode_packed())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn executor_address(&self) -> &str {
|
fn executor_address(&self) -> &str {
|
||||||
@@ -121,8 +121,8 @@ mod tests {
|
|||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
#[tokio::test]
|
#[test]
|
||||||
async fn test_encode_uniswap_v2() {
|
fn test_encode_uniswap_v2() {
|
||||||
let usv2_pool = ProtocolComponent {
|
let usv2_pool = ProtocolComponent {
|
||||||
id: String::from("0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640"),
|
id: String::from("0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640"),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
@@ -160,8 +160,8 @@ mod tests {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[test]
|
||||||
async fn test_encode_balancer_v2() {
|
fn test_encode_balancer_v2() {
|
||||||
let balancer_pool = ProtocolComponent {
|
let balancer_pool = ProtocolComponent {
|
||||||
id: String::from("0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640"),
|
id: String::from("0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640"),
|
||||||
protocol_system: String::from("vm:balancer_v2"),
|
protocol_system: String::from("vm:balancer_v2"),
|
||||||
@@ -187,25 +187,18 @@ mod tests {
|
|||||||
assert_eq!(
|
assert_eq!(
|
||||||
hex_swap,
|
hex_swap,
|
||||||
String::from(concat!(
|
String::from(concat!(
|
||||||
// offset pointer
|
|
||||||
"0000000000000000000000000000000000000000000000000000000000000020",
|
|
||||||
// token in
|
// token in
|
||||||
"000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
|
"c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
|
||||||
// token out
|
// token out
|
||||||
"0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f",
|
"6b175474e89094c44da98b954eedeac495271d0f",
|
||||||
// pool id offset
|
// pool id
|
||||||
"00000000000000000000000000000000000000000000000000000000000000c0",
|
"307838386536413063326444443236464545623634463033396132633431323936466342336635363430",
|
||||||
// receiver
|
// receiver
|
||||||
"0000000000000000000000000000000000000000000000000000000000000001",
|
"0000000000000000000000000000000000000001",
|
||||||
// exact out
|
// exact out
|
||||||
"0000000000000000000000000000000000000000000000000000000000000000",
|
"00",
|
||||||
// approval needed
|
// approval needed
|
||||||
"0000000000000000000000000000000000000000000000000000000000000001",
|
"01"
|
||||||
// pool id length
|
|
||||||
"000000000000000000000000000000000000000000000000000000000000002a",
|
|
||||||
// pool id
|
|
||||||
"3078383865364130633264444432364645456236344630333961326334313239",
|
|
||||||
"3646634233663536343000000000000000000000000000000000000000000000"
|
|
||||||
))
|
))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user