feat: Support Curve ETH
Curve pools use a different address from ETH (native token) - Pass Chain into the SwapEncoderBuilder and SwapEncoder - Add native_token_curve_address and native_token_address to CurveSwapEncoder - Added integration test for this curve case --- don't change below this line --- ENG-4306 Took 1 hour 4 minutes Took 11 seconds
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use crate::encoding::{
|
||||
errors::EncodingError,
|
||||
models::{EncodingContext, Swap},
|
||||
models::{Chain, EncodingContext, Swap},
|
||||
};
|
||||
|
||||
/// A trait for protocol-specific swap encoding, where each implementation should handle the
|
||||
@@ -10,7 +10,8 @@ pub trait SwapEncoder: Sync + Send {
|
||||
///
|
||||
/// # Arguments
|
||||
/// * `executor_address` - The address of the contract that will execute the swap
|
||||
fn new(executor_address: String) -> Self
|
||||
/// * `chain` - The chain on which the swap will be executed
|
||||
fn new(executor_address: String, chain: Chain) -> Result<Self, EncodingError>
|
||||
where
|
||||
Self: Sized;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user