Merge pull request #154 from propeller-heads/encoding/dc/4318-single-strategy-integration-test
feat: Add SingleSwap integration test
This commit is contained in:
@@ -54,12 +54,11 @@ impl SingleSwapStrategyEncoder {
|
||||
) -> Result<Self, EncodingError> {
|
||||
let chain = Chain::from(blockchain);
|
||||
let (permit2, selector) = if let Some(swapper_pk) = swapper_pk {
|
||||
(Some(Permit2::new(swapper_pk, chain.clone())?), "singleSwapPermit2(uint256,address,address,uint256,bool,bool,uint256,address,((address,uint160,uint48,uint48),address,uint256),bytes,bytes)".to_string())
|
||||
(Some(Permit2::new(swapper_pk, chain.clone())?), "singleSwapPermit2(uint256,address,address,uint256,bool,bool,address,((address,uint160,uint48,uint48),address,uint256),bytes,bytes)".to_string())
|
||||
} else {
|
||||
(
|
||||
None,
|
||||
"singleSwap(uint256,address,address,uint256,bool,bool,uint256,address,bytes)"
|
||||
.to_string(),
|
||||
"singleSwap(uint256,address,address,uint256,bool,bool,address,bytes)".to_string(),
|
||||
)
|
||||
};
|
||||
Ok(Self { permit2, selector, swap_encoder_registry, router_address })
|
||||
@@ -1089,7 +1088,7 @@ mod tests {
|
||||
.unwrap();
|
||||
let expected_min_amount_encoded = hex::encode(U256::abi_encode(&expected_min_amount));
|
||||
let expected_input = [
|
||||
"c378044e", // Function selector
|
||||
"30ace1b1", // Function selector
|
||||
"0000000000000000000000000000000000000000000000000de0b6b3a7640000", // amount out
|
||||
"000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", // token in
|
||||
"0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f", // token out
|
||||
@@ -1754,8 +1753,8 @@ mod tests {
|
||||
.unwrap();
|
||||
let expected_min_amount_encoded = hex::encode(U256::abi_encode(&expected_min_amount));
|
||||
let expected_input = [
|
||||
"0f6cbbe8", // Function selector
|
||||
"0000000000000000000000000000000000000000000000000de0b6b3a7640000", // amount out
|
||||
"20144a07", // Function selector
|
||||
"0000000000000000000000000000000000000000000000000de0b6b3a7640000", // amount in
|
||||
"000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2", // token in
|
||||
"0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f", // token out
|
||||
&expected_min_amount_encoded, // min amount out
|
||||
|
||||
Reference in New Issue
Block a user