From a48fae014c1e772a20178cde77343bef1b66439f Mon Sep 17 00:00:00 2001 From: Aaron Kutch Date: Fri, 17 Nov 2023 01:22:56 -0600 Subject: [PATCH] update --- tests/Cargo.toml | 2 +- tests/src/bin/ics_with_onomyd.rs | 43 ++++++++++++++++++-------------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/tests/Cargo.toml b/tests/Cargo.toml index 4427406..8af05d1 100644 --- a/tests/Cargo.toml +++ b/tests/Cargo.toml @@ -12,6 +12,6 @@ path = "src/lib/common.rs" clap = { version = "4", features = ["derive"] } log = "0.4" #onomy_test_lib = { path = "./../../onomy_tests/onomy_test_lib" } -onomy_test_lib = { git = "https://github.com/pendulum-labs/onomy_tests", rev = "08143eb6f399470404515f7fd1d4b20b466b540c" } +onomy_test_lib = { git = "https://github.com/pendulum-labs/onomy_tests", rev = "4f67962483864893239c5882ad43f8e383c70c70" } serde_json = "1.0" tokio = { version = "1", default-features = false } diff --git a/tests/src/bin/ics_with_onomyd.rs b/tests/src/bin/ics_with_onomyd.rs index a6c881b..b761a00 100644 --- a/tests/src/bin/ics_with_onomyd.rs +++ b/tests/src/bin/ics_with_onomyd.rs @@ -19,9 +19,7 @@ use onomy_test_lib::{ HermesChainConfig, IbcPair, }, onomy_std_init, reprefix_bech32, - setups::{ - cosmovisor_add_consumer, marketd_setup, onomyd_setup, test_proposal, CosmosSetupOptions, - }, + setups::{cosmovisor_add_consumer, cosmovisor_setup, test_proposal, CosmosSetupOptions}, super_orchestrator::{ docker::{Container, ContainerNetwork, Dockerfile}, net_message::NetMessenger, @@ -182,9 +180,10 @@ async fn hermes_runner(args: &Args) -> Result<()> { // wait for setup nm_onomyd.recv::<()>().await.stack()?; - let ibc_pair = IbcPair::hermes_setup_ics_pair(CONSUMER_ID, "onomy") - .await - .stack()?; + let ibc_pair = + IbcPair::hermes_setup_ics_pair(CONSUMER_ID, "07-tendermint-0", "onomy", "07-tendermint-0") + .await + .stack()?; let mut hermes_runner = hermes_start("/logs/hermes_bootstrap_runner.log") .await .stack()?; @@ -226,11 +225,14 @@ async fn onomyd_runner(args: &Args) -> Result<()> { .stack() .stack()?; - let mnemonic = onomyd_setup(CosmosSetupOptions::new(daemon_home)) + let cosmores = cosmovisor_setup(CosmosSetupOptions::onomy(daemon_home)) .await .stack()?; // send mnemonic to hermes - nm_hermes.send::(&mnemonic).await.stack()?; + nm_hermes + .send::(&cosmores.hermes_mnemonic.stack()?) + .await + .stack()?; // keep these here for local testing purposes let addr = &cosmovisor_get_addr("validator").await.stack()?; @@ -290,7 +292,7 @@ async fn onomyd_runner(args: &Args) -> Result<()> { .await .stack()?; // it takes time for the relayer to complete relaying - wait_for_num_blocks(5).await.stack()?; + wait_for_num_blocks(4).await.stack()?; // notify consumer that we have sent NOM nm_consumer.send::(&ibc_pair).await.stack()?; @@ -334,9 +336,15 @@ async fn consumer(args: &Args) -> Result<()> { // we need the initial consumer state let ccvconsumer_state_s: String = nm_onomyd.recv().await.stack()?; - marketd_setup(daemon_home, chain_id, &ccvconsumer_state_s) - .await - .stack()?; + cosmovisor_setup(CosmosSetupOptions::new( + daemon_home, + chain_id, + "anative", + "anative", + Some(&ccvconsumer_state_s), + )) + .await + .stack()?; // get keys let node_key = nm_onomyd.recv::().await.stack()?; @@ -407,16 +415,13 @@ async fn consumer(args: &Args) -> Result<()> { .stack()?; info!("sending back to {}", test_addr); - // avoid conflict with hermes relayer - wait_for_num_blocks(5).await.stack()?; - // send some IBC NOM back to origin chain using it as gas ibc_pair .a .cosmovisor_ibc_transfer("validator", test_addr, "5000", ibc_nom) .await .stack()?; - wait_for_num_blocks(6).await.stack()?; + wait_for_num_blocks(4).await.stack()?; let pubkey = sh_cosmovisor(["tendermint show-validator"]).await.stack()?; let pubkey = pubkey.trim(); @@ -434,7 +439,7 @@ async fn consumer(args: &Args) -> Result<()> { "--min-self-delegation", "1", "--amount", - &token18(500.0, ONOMY_IBC_NOM), + &token18(500.0, "anative"), "--fees", &format!("1000000{ONOMY_IBC_NOM}"), "--pubkey", @@ -455,7 +460,7 @@ async fn consumer(args: &Args) -> Result<()> { wait_for_num_blocks(1).await.stack()?; // test a simple text proposal - let test_deposit = token18(500.0, ONOMY_IBC_NOM); + let test_deposit = token18(500.0, "anative"); let proposal = json!({ "title": "Text Proposal", "description": "a text proposal", @@ -475,7 +480,7 @@ async fn consumer(args: &Args) -> Result<()> { // but first, test governance with IBC NOM as the token let test_crisis_denom = ONOMY_IBC_NOM; - let test_deposit = token18(500.0, ONOMY_IBC_NOM); + let test_deposit = token18(500.0, "anative"); wait_for_num_blocks(1).await.stack()?; cosmovisor_gov_file_proposal( daemon_home,