Skip to content

Commit

Permalink
chore: clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
0xJepsen committed Apr 23, 2024
1 parent 8046db1 commit af348cf
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
7 changes: 5 additions & 2 deletions kit/src/behaviors/mod.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
use std::{boxed::Box, marker::PhantomData, pin::Pin, sync::Arc};

use arbiter_core::events::stream_event;
use arbiter_engine::{
machine::{Behavior, ControlFlow, EventStream, Processor, State},
messager::{Message, Messager, To},
};
#[allow(unused)]
use arbiter_macros::Behaviors;
use bindings::{arbiter_token::ArbiterToken, dfmm::DFMM};
use futures_util::{Stream, StreamExt};
use futures_util::Stream;
pub use token::{MintRequest, TokenAdminQuery};

use self::{
Expand All @@ -21,6 +20,10 @@ use super::*;

pub const MAX: eU256 = eU256::MAX;

type PoolId = eU256;
type TokenList = Vec<eAddress>;
type LiquidityToken = eAddress;

pub mod allocate;
pub mod creator;
pub mod deploy;
Expand Down
16 changes: 6 additions & 10 deletions kit/src/behaviors/swap/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
use futures_util::future::ok;
use tracing::warn;

use self::{
bindings::erc20::ERC20, creator::PoolCreation, pool::InputToken, update::UpdatoorQuerry,
};
use self::{bindings::erc20::ERC20, pool::InputToken};
use super::*;
use crate::behaviors::token::Response;

Expand All @@ -13,7 +8,7 @@ pub trait SwapType<E>: Debug + Serialize + Clone {
// return a proccess
fn get_stream(
&self,
messager: Messager,
_messager: Messager,
) -> Option<Pin<Box<dyn Stream<Item = E> + Send + Sync>>> {
None
}
Expand Down Expand Up @@ -58,10 +53,11 @@ where
#[derive(Debug)]
struct SwapTodo<P: PoolType> {
deployment_data: Option<DeploymentData>,
#[allow(clippy::type_complexity)]
pool_creation: Option<(
eU256, // Pool ID
Vec<eAddress>, // Token List
eAddress, // Liquidity Token
PoolId, // Pool ID
TokenList, // Token List
LiquidityToken, // Liquidity Token
<P as PoolType>::Parameters,
<P as PoolType>::AllocationData,
)>,
Expand Down
14 changes: 10 additions & 4 deletions kit/src/behaviors/update/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
use std::collections::VecDeque;

use tracing::warn;

use super::*;
use crate::bindings::erc20::ERC20;

Expand Down Expand Up @@ -36,13 +38,18 @@ where
type Data = Self;
}

type PoolId = eU256;
type TokenList = Vec<eAddress>;
type LiquidityToken = eAddress;

#[derive(Debug)]
struct UpdateTodo<P: PoolType> {
deployment_data: Option<DeploymentData>,
#[allow(clippy::type_complexity)]
pool_creation: Option<(
eU256, // Pool ID
Vec<eAddress>, // Token List
eAddress, // Liquidity Token
PoolId, // Pool ID
TokenList, // Token List
LiquidityToken, // Liquidity Token
<P as PoolType>::Parameters,
<P as PoolType>::AllocationData,
)>,
Expand Down Expand Up @@ -103,7 +110,6 @@ where
P::get_contracts(todo.deployment_data.as_ref().unwrap(), client.clone());
let dfmm = DFMM::new(todo.deployment_data.unwrap().dfmm, client.clone());
debug!("Got DFMM and the strategy contracts.");

let pool = Pool::<P> {
id: todo.pool_creation.clone().unwrap().0,
dfmm,
Expand Down

0 comments on commit af348cf

Please sign in to comment.