Skip to content

Commit

Permalink
naming
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmitry-lahoda committed Mar 11, 2024
1 parent 512e9d1 commit cc8b704
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions mantis/node/src/mantis/blackbox/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use blackbox_rs::{prelude::*, types::*, Client};
/// Given total amount it, order owners and desired out, produce CVM program from and by requesting route
use cvm_runtime::{
outpost::GetConfigResponse, shared::{CvmInstruction, Displayed, XcAddr, XcProgram}, Amount, AssetId, ExchangeId
outpost::GetConfigResponse, shared::{CvmInstruction, Displayed, XcAddr, CvmProgram}, Amount, AssetId, ExchangeId
};


Expand Down Expand Up @@ -34,7 +34,7 @@ async fn route(
server: &str,
input : BankInput,
glt: GetConfigResponse,
) -> XcProgram {
) -> CvmProgram {
let blackbox: Client = Client::new(server);
let route = blackbox
.simulator_router_simulator_router_get(
Expand All @@ -49,10 +49,13 @@ async fn route(
.into_inner()
.get(0).expect("at least one route");

fn build_next(next: &mut [NextItem]) -> CvmInstruction {
fn build_next(current: CvmProgram, next: &mut [NextItem]) -> CvmInstruction {
match next.split_first_mut() {
Some(next) => {

Some((head, rest) => {
match head {
NextItem::Exchange(_) => todo!(),
NextItem::Spawn(_) => todo!(),
}
}
None => info!("no more routes"),
}
Expand Down

0 comments on commit cc8b704

Please sign in to comment.