Skip to content

Commit

Permalink
happier
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmitry-lahoda committed Apr 11, 2024
1 parent b010faa commit f893491
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 6 deletions.
8 changes: 8 additions & 0 deletions contracts/cosmwasm/order/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,14 @@ impl OrderContract<'_> {
Ok(())
}


/// simply exchange maximal given token for best price for other side
/// mostly for testing purposes because as any one bad price can prevent execution (even if it is small amount)
#[msg(exec)]
pub fn exchange(&self, mut ctx: ExecCtx, limit: Ratio) -> StdResult<Response> {
todo!();
}

/// Simple get all orders
#[msg(query)]
pub fn get_all_orders(&self, ctx: QueryCtx) -> StdResult<Vec<OrderItem>> {
Expand Down
12 changes: 6 additions & 6 deletions contracts/cosmwasm/order/src/state.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
//! simple operation without constraint checks and calculations
use cw_storage_plus::MultiIndex;
use mantis_cw::Denom;

use crate::*;



/// the connection description from first network to second
// pub(crate) const NETWORK_TO_NETWORK: Map<(NetworkId, NetworkId), NetworkToNetworkItem> =
// Map::new("network_to_network");
/// tracks best price for A in pair, so that simplest solution which can take ALL orders can pay this one
pub(crate) const PAIR_BEST_A: Map<DenomPair, Ratio> =
Map::new("PAIR_BEST_A");



// pub const BEST_A_PROIE: Ratio = ;
pub(crate) const PAIR_BEST_B: Map<DenomPair, Ratio> =
Map::new("PAIR_BEST_B");

/// so we need to have several solution per pair to pick one best
pub struct SolutionIndexes<'a> {
Expand Down
6 changes: 6 additions & 0 deletions mantis/node/tests/cvms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ fn cvm_devnet_case() {
cw_cvm_outpost::contract::query::query,
);

let cw_cvm_executor_wasm = ContractWrapper::new(
cw_cvm_executor::contract::execute,
cw_cvm_executor::contract::instantiate,
cw_cvm_executor::contract::query,
);

let sender = Addr::unchecked("juno16g2rahf5846rxzp3fwlswy08fz8ccuwk03k57y");
}

Expand Down

0 comments on commit f893491

Please sign in to comment.