Skip to content

Commit

Permalink
fix for v0.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
yito88 committed Oct 21, 2022
1 parent 48cdf0b commit 74a52a7
Show file tree
Hide file tree
Showing 8 changed files with 4,289 additions and 156 deletions.
670 changes: 657 additions & 13 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ tendermint-config = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev
tendermint-proto = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "87be41b8c9cc2850830f4d8028c1fe1bd9f96284"}
tendermint-rpc = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "87be41b8c9cc2850830f4d8028c1fe1bd9f96284"}
tendermint-testgen = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "87be41b8c9cc2850830f4d8028c1fe1bd9f96284"}
tendermint-light-client = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "87be41b8c9cc2850830f4d8028c1fe1bd9f96284"}
tendermint-light-client-verifier = {git = "https://github.com/heliaxdev/tendermint-rs.git", rev = "87be41b8c9cc2850830f4d8028c1fe1bd9f96284"}

# patched to a commit on the `eth-bridge-integration` branch of our fork
ibc = {git = "https://github.com/heliaxdev/ibc-rs.git", rev = "f4703dfe2c1f25cc431279ab74f10f3e0f6827e2"}
ibc-proto = {git = "https://github.com/heliaxdev/ibc-rs.git", rev = "f4703dfe2c1f25cc431279ab74f10f3e0f6827e2"}
ibc-relayer = {git = "https://github.com/heliaxdev/ibc-rs.git", rev = "f4703dfe2c1f25cc431279ab74f10f3e0f6827e2"}

# patched to a commit on the `eth-bridge-integration` branch of our fork
tower-abci = {git = "https://github.com/heliaxdev/tower-abci.git", rev = "fcc0014d0bda707109901abfa1b2f782d242f082"}
Expand Down
10 changes: 7 additions & 3 deletions tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,18 @@ namada_vp_prelude = {path = "../vp_prelude"}
namada_tx_prelude = {path = "../tx_prelude"}
chrono = {version = "0.4.22", default-features = false, features = ["clock", "std"]}
concat-idents = "1.1.2"
ibc = {version = "0.14.0", default-features = false}
ibc-proto = {version = "0.17.1", default-features = false}
ibc-relayer = {version = "0.14.0", default-features = false}
prost = "0.9.0"
ibc-relayer = {git = "https://github.com/heliaxdev/ibc-rs", rev = "9fcc1c8c19db6af50806ffe5b2f6c214adcbfd5d", default-features = false}
serde_json = {version = "1.0.65"}
sha2 = "0.9.3"
test-log = {version = "0.2.7", default-features = false, features = ["trace"]}
tempfile = "3.2.0"
tendermint-config = {git = "https://github.com/heliaxdev/tendermint-rs", rev = "95c52476bc37927218374f94ac8e2a19bd35bec9"}
tendermint-rpc = {git = "https://github.com/heliaxdev/tendermint-rs", rev = "95c52476bc37927218374f94ac8e2a19bd35bec9"}
tendermint = "0.23.6"
tendermint-config = "0.23.6"
tendermint-proto = "0.23.6"
tendermint-rpc = {version = "0.23.6", features = ["http-client"]}
tokio = {version = "1.8.2", features = ["full"]}
tracing = "0.1.30"
tracing-subscriber = {version = "0.3.7", default-features = false, features = ["env-filter", "fmt"]}
Expand Down
102 changes: 49 additions & 53 deletions tests/src/e2e/ibc_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,75 +15,73 @@ use core::time::Duration;

