Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restructure modules to align with ibc-go's structure #1459

Merged
merged 13 commits into from
Oct 27, 2021
Merged
Prev Previous commit
Next Next commit
Fix broken imports in telemetry, relayer, and relayer-cli
  • Loading branch information
seanchen1991 committed Oct 14, 2021
commit bca5772563d1e525768049050a98e4718cc7c7b0
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ __pycache__/
# Ignore modelator aritfacts
.modelator
mc.log

# Ignore OSX .DS_Store file
.DS_Store
6 changes: 3 additions & 3 deletions relayer-cli/src/cli_utils.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use alloc::sync::Arc;
use tokio::runtime::Runtime as TokioRuntime;

use ibc::ics02_client::client_state::ClientState;
use ibc::ics04_channel::channel::IdentifiedChannelEnd;
use ibc::ics24_host::identifier::{ChainId, ChannelId, PortId};
use ibc::core::ics02_client::client_state::ClientState;
use ibc::core::ics04_channel::channel::IdentifiedChannelEnd;
use ibc::core::ics24_host::identifier::{ChainId, ChannelId, PortId};
use ibc_relayer::chain::counterparty::channel_connection_client;
use ibc_relayer::{
chain::{
Expand Down
8 changes: 4 additions & 4 deletions relayer-cli/src/commands/create/channel.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use abscissa_core::{Command, Options, Runnable};

use ibc::ics02_client::client_state::ClientState;
use ibc::ics03_connection::connection::IdentifiedConnectionEnd;
use ibc::ics04_channel::channel::Order;
use ibc::ics24_host::identifier::{ChainId, ConnectionId, PortId};
use ibc::core::ics02_client::client_state::ClientState;
use ibc::core::ics03_connection::connection::IdentifiedConnectionEnd;
use ibc::core::ics04_channel::channel::Order;
use ibc::core::ics24_host::identifier::{ChainId, ConnectionId, PortId};
use ibc::Height;
use ibc_relayer::chain::handle::ChainHandle;
use ibc_relayer::channel::Channel;
Expand Down
4 changes: 2 additions & 2 deletions relayer-cli/src/commands/create/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use core::time::Duration;

use abscissa_core::{Command, Options, Runnable};

use ibc::ics02_client::client_state::ClientState;
use ibc::ics24_host::identifier::{ChainId, ClientId};
use ibc::core::ics02_client::client_state::ClientState;
use ibc::core::ics24_host::identifier::{ChainId, ClientId};
use ibc::Height;
use ibc_relayer::chain::handle::ChainHandle;
use ibc_relayer::connection::Connection;
Expand Down
2 changes: 1 addition & 1 deletion relayer-cli/src/commands/keys/add.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::{

use abscissa_core::{Command, Options, Runnable};

use ibc::ics24_host::identifier::ChainId;
use ibc::core::ics24_host::identifier::ChainId;
use ibc_relayer::{
config::{ChainConfig, Config},
keyring::{HDPath, KeyEntry, KeyRing, Store},
Expand Down
2 changes: 1 addition & 1 deletion relayer-cli/src/commands/keys/delete.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use abscissa_core::{Command, Options, Runnable};

use ibc::ics24_host::identifier::ChainId;
use ibc::core::ics24_host::identifier::ChainId;
use ibc_relayer::{
config::{ChainConfig, Config},
keyring::{KeyRing, Store},
Expand Down
2 changes: 1 addition & 1 deletion relayer-cli/src/commands/keys/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use alloc::collections::btree_map::BTreeMap as HashMap;

use abscissa_core::{Command, Options, Runnable};

use ibc::ics24_host::identifier::ChainId;
use ibc::core::ics24_host::identifier::ChainId;
use ibc_relayer::{
config::{ChainConfig, Config},
keyring::{KeyEntry, KeyRing, Store},
Expand Down
2 changes: 1 addition & 1 deletion relayer-cli/src/commands/keys/restore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use core::str::FromStr;

use abscissa_core::{Command, Options, Runnable};

use ibc::ics24_host::identifier::ChainId;
use ibc::core::ics24_host::identifier::ChainId;
use ibc_relayer::{
config::{ChainConfig, Config},
keyring::{HDPath, KeyEntry, KeyRing, Store},
Expand Down
8 changes: 4 additions & 4 deletions relayer-cli/src/commands/misbehaviour.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use abscissa_core::{config, Command, Options, Runnable};
use ibc::events::IbcEvent;
use ibc::ics02_client::events::UpdateClient;
use ibc::ics02_client::height::Height;
use ibc::ics24_host::identifier::{ChainId, ClientId};
use ibc::core::ics02_client::events::UpdateClient;
use ibc::core::ics02_client::height::Height;
use ibc::core::ics24_host::identifier::{ChainId, ClientId};
use ibc_relayer::chain::handle::ChainHandle;
use ibc_relayer::foreign_client::{ForeignClient, MisbehaviourResults};
use std::ops::Deref;
Expand All @@ -11,7 +11,7 @@ use crate::application::CliApp;
use crate::cli_utils::{spawn_chain_runtime, spawn_chain_runtime_generic};
use crate::conclude::Output;
use crate::prelude::*;
use ibc::ics02_client::client_state::ClientState;
use ibc::core::ics02_client::client_state::ClientState;

#[derive(Clone, Command, Debug, Options)]
pub struct MisbehaviourCmd {
Expand Down
6 changes: 3 additions & 3 deletions relayer-cli/src/commands/query/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ use alloc::sync::Arc;
use abscissa_core::{Command, Options, Runnable};
use tokio::runtime::Runtime as TokioRuntime;

use ibc::ics24_host::identifier::ChainId;
use ibc::ics24_host::identifier::{ChannelId, PortId};
use ibc::core::ics24_host::identifier::ChainId;
use ibc::core::ics24_host::identifier::{ChannelId, PortId};
use ibc_relayer::chain::{ChainEndpoint, CosmosSdkChain};

use crate::conclude::Output;
use crate::prelude::*;
use ibc::ics04_channel::channel::State;
use ibc::core::ics04_channel::channel::State;

#[derive(Clone, Command, Debug, Options)]
pub struct QueryChannelEndCmd {
Expand Down
10 changes: 5 additions & 5 deletions relayer-cli/src/commands/query/channel_ends.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use abscissa_core::{Command, Options, Runnable};
use serde::{Deserialize, Serialize};

use ibc::ics02_client::client_state::{AnyClientState, ClientState};
use ibc::ics03_connection::connection::ConnectionEnd;
use ibc::ics04_channel::channel::{ChannelEnd, State};
use ibc::ics24_host::identifier::ChainId;
use ibc::ics24_host::identifier::{ChannelId, ClientId, ConnectionId, PortId};
use ibc::core::ics02_client::client_state::{AnyClientState, ClientState};
use ibc::core::ics03_connection::connection::ConnectionEnd;
use ibc::core::ics04_channel::channel::{ChannelEnd, State};
use ibc::core::ics24_host::identifier::ChainId;
use ibc::core::ics24_host::identifier::{ChannelId, ClientId, ConnectionId, PortId};
use ibc::Height;
use ibc_relayer::chain::handle::{ChainHandle, ProdChainHandle};
use ibc_relayer::registry::Registry;
Expand Down
6 changes: 3 additions & 3 deletions relayer-cli/src/commands/query/channels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ use core::fmt::{Debug, Error, Formatter};
use abscissa_core::{Options, Runnable};
use serde::Serialize;

use ibc::ics02_client::client_state::ClientState;
use ibc::ics04_channel::channel::{ChannelEnd, State};
use ibc::ics24_host::identifier::{ChainId, ChannelId, ConnectionId, PortChannelId, PortId};
use ibc::core::ics02_client::client_state::ClientState;
use ibc::core::ics04_channel::channel::{ChannelEnd, State};
use ibc::core::ics24_host::identifier::{ChainId, ChannelId, ConnectionId, PortChannelId, PortId};
use ibc::Height;
use ibc_proto::ibc::core::channel::v1::QueryChannelsRequest;
use ibc_relayer::chain::handle::{ChainHandle, ProdChainHandle};
Expand Down
8 changes: 4 additions & 4 deletions relayer-cli/src/commands/query/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ use tokio::runtime::Runtime as TokioRuntime;
use tracing::debug;

use ibc::events::IbcEventType;
use ibc::ics02_client::client_consensus::QueryClientEventRequest;
use ibc::ics02_client::client_state::ClientState;
use ibc::ics24_host::identifier::ChainId;
use ibc::ics24_host::identifier::ClientId;
use ibc::core::ics02_client::client_consensus::QueryClientEventRequest;
use ibc::core::ics02_client::client_state::ClientState;
use ibc::core::ics24_host::identifier::ChainId;
use ibc::core::ics24_host::identifier::ClientId;
use ibc::query::QueryTxRequest;
use ibc::Height;
use ibc_proto::ibc::core::client::v1::QueryConsensusStatesRequest;
Expand Down
4 changes: 2 additions & 2 deletions relayer-cli/src/commands/query/clients.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use abscissa_core::{Command, Options, Runnable};
use serde::Serialize;
use tokio::runtime::Runtime as TokioRuntime;

use ibc::ics02_client::client_state::ClientState;
use ibc::ics24_host::identifier::{ChainId, ClientId};
use ibc::core::ics02_client::client_state::ClientState;
use ibc::core::ics24_host::identifier::{ChainId, ClientId};
use ibc_proto::ibc::core::client::v1::QueryClientStatesRequest;
use ibc_relayer::chain::{ChainEndpoint, CosmosSdkChain};

Expand Down
2 changes: 1 addition & 1 deletion relayer-cli/src/commands/query/connections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use alloc::sync::Arc;
use abscissa_core::{Options, Runnable};
use tokio::runtime::Runtime as TokioRuntime;

use ibc::ics24_host::identifier::{ChainId, ConnectionId};
use ibc::core::ics24_host::identifier::{ChainId, ConnectionId};
use ibc_proto::ibc::core::connection::v1::QueryConnectionsRequest;
use ibc_relayer::chain::{ChainEndpoint, CosmosSdkChain};

Expand Down
4 changes: 2 additions & 2 deletions relayer-cli/src/commands/query/packet/ack.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use abscissa_core::{Command, Options, Runnable};
use subtle_encoding::{Encoding, Hex};

use ibc::ics04_channel::packet::{PacketMsgType, Sequence};
use ibc::ics24_host::identifier::{ChainId, ChannelId, PortId};
use ibc::core::ics04_channel::packet::{PacketMsgType, Sequence};
use ibc::core::ics24_host::identifier::{ChainId, ChannelId, PortId};
use ibc::Height;
use ibc_relayer::chain::handle::ChainHandle;

Expand Down
2 changes: 1 addition & 1 deletion relayer-cli/src/commands/query/packet/acks.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use abscissa_core::{Command, Options, Runnable};
use serde::Serialize;

use ibc::ics24_host::identifier::{ChainId, ChannelId, PortId};
use ibc::core::ics24_host::identifier::{ChainId, ChannelId, PortId};
use ibc::Height;
use ibc_proto::ibc::core::channel::v1::QueryPacketAcknowledgementsRequest;
use ibc_relayer::chain::handle::ChainHandle;
Expand Down
4 changes: 2 additions & 2 deletions relayer-cli/src/commands/query/packet/commitment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use abscissa_core::{Command, Options, Runnable};
use serde::Serialize;
use subtle_encoding::{Encoding, Hex};

use ibc::ics04_channel::packet::{PacketMsgType, Sequence};
use ibc::ics24_host::identifier::{ChainId, ChannelId, PortId};
use ibc::core::ics04_channel::packet::{PacketMsgType, Sequence};
use ibc::core::ics24_host::identifier::{ChainId, ChannelId, PortId};
use ibc::Height;
use ibc_relayer::chain::handle::ChainHandle;

Expand Down
2 changes: 1 addition & 1 deletion relayer-cli/src/commands/query/packet/commitments.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use abscissa_core::{Command, Options, Runnable};
use serde::Serialize;

use ibc::ics24_host::identifier::{ChainId, ChannelId, PortId};
use ibc::core::ics24_host::identifier::{ChainId, ChannelId, PortId};
use ibc::Height;
use ibc_proto::ibc::core::channel::v1::QueryPacketCommitmentsRequest;
use ibc_relayer::chain::handle::ChainHandle;
Expand Down
2 changes: 1 addition & 1 deletion relayer-cli/src/commands/query/packet/unreceived_acks.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use abscissa_core::{Command, Options, Runnable};

use ibc::ics24_host::identifier::{ChainId, ChannelId, PortId};
use ibc::core::ics24_host::identifier::{ChainId, ChannelId, PortId};
use ibc_relayer::chain::counterparty::unreceived_acknowledgements;
use ibc_relayer::chain::handle::ProdChainHandle;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use abscissa_core::{Command, Options, Runnable};
use serde::Serialize;

use ibc::ics24_host::identifier::{ChainId, ChannelId, PortId};
use ibc::core::ics24_host::identifier::{ChainId, ChannelId, PortId};
use ibc::Height;
use ibc_relayer::chain::counterparty::unreceived_packets;
use ibc_relayer::chain::handle::ProdChainHandle;
Expand Down
2 changes: 1 addition & 1 deletion relayer-cli/src/commands/query/tx/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use tracing::debug;

use tendermint::abci::transaction::Hash;

use ibc::ics24_host::identifier::ChainId;
use ibc::core::ics24_host::identifier::ChainId;
use ibc::query::{QueryTxHash, QueryTxRequest};

use ibc_relayer::chain::handle::{ChainHandle, ProdChainHandle};
Expand Down
6 changes: 3 additions & 3 deletions relayer-cli/src/commands/tx/channel.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use abscissa_core::{Command, Options, Runnable};

use ibc::events::IbcEvent;
use ibc::ics03_connection::connection::ConnectionEnd;
use ibc::ics04_channel::channel::Order;
use ibc::ics24_host::identifier::{ChainId, ChannelId, ClientId, ConnectionId, PortId};
use ibc::core::ics03_connection::connection::ConnectionEnd;
use ibc::core::ics04_channel::channel::Order;
use ibc::core::ics24_host::identifier::{ChainId, ChannelId, ClientId, ConnectionId, PortId};
use ibc::Height;
use ibc_relayer::chain::handle::ChainHandle;
use ibc_relayer::channel::{Channel, ChannelSide};
Expand Down
4 changes: 2 additions & 2 deletions relayer-cli/src/commands/tx/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use core::fmt;
use abscissa_core::{config, Command, Options, Runnable};

use ibc::events::IbcEvent;
use ibc::ics02_client::client_state::ClientState;
use ibc::ics24_host::identifier::{ChainId, ClientId};
use ibc::core::ics02_client::client_state::ClientState;
use ibc::core::ics24_host::identifier::{ChainId, ClientId};
use ibc_proto::ibc::core::client::v1::QueryClientStatesRequest;
use ibc_relayer::chain::handle::ChainHandle;
use ibc_relayer::foreign_client::ForeignClient;
Expand Down
2 changes: 1 addition & 1 deletion relayer-cli/src/commands/tx/connection.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use abscissa_core::{Command, Options, Runnable};

use ibc::events::IbcEvent;
use ibc::ics24_host::identifier::{ChainId, ClientId, ConnectionId};
use ibc::core::ics24_host::identifier::{ChainId, ClientId, ConnectionId};
use ibc::timestamp::ZERO_DURATION;
use ibc_relayer::connection::{Connection, ConnectionSide};

Expand Down
2 changes: 1 addition & 1 deletion relayer-cli/src/commands/tx/packet.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use abscissa_core::{Command, Options, Runnable};

use ibc::events::IbcEvent;
use ibc::ics24_host::identifier::{ChainId, ChannelId, PortId};
use ibc::core::ics24_host::identifier::{ChainId, ChannelId, PortId};
use ibc_relayer::link::{Link, LinkParameters};

use crate::cli_utils::ChainHandlePair;
Expand Down
2 changes: 1 addition & 1 deletion relayer-cli/src/commands/tx/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use abscissa_core::{Command, Options, Runnable};
use tokio::runtime::Runtime as TokioRuntime;

use ibc::events::IbcEvent;
use ibc::ics24_host::identifier::{ChainId, ClientId};
use ibc::core::ics24_host::identifier::{ChainId, ClientId};
use ibc_relayer::upgrade_chain::{build_and_send_ibc_upgrade_proposal, UpgradePlanOptions};
use ibc_relayer::{
chain::{ChainEndpoint, CosmosSdkChain},
Expand Down
2 changes: 1 addition & 1 deletion relayer-cli/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use alloc::collections::BTreeSet;
use std::path::PathBuf;

use flex_error::{define_error, TraceError};
use ibc::ics24_host::identifier::ChainId;
use ibc::core::ics24_host::identifier::ChainId;
use ibc_relayer::config::Config;
use tendermint_light_client::types::TrustThreshold;
use tracing_subscriber::filter::ParseError;
Expand Down
4 changes: 2 additions & 2 deletions relayer-cli/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use flex_error::define_error;
use ibc::ics04_channel::channel::IdentifiedChannelEnd;
use ibc::ics24_host::identifier::ChainId;
use ibc::core::ics04_channel::channel::IdentifiedChannelEnd;
use ibc::core::ics24_host::identifier::ChainId;
use ibc_relayer::channel::ChannelError;
use ibc_relayer::connection::ConnectionError;
use ibc_relayer::error::Error as RelayerError;
Expand Down
2 changes: 1 addition & 1 deletion relayer-rest/src/handle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use tracing::error;

use crossbeam_channel as channel;

use ibc::ics24_host::identifier::ChainId;
use ibc::core::ics24_host::identifier::ChainId;
use ibc_relayer::supervisor::dump_state::SupervisorState;
use ibc_relayer::{
config::ChainConfig,
Expand Down
2 changes: 1 addition & 1 deletion relayer-rest/tests/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::str::FromStr;

use serde::{Deserialize, Serialize};

use ibc::ics24_host::identifier::ChainId;
use ibc::core::ics24_host::identifier::ChainId;
use ibc_relayer::{
config::ChainConfig,
rest::request::{Request, VersionInfo},
Expand Down
18 changes: 9 additions & 9 deletions relayer/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ use tokio::runtime::Runtime as TokioRuntime;
pub use cosmos::CosmosSdkChain;

use ibc::events::IbcEvent;
use ibc::ics02_client::client_consensus::{
use ibc::core::ics02_client::client_consensus::{
AnyConsensusState, AnyConsensusStateWithHeight, ConsensusState,
};
use ibc::ics02_client::client_state::{AnyClientState, ClientState, IdentifiedAnyClientState};
use ibc::ics02_client::header::Header;
use ibc::ics03_connection::connection::{ConnectionEnd, IdentifiedConnectionEnd, State};
use ibc::ics03_connection::version::{get_compatible_versions, Version};
use ibc::ics04_channel::channel::{ChannelEnd, IdentifiedChannelEnd};
use ibc::ics04_channel::packet::{PacketMsgType, Sequence};
use ibc::ics23_commitment::commitment::{CommitmentPrefix, CommitmentProofBytes};
use ibc::ics24_host::identifier::{ChainId, ChannelId, ClientId, ConnectionId, PortId};
use ibc::core::ics02_client::client_state::{AnyClientState, ClientState, IdentifiedAnyClientState};
use ibc::core::ics02_client::header::Header;
use ibc::core::ics03_connection::connection::{ConnectionEnd, IdentifiedConnectionEnd, State};
use ibc::core::ics03_connection::version::{get_compatible_versions, Version};
use ibc::core::ics04_channel::channel::{ChannelEnd, IdentifiedChannelEnd};
use ibc::core::ics04_channel::packet::{PacketMsgType, Sequence};
use ibc::core::ics23_commitment::commitment::{CommitmentPrefix, CommitmentProofBytes};
use ibc::core::ics24_host::identifier::{ChainId, ChannelId, ClientId, ConnectionId, PortId};
use ibc::proofs::{ConsensusProof, Proofs};
use ibc::query::QueryTxRequest;
use ibc::signer::Signer;
Expand Down
Loading