refactor: use chain and protocol component from tycho_core::models

This commit is contained in:
royvardhan
2025-02-20 22:36:50 +05:30
parent 9693856dca
commit 29bc662ba9
11 changed files with 14 additions and 14 deletions

View File

@@ -183,7 +183,7 @@ mod tests {
use alloy_primitives::Uint;
use num_bigint::BigUint;
use tycho_core::dto::Chain as TychoCoreChain;
use tycho_core::models::Chain as TychoCoreChain;
use super::*;

View File

@@ -1,4 +1,4 @@
use tycho_core::dto::Chain;
use tycho_core::models::Chain;
use crate::encoding::{
errors::EncodingError,

View File

@@ -74,7 +74,7 @@ mod tests {
use std::str::FromStr;
use alloy_primitives::hex;
use tycho_core::{dto::ProtocolComponent, Bytes};
use tycho_core::{models::protocol::ProtocolComponent, Bytes};
use super::*;
use crate::encoding::models::Swap;

View File

@@ -90,7 +90,7 @@ pub struct SplitSwapStrategyEncoder {
impl SplitSwapStrategyEncoder {
pub fn new(
swapper_pk: String,
blockchain: tycho_core::dto::Chain,
blockchain: tycho_core::models::Chain,
swap_encoder_registry: SwapEncoderRegistry,
) -> Result<Self, EncodingError> {
let chain = Chain::from(blockchain);
@@ -334,7 +334,7 @@ mod tests {
use num_bigint::BigUint;
use rstest::rstest;
use tycho_core::{
dto::{Chain as TychoCoreChain, ProtocolComponent},
models::{protocol::ProtocolComponent, Chain as TychoCoreChain},
Bytes,
};

View File

@@ -178,7 +178,7 @@ impl SplitSwapValidator {
mod tests {
use std::str::FromStr;
use tycho_core::{dto::ProtocolComponent, Bytes};
use tycho_core::{models::protocol::ProtocolComponent, Bytes};
use super::*;
use crate::encoding::models::Swap;

View File

@@ -19,7 +19,7 @@ impl SwapEncoderRegistry {
/// executors' addresses in the file at the given path.
pub fn new(
executors_file_path: Option<String>,
blockchain: tycho_core::dto::Chain,
blockchain: tycho_core::models::Chain,
) -> Result<Self, EncodingError> {
let chain = Chain::from(blockchain);
let config_str = if let Some(ref path) = executors_file_path {

View File

@@ -290,7 +290,7 @@ mod tests {
use alloy::hex::encode;
use num_bigint::{BigInt, BigUint};
use tycho_core::{dto::ProtocolComponent, Bytes};
use tycho_core::{models::protocol::ProtocolComponent, Bytes};
use super::*;

View File

@@ -22,7 +22,7 @@ pub struct EVMTychoEncoder {
impl EVMTychoEncoder {
pub fn new(
chain: tycho_core::dto::Chain,
chain: tycho_core::models::Chain,
strategy_encoder: Box<dyn StrategyEncoder>,
) -> Result<Self, EncodingError> {
let chain: Chain = Chain::from(chain);
@@ -119,7 +119,7 @@ impl TychoEncoder for EVMTychoEncoder {
mod tests {
use std::str::FromStr;
use tycho_core::dto::{Chain as TychoCoreChain, ProtocolComponent};
use tycho_core::models::{protocol::ProtocolComponent, Chain as TychoCoreChain};
use super::*;
use crate::encoding::{