Merge pull request #76 from propeller-heads/encoder/hr/ENG-4257-switch-to-models-chain
This commit is contained in:
@@ -2,7 +2,7 @@ use std::str::FromStr;
|
|||||||
|
|
||||||
use num_bigint::BigUint;
|
use num_bigint::BigUint;
|
||||||
use tycho_core::{
|
use tycho_core::{
|
||||||
dto::{Chain as TychoCoreChain, ProtocolComponent},
|
models::{protocol::ProtocolComponent, Chain as TychoCoreChain},
|
||||||
Bytes,
|
Bytes,
|
||||||
};
|
};
|
||||||
use tycho_execution::encoding::{
|
use tycho_execution::encoding::{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ use std::io::{self, Read};
|
|||||||
|
|
||||||
use clap::{Parser, Subcommand};
|
use clap::{Parser, Subcommand};
|
||||||
use serde_json::Value;
|
use serde_json::Value;
|
||||||
use tycho_core::dto::Chain;
|
use tycho_core::models::Chain;
|
||||||
use tycho_execution::encoding::{
|
use tycho_execution::encoding::{
|
||||||
errors::EncodingError, evm::encoder_builder::EVMEncoderBuilder, models::Solution,
|
errors::EncodingError, evm::encoder_builder::EVMEncoderBuilder, models::Solution,
|
||||||
tycho_encoder::TychoEncoder,
|
tycho_encoder::TychoEncoder,
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ mod tests {
|
|||||||
|
|
||||||
use alloy_primitives::Uint;
|
use alloy_primitives::Uint;
|
||||||
use num_bigint::BigUint;
|
use num_bigint::BigUint;
|
||||||
use tycho_core::dto::Chain as TychoCoreChain;
|
use tycho_core::models::Chain as TychoCoreChain;
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use tycho_core::dto::Chain;
|
use tycho_core::models::Chain;
|
||||||
|
|
||||||
use crate::encoding::{
|
use crate::encoding::{
|
||||||
errors::EncodingError,
|
errors::EncodingError,
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ mod tests {
|
|||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use alloy_primitives::hex;
|
use alloy_primitives::hex;
|
||||||
use tycho_core::{dto::ProtocolComponent, Bytes};
|
use tycho_core::{models::protocol::ProtocolComponent, Bytes};
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::encoding::models::Swap;
|
use crate::encoding::models::Swap;
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ pub struct SplitSwapStrategyEncoder {
|
|||||||
impl SplitSwapStrategyEncoder {
|
impl SplitSwapStrategyEncoder {
|
||||||
pub fn new(
|
pub fn new(
|
||||||
swapper_pk: String,
|
swapper_pk: String,
|
||||||
blockchain: tycho_core::dto::Chain,
|
blockchain: tycho_core::models::Chain,
|
||||||
swap_encoder_registry: SwapEncoderRegistry,
|
swap_encoder_registry: SwapEncoderRegistry,
|
||||||
) -> Result<Self, EncodingError> {
|
) -> Result<Self, EncodingError> {
|
||||||
let chain = Chain::from(blockchain);
|
let chain = Chain::from(blockchain);
|
||||||
@@ -334,7 +334,7 @@ mod tests {
|
|||||||
use num_bigint::BigUint;
|
use num_bigint::BigUint;
|
||||||
use rstest::rstest;
|
use rstest::rstest;
|
||||||
use tycho_core::{
|
use tycho_core::{
|
||||||
dto::{Chain as TychoCoreChain, ProtocolComponent},
|
models::{protocol::ProtocolComponent, Chain as TychoCoreChain},
|
||||||
Bytes,
|
Bytes,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ impl SplitSwapValidator {
|
|||||||
mod tests {
|
mod tests {
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use tycho_core::{dto::ProtocolComponent, Bytes};
|
use tycho_core::{models::protocol::ProtocolComponent, Bytes};
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::encoding::models::Swap;
|
use crate::encoding::models::Swap;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ impl SwapEncoderRegistry {
|
|||||||
/// executors' addresses in the file at the given path.
|
/// executors' addresses in the file at the given path.
|
||||||
pub fn new(
|
pub fn new(
|
||||||
executors_file_path: Option<String>,
|
executors_file_path: Option<String>,
|
||||||
blockchain: tycho_core::dto::Chain,
|
blockchain: tycho_core::models::Chain,
|
||||||
) -> Result<Self, EncodingError> {
|
) -> Result<Self, EncodingError> {
|
||||||
let chain = Chain::from(blockchain);
|
let chain = Chain::from(blockchain);
|
||||||
let config_str = if let Some(ref path) = executors_file_path {
|
let config_str = if let Some(ref path) = executors_file_path {
|
||||||
|
|||||||
@@ -290,7 +290,7 @@ mod tests {
|
|||||||
|
|
||||||
use alloy::hex::encode;
|
use alloy::hex::encode;
|
||||||
use num_bigint::{BigInt, BigUint};
|
use num_bigint::{BigInt, BigUint};
|
||||||
use tycho_core::{dto::ProtocolComponent, Bytes};
|
use tycho_core::{models::protocol::ProtocolComponent, Bytes};
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ pub struct EVMTychoEncoder {
|
|||||||
|
|
||||||
impl EVMTychoEncoder {
|
impl EVMTychoEncoder {
|
||||||
pub fn new(
|
pub fn new(
|
||||||
chain: tycho_core::dto::Chain,
|
chain: tycho_core::models::Chain,
|
||||||
strategy_encoder: Box<dyn StrategyEncoder>,
|
strategy_encoder: Box<dyn StrategyEncoder>,
|
||||||
) -> Result<Self, EncodingError> {
|
) -> Result<Self, EncodingError> {
|
||||||
let chain: Chain = Chain::from(chain);
|
let chain: Chain = Chain::from(chain);
|
||||||
@@ -119,7 +119,7 @@ impl TychoEncoder for EVMTychoEncoder {
|
|||||||
mod tests {
|
mod tests {
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use tycho_core::dto::{Chain as TychoCoreChain, ProtocolComponent};
|
use tycho_core::models::{protocol::ProtocolComponent, Chain as TychoCoreChain};
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::encoding::{
|
use crate::encoding::{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ use hex;
|
|||||||
use num_bigint::BigUint;
|
use num_bigint::BigUint;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use tycho_core::{
|
use tycho_core::{
|
||||||
dto::{Chain as TychoCoreChain, ProtocolComponent},
|
models::{protocol::ProtocolComponent, Chain as TychoCoreChain},
|
||||||
Bytes,
|
Bytes,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -189,7 +189,7 @@ mod tests {
|
|||||||
tokens: vec![],
|
tokens: vec![],
|
||||||
protocol_type_name: "".to_string(),
|
protocol_type_name: "".to_string(),
|
||||||
chain: Default::default(),
|
chain: Default::default(),
|
||||||
contract_ids: vec![],
|
contract_addresses: vec![],
|
||||||
static_attributes: Default::default(),
|
static_attributes: Default::default(),
|
||||||
change: Default::default(),
|
change: Default::default(),
|
||||||
creation_tx: Default::default(),
|
creation_tx: Default::default(),
|
||||||
|
|||||||
Reference in New Issue
Block a user