diff --git a/tools/integration-test/src/tests/client_expiration.rs b/tools/integration-test/src/tests/client_expiration.rs index c75b7bc191..234bea6b1c 100644 --- a/tools/integration-test/src/tests/client_expiration.rs +++ b/tools/integration-test/src/tests/client_expiration.rs @@ -213,7 +213,7 @@ impl BinaryChainTest for ChannelExpirationTest { }, // From simapp version v7.1.0 if `ConnOpenInit` is sent while the client // is expired, an error will be returned. - Err(e) => match chains.node_a.chain_driver().value().chain_type { + Err(e) => match chains.node_b.chain_driver().value().chain_type { ChainType::Namada => { // See https://github.com/cosmos/ibc-rs/blob/v0.53.0/ibc-core/ics02-client/types/src/error.rs#L22 assert!(e.to_string().contains("client is not active. Status=`Expired`")) diff --git a/tools/integration-test/src/tests/tendermint/sequential.rs b/tools/integration-test/src/tests/tendermint/sequential.rs index 4bfbb7e15f..69177ade2b 100644 --- a/tools/integration-test/src/tests/tendermint/sequential.rs +++ b/tools/integration-test/src/tests/tendermint/sequential.rs @@ -3,6 +3,7 @@ use std::time::Instant; use ibc_relayer::chain::tracking::TrackedMsgs; use ibc_relayer::config::types::max_msg_num::MaxMsgNum; use ibc_relayer::config::ChainConfig; +use ibc_test_framework::chain::chain_type::ChainType; use ibc_test_framework::chain::config; use ibc_test_framework::prelude::*; use ibc_test_framework::relayer::transfer::build_transfer_message; @@ -104,16 +105,28 @@ impl BinaryChannelTest for SequentialCommitTest { TOTAL_MESSAGES, duration ); - // Time taken for submitting sequential batches should be around number of transactions * block time - - assert!( - duration - > Duration::from_millis((BLOCK_TIME_MILLIS * TOTAL_TRANSACTIONS as u64) - 1000) - ); - assert!( - duration - < Duration::from_millis((BLOCK_TIME_MILLIS * TOTAL_TRANSACTIONS as u64) + 1000) - ); + let (min_duration, max_duration) = match chains.node_a.chain_driver().value().chain_type + { + ChainType::Namada => ( + Duration::from_millis((BLOCK_TIME_MILLIS * TOTAL_TRANSACTIONS as u64) - 1000), + Duration::from_millis( + (BLOCK_TIME_MILLIS * TOTAL_TRANSACTIONS as u64) * 2 + 1000, + ), + ), + _ => { + // Time taken for submitting sequential batches should be around number of transactions * block time + ( + Duration::from_millis( + (BLOCK_TIME_MILLIS * TOTAL_TRANSACTIONS as u64) - 1000, + ), + Duration::from_millis( + (BLOCK_TIME_MILLIS * TOTAL_TRANSACTIONS as u64) + 1000, + ), + ) + } + }; + assert!(duration > min_duration); + assert!(duration < max_duration); } { @@ -150,7 +163,11 @@ impl BinaryChannelTest for SequentialCommitTest { TOTAL_MESSAGES, duration ); - assert!(duration < Duration::from_millis(BLOCK_TIME_MILLIS * 3)); + let max_duration = match chains.node_b.chain_driver().value().chain_type { + ChainType::Namada => Duration::from_millis(BLOCK_TIME_MILLIS * 2 * 2), + _ => Duration::from_millis(BLOCK_TIME_MILLIS * 2), + }; + assert!(duration < max_duration); } Ok(()) diff --git a/tools/test-framework/src/ibc/denom.rs b/tools/test-framework/src/ibc/denom.rs index cfa4779258..54b742c079 100644 --- a/tools/test-framework/src/ibc/denom.rs +++ b/tools/test-framework/src/ibc/denom.rs @@ -20,6 +20,7 @@ pub enum Denom { Base { display_name: String, raw_address: String, + token_denom: u8, }, Ibc { path: String, @@ -94,17 +95,26 @@ fn derive_cosmos_ibc_denom( } match denom.value() { - Denom::Base { raw_address, .. } => { + Denom::Base { + raw_address, + token_denom, + .. + } => { let hashed = derive_denom(port_id.value(), channel_id.value(), raw_address)?; Ok(MonoTagged::new(Denom::Ibc { path: format!("{port_id}/{channel_id}"), denom: Box::new((*denom.value()).clone()), hashed, - token_denom: 0, + token_denom: *token_denom, })) } - Denom::Ibc { path, denom, .. } => { + Denom::Ibc { + path, + denom, + token_denom, + .. + } => { let new_path = format!("{port_id}/{channel_id}/{path}"); let hashed = derive_denom_with_path(&format!("{new_path}/{denom}"))?; @@ -112,7 +122,7 @@ fn derive_cosmos_ibc_denom( path: new_path, denom: denom.clone(), hashed, - token_denom: 0, + token_denom: *token_denom, })) } } @@ -124,7 +134,11 @@ fn derive_namada_ibc_denom( denom: &TaggedDenomRef, ) -> Result, Error> { match denom.value() { - Denom::Base { raw_address, .. } => { + Denom::Base { + raw_address, + token_denom, + .. + } => { let path = format!("{port_id}/{channel_id}"); let ibc_token_addr = namada_ibc::trace::ibc_token(format!("{path}/{raw_address}")); @@ -132,10 +146,15 @@ fn derive_namada_ibc_denom( path, denom: Box::new((*denom.value()).clone()), hashed: ibc_token_addr.to_string(), - token_denom: 6, + token_denom: *token_denom, })) } - Denom::Ibc { path, denom, .. } => { + Denom::Ibc { + path, + denom, + token_denom, + .. + } => { let new_path = format!("{port_id}/{channel_id}/{path}"); let ibc_token_addr = namada_ibc::trace::ibc_token(format!("{new_path}/{}", denom.hash_only())); @@ -144,7 +163,7 @@ fn derive_namada_ibc_denom( path: new_path, denom: denom.clone(), hashed: ibc_token_addr.to_string(), - token_denom: 6, + token_denom: *token_denom, })) } } @@ -155,6 +174,7 @@ impl Denom { Denom::Base { display_name: display_name.to_owned(), raw_address: raw_address.to_owned(), + token_denom: if display_name == "nam" { 6 } else { 0 }, } } @@ -210,12 +230,14 @@ impl PartialEq for Denom { Self::Base { display_name: d1, raw_address: a1, + token_denom: td1, }, Self::Base { display_name: d2, raw_address: a2, + token_denom: td2, }, - ) => (d1 == d2) && (a1 == a2), + ) => (d1 == d2) && (a1 == a2) && (td1 == td2), ( Self::Ibc { path: p1,