use color_eyre::eyre::Result;
use eyre::eyre;
use ibc_relayer::config::types::{MaxMsgNum, MaxTxSize, Memo};
use ibc_relayer::config::{AddressType, ChainConfig, GasPrice, PacketFilter};
use ibc_relayer::keyring::Store;
use ibc_relayer::light_client::tendermint::LightClient as TmLightClient;
use ibc_relayer::light_client::{LightClient, Verified};
use namada::ibc::applications::ics20_fungible_token_transfer::msgs::transfer::MsgTransfer;
use namada::ibc::clients::ics07_tendermint::client_state::{
use ibc::applications::ics20_fungible_token_transfer::msgs::transfer::MsgTransfer;
use ibc::clients::ics07_tendermint::client_state::{
AllowUpdate, ClientState as TmClientState,
};
use namada::ibc::clients::ics07_tendermint::consensus_state::ConsensusState as TmConsensusState;
use namada::ibc::core::ics02_client::client_consensus::{
use ibc::clients::ics07_tendermint::consensus_state::ConsensusState as TmConsensusState;
use ibc::core::ics02_client::client_consensus::{
AnyConsensusState, ConsensusState,
};
use namada::ibc::core::ics02_client::client_state::{
AnyClientState, ClientState,
};
use namada::ibc::core::ics02_client::header::Header;
use namada::ibc::core::ics02_client::height::Height;
use namada::ibc::core::ics02_client::msgs::create_client::MsgCreateAnyClient;
use namada::ibc::core::ics02_client::msgs::update_client::MsgUpdateAnyClient;
use namada::ibc::core::ics02_client::trust_threshold::TrustThreshold;
use namada::ibc::core::ics03_connection::connection::Counterparty as ConnCounterparty;
use namada::ibc::core::ics03_connection::msgs::conn_open_ack::MsgConnectionOpenAck;
use namada::ibc::core::ics03_connection::msgs::conn_open_confirm::MsgConnectionOpenConfirm;
use namada::ibc::core::ics03_connection::msgs::conn_open_init::MsgConnectionOpenInit;
use namada::ibc::core::ics03_connection::msgs::conn_open_try::MsgConnectionOpenTry;
use namada::ibc::core::ics03_connection::version::Version as ConnVersion;
use namada::ibc::core::ics04_channel::channel::{
use ibc::core::ics02_client::client_state::{AnyClientState, ClientState};
use ibc::core::ics02_client::header::Header;
use ibc::core::ics02_client::height::Height;
use ibc::core::ics02_client::msgs::create_client::MsgCreateAnyClient;
use ibc::core::ics02_client::msgs::update_client::MsgUpdateAnyClient;
use ibc::core::ics02_client::trust_threshold::TrustThreshold;
use ibc::core::ics03_connection::connection::Counterparty as ConnCounterparty;
use ibc::core::ics03_connection::msgs::conn_open_ack::MsgConnectionOpenAck;
use ibc::core::ics03_connection::msgs::conn_open_confirm::MsgConnectionOpenConfirm;
use ibc::core::ics03_connection::msgs::conn_open_init::MsgConnectionOpenInit;
use ibc::core::ics03_connection::msgs::conn_open_try::MsgConnectionOpenTry;
use ibc::core::ics03_connection::version::Version as ConnVersion;
use ibc::core::ics04_channel::channel::{
ChannelEnd, Counterparty as ChanCounterparty, Order as ChanOrder,
State as ChanState,
};
use namada::ibc::core::ics04_channel::msgs::acknowledgement::MsgAcknowledgement;
use namada::ibc::core::ics04_channel::msgs::chan_close_confirm::MsgChannelCloseConfirm;
use namada::ibc::core::ics04_channel::msgs::chan_close_init::MsgChannelCloseInit;
use namada::ibc::core::ics04_channel::msgs::chan_open_ack::MsgChannelOpenAck;
use namada::ibc::core::ics04_channel::msgs::chan_open_confirm::MsgChannelOpenConfirm;
use namada::ibc::core::ics04_channel::msgs::chan_open_init::MsgChannelOpenInit;
use namada::ibc::core::ics04_channel::msgs::chan_open_try::MsgChannelOpenTry;
use namada::ibc::core::ics04_channel::msgs::recv_packet::MsgRecvPacket;
use namada::ibc::core::ics04_channel::msgs::timeout::MsgTimeout;
use namada::ibc::core::ics04_channel::msgs::timeout_on_close::MsgTimeoutOnClose;
use namada::ibc::core::ics04_channel::packet::Packet;
use namada::ibc::core::ics04_channel::Version as ChanVersion;
use namada::ibc::core::ics23_commitment::commitment::CommitmentProofBytes;
use namada::ibc::core::ics23_commitment::merkle::convert_tm_to_ics_merkle_proof;
use namada::ibc::core::ics24_host::identifier::{
use ibc::core::ics04_channel::msgs::acknowledgement::MsgAcknowledgement;
use ibc::core::ics04_channel::msgs::chan_close_confirm::MsgChannelCloseConfirm;
use ibc::core::ics04_channel::msgs::chan_close_init::MsgChannelCloseInit;
use ibc::core::ics04_channel::msgs::chan_open_ack::MsgChannelOpenAck;
use ibc::core::ics04_channel::msgs::chan_open_confirm::MsgChannelOpenConfirm;
use ibc::core::ics04_channel::msgs::chan_open_init::MsgChannelOpenInit;
use ibc::core::ics04_channel::msgs::chan_open_try::MsgChannelOpenTry;
use ibc::core::ics04_channel::msgs::recv_packet::MsgRecvPacket;
use ibc::core::ics04_channel::msgs::timeout::MsgTimeout;
use ibc::core::ics04_channel::msgs::timeout_on_close::MsgTimeoutOnClose;
use ibc::core::ics04_channel::packet::Packet;
use ibc::core::ics04_channel::Version as ChanVersion;
use ibc::core::ics23_commitment::commitment::CommitmentProofBytes;
use ibc::core::ics23_commitment::merkle::convert_tm_to_ics_merkle_proof;
use ibc::core::ics24_host::identifier::{
ChainId, ClientId, ConnectionId, PortChannelId, PortId,
};
use namada::ibc::events::{from_tx_response_event, IbcEvent};
use namada::ibc::proofs::{ConsensusProof, Proofs};
use namada::ibc::signer::Signer;
use namada::ibc::timestamp::Timestamp;
use namada::ibc::tx_msg::Msg;
use namada::ibc_proto::cosmos::base::v1beta1::Coin;
use ibc::events::{from_tx_response_event, IbcEvent};
use ibc::proofs::{ConsensusProof, Proofs};
use ibc::signer::Signer;
use ibc::timestamp::Timestamp;
use ibc::tx_msg::Msg;
use ibc_proto::cosmos::base::v1beta1::Coin;
use ibc_relayer::config::types::{MaxMsgNum, MaxTxSize, Memo};
use ibc_relayer::config::{AddressType, ChainConfig, GasPrice, PacketFilter};
use ibc_relayer::keyring::Store;
use ibc_relayer::light_client::tendermint::LightClient as TmLightClient;
use ibc_relayer::light_client::{LightClient, Verified};
use namada::ledger::ibc::handler::{commitment_prefix, port_channel_id};
use namada::ledger::ibc::storage::*;
use namada::ledger::storage::ics23_specs::ibc_proof_specs;
use namada::ledger::storage::Sha256Hasher;
use namada::tendermint::block::Header as TmHeader;
use namada::tendermint::merkle::proof::Proof as TmProof;
use namada::tendermint::trust_threshold::TrustThresholdFraction;
use namada::tendermint_proto::Protobuf;
use namada::types::address::{Address, InternalAddress};
use namada::types::key::PublicKey;
use namada::types::storage::{BlockHeight, Key};
use namada_apps::client::rpc::query_storage_value_bytes;
use namada_apps::client::utils::id_from_pk;
use setup::constants::*;
use tendermint::block::Header as TmHeader;
use tendermint::merkle::proof::Proof as TmProof;
use tendermint::trust_threshold::TrustThresholdFraction;
use tendermint_config::net::Address as TendermintAddress;
use tendermint_proto::Protobuf;
use tendermint_rpc::{Client, HttpClient, Url};
use tokio::runtime::Runtime;

Expand Down Expand Up @@ -1244,7 +1242,6 @@ fn check_balances(
test_a: &Test,
test_b: &Test,
) -> Result<()> {
let sender = find_address(test_a, ALBERT)?;
let token = find_address(test_a, XAN)?;

// Check the balances on Chain A
Expand All @@ -1253,7 +1250,7 @@ fn check_balances(
vec!["balance", "--token", XAN, "--ledger-address", &rpc_a];
let mut client = run!(test_a, Bin::Client, query_args, Some(40))?;
// Check the source balance
let expected = format!(": 900000, owned by {}", sender);
let expected = ": 900000, owned by albert".to_string();
client.exp_string(&expected)?;
// Check the escrowed balance
let key_prefix = ibc_account_prefix(
Expand Down Expand Up @@ -1355,7 +1352,6 @@ fn check_balances_after_back(
test_a: &Test,
test_b: &Test,
) -> Result<()> {
let sender = find_address(test_a, ALBERT)?;
let token = find_address(test_b, XAN)?;

// Check the balances on Chain A
Expand All @@ -1364,7 +1360,7 @@ fn check_balances_after_back(
vec!["balance", "--token", XAN, "--ledger-address", &rpc_a];
let mut client = run!(test_a, Bin::Client, query_args, Some(40))?;
// Check the source balance
let expected = format!(": 950000, owned by {}", sender);
let expected = ": 950000, owned by albert".to_string();
client.exp_string(&expected)?;
// Check the escrowed balance
let key_prefix = ibc_account_prefix(
Expand Down
Loading

0 comments on commit 74a52a7

Please sign in to comment.