Skip to content

Commit

Permalink
almost
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmitry-lahoda committed Mar 27, 2024
1 parent 386f003 commit caa182d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
30 changes: 21 additions & 9 deletions mantis/node/src/bin/mantis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,27 @@ async fn solve_orders(solver_args: &SolverArgs) {
let mut write_client = create_wasm_write_client(&args.rpc_centauri).await;
let gas = args.gas;

let start = std::time::Instant::now();
loop {
if start.elapsed().as_millis() % 10000 == 0 {
let tip = get_latest_block_and_account_by_key(
&args.rpc_centauri,
&args.grpc_centauri,
&signer,
)
.await;
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 {

autopilot::cleanup(
&mut write_client,
&mut cosmos_query_client,
Expand Down Expand Up @@ -172,7 +184,7 @@ async fn solve(
panic!()
// let salt = crate::cvm::get_salt(signing_key, tip);
// println!("========================= solve =========================");
// let all_orders = get_all_orders(order_contract, cosmos_query_client, tip).await;
//
// 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
4 changes: 0 additions & 4 deletions mantis/node/src/mantis/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@ pub struct SolverArgs {
#[command(flatten)]
pub shared: SharedArgs,

/// the problem to solve
#[arg(long, default_value_t = 10)]
pub solve_period_seconds: u16,

/// http url to call with parameters to obtain route
pub solution_provider: String,
}
Expand Down

0 comments on commit caa182d

Please sign in to comment.