Skip to content

Commit

Permalink
producing rust code
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmitry-lahoda committed Apr 12, 2024
1 parent 245e064 commit e5ef00c
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
6 changes: 3 additions & 3 deletions crates/cvm-runtime/src/outpost/config.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use cvm_route::{
asset::AssetToNetwork, exchange::ExchangeItem, transport::NetworkToNetworkItem,
asset::{AssetItem, AssetToNetwork}, exchange::ExchangeItem, transport::NetworkToNetworkItem,
venue::AssetsVenueItem,
};

use crate::{prelude::*, transport::ibc::IbcEnabled, AssetId, NetworkId};

/// Version of IBC channels used by the gateway.
/// Version of IBC ICS27 channel used by the outpost.
pub const IBC_VERSION: &str = "cvm-v0";

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
Expand Down Expand Up @@ -101,7 +101,7 @@ pub enum ConfigSubMsg {
ForceNetworkToNetwork(NetworkToNetworkItem),

/// Permissioned message (gov or admin) to force set asset information.
ForceAsset(cvm_route::asset::AssetItem),
ForceAsset(AssetItem),

ForceAssetToNetworkMap(AssetToNetwork),

Expand Down
23 changes: 16 additions & 7 deletions mantis/node/tests/cvms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,6 @@ async fn cvm_devnet_case() {
)
.unwrap();




let active_orders = vec![a_to_b, b_to_a];
let alice = from_mnemonic(
"document prefer nurse marriage flavor cheese west when knee drink sorry minimum thunder tilt cherry behave cute stove elder couch badge gown coral expire",
Expand All @@ -157,9 +154,9 @@ async fn cvm_devnet_case() {
sequence: 1,
},
};
let force_config = cw_cvm_outpost::

let router = "shortest_path";
let cvm_glt = Some(CvmGlt {
let cvm_glt = CvmGlt {
network_to_networks: vec![
NetworkToNetworkItem::new(1.into(), 2.into(), OtherNetworkItem::new()),
NetworkToNetworkItem::new(2.into(), 1.into(), OtherNetworkItem::new()),
Expand Down Expand Up @@ -243,9 +240,21 @@ async fn cvm_devnet_case() {
21.into(),
),
],
});
};

let mut config_messages = vec![];

for network_item in cvm_glt {
let config_message = cw_cvm_outpost::msg::ConfigSubMsg::ForceNetwork(network_item);
config_messages.push(config_message);
}

let force_config = cw_cvm_outpost::msg::ExecuteMsg::Config(
cw_cvm_outpost::msg::ConfigSubMsg::Force(config_messages),
);

let solution =
mantis_node::mantis::blackbox::solve::<True>(active_orders, &alice, &tip, cvm_glt, router)
mantis_node::mantis::blackbox::solve::<True>(active_orders, &alice, &tip, cvm_glt.into(), router)
.await;

panic!("solution: {:?}", solution);
Expand Down

0 comments on commit e5ef00c

Please sign in to comment.