From e5ef00c276130d54622f0cfbfb196edda9637807 Mon Sep 17 00:00:00 2001 From: dzmitry-lahoda Date: Fri, 12 Apr 2024 13:40:31 +0100 Subject: [PATCH] producing rust code --- crates/cvm-runtime/src/outpost/config.rs | 6 +++--- mantis/node/tests/cvms.rs | 23 ++++++++++++++++------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/crates/cvm-runtime/src/outpost/config.rs b/crates/cvm-runtime/src/outpost/config.rs index 37f8d845..39df4237 100644 --- a/crates/cvm-runtime/src/outpost/config.rs +++ b/crates/cvm-runtime/src/outpost/config.rs @@ -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)] @@ -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), diff --git a/mantis/node/tests/cvms.rs b/mantis/node/tests/cvms.rs index f4cf41ef..163c7ed8 100644 --- a/mantis/node/tests/cvms.rs +++ b/mantis/node/tests/cvms.rs @@ -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", @@ -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()), @@ -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::(active_orders, &alice, &tip, cvm_glt, router) + mantis_node::mantis::blackbox::solve::(active_orders, &alice, &tip, cvm_glt.into(), router) .await; panic!("solution: {:?}", solution);