Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmitry-lahoda committed Mar 27, 2024
1 parent caa182d commit 19258e7
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 deletions mantis/node/src/bin/mantis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,29 +73,20 @@ async fn solve_orders(solver_args: &SolverArgs) {
let gas = args.gas;
let mut cosmos_query_client = create_cosmos_query_client(&args.rpc_centauri).await;
let mut write_client = create_wasm_write_client(&args.rpc_centauri).await;
let mut wasm_read_client = create_wasm_query_client(&args.grpc_centauri).await;
let gas = args.gas;

loop {
let all_orders = get_all_orders(order_contract, cosmos_query_client, tip).await;
let tip = get_latest_block_and_account_by_key(
&args.rpc_centauri,
&args.grpc_centauri,
&signer,
)
.await;

// 1. proper order stuctue 1. solve and clean timeout
// 2. form CVM from string
// 3. deploy to devnet
// 4. test
// 5. final fix
if all_orders.any() {

if all_orders.iter().filter(|x| x.msg.timeout)
}

if start.elapsed().as_millis() % solver_args.solve_period_seconds == 0 {

let tip =
get_latest_block_and_account_by_key(&args.rpc_centauri, &args.grpc_centauri, &signer)
.await;
let all_orders = get_all_orders(&args.order_contract, &mut wasm_read_client, &tip).await;
if all_orders
.iter()
.filter(|x| x.msg.timeout < tip.block.value())
.count()
> 0
{
autopilot::cleanup(
&mut write_client,
&mut cosmos_query_client,
Expand All @@ -106,22 +97,31 @@ async fn solve_orders(solver_args: &SolverArgs) {
gas,
)
.await;
};

let tip =
get_latest_block_and_account_by_key(&args.rpc_centauri, &args.grpc_centauri, &signer)
.await;
}

solve(
&mut write_client,
&mut wasm_read_client,
&args.order_contract,
&signer,
&args.rpc_centauri,
&tip,
gas,
)
.await;
// 1. proper order structure 1. solve and clean timeout
// 2. form CVM from string
// 3. deploy to devnet
// 4. test
// 5. final fix
// if all_orders.any() {

// };

// let tip =
// get_latest_block_and_account_by_key(&args.rpc_centauri, &args.grpc_centauri, &signer)
// .await;

// solve(
// &mut write_client,
// &mut wasm_read_client,
// &args.order_contract,
// &signer,
// &args.rpc_centauri,
// &tip,
// gas,
// )
// .await;
}
}

Expand Down Expand Up @@ -184,7 +184,7 @@ async fn solve(
panic!()
// let salt = crate::cvm::get_salt(signing_key, tip);
// println!("========================= solve =========================");
//
//
// if !all_orders.is_empty() {
// let cows_per_pair = mantis_node::mantis::solve::do_cows(all_orders);
// let cvm_glt = get_cvm_glt(cvm_contact, &mut cosmos_query_client).await;
Expand Down

0 comments on commit 19258e7

Please sign in to comment.