Skip to content

Commit

Permalink
quick setup
Browse files Browse the repository at this point in the history
  • Loading branch information
dzmitry-lahoda committed Apr 11, 2024
1 parent 57cb25a commit 7743ca7
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 1 deletion.
22 changes: 22 additions & 0 deletions crates/cvm-route/src/transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,17 @@ pub struct NetworkToNetworkItem {
pub closed: Option<u64>,
}

impl NetworkToNetworkItem {
pub fn new(from_network_id: NetworkId, to_network_id: NetworkId, to_network: OtherNetworkItem) -> Self {
Self {
from_network_id,
to_network_id,
to_network,
closed: None,
}
}
}

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[serde(rename_all = "snake_case")]
#[cfg_attr(
Expand All @@ -40,6 +51,17 @@ pub struct OtherNetworkItem {
pub use_shortcut: Option<bool>,
}

impl OtherNetworkItem {
pub fn new() -> Self {
Self {
ics_20: None,
counterparty_timeout: RelativeTimeout::Seconds(10),
ics27_channel: None,
use_shortcut: None,
}
}
}

/// we need both, so we can unwrap
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq)]
#[serde(rename_all = "snake_case")]
Expand Down
6 changes: 5 additions & 1 deletion mantis/node/tests/cvms.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use bounded_collections::Get;
use cosmrs::tendermint::block::Height;
use cosmwasm_std::{Addr, Coin, Coins, Empty};
use cvm_route::transport::NetworkToNetworkItem;
use cw_cvm_outpost::msg::{CvmGlt, HereItem};
use cw_mantis_order::{OrderItem, OrderSubMsg};
use cw_multi_test::{App, Contract, ContractWrapper, Executor};
Expand Down Expand Up @@ -123,7 +124,10 @@ async fn cvm_devnet_case() {
};
let router = "shortest_path";
let cvm_glt = Some(CvmGlt {
network_to_networks: todo!(),
network_to_networks: vec![
NetworkToNetworkItem::new(1.into(), 2.into(), OtherNetworkItem::new()),
NetworkToNetworkItem::new(2.into(), 1.into(), OtherNetworkItem::new()),
],
assets: todo!(),
exchanges: todo!(),
networks: todo!(),
Expand Down

0 comments on commit 7743ca7

Please sign in to comment.