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

Clean code #3383

Merged
merged 7 commits into from
Jun 5, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
125 changes: 125 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/chain-registry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ description = """

[dependencies]
ibc-proto = { version = "0.31.0-alpha.2" }
ibc-relayer-types = { version = "0.24.0", path = "../relayer-types", features = ["std"] }
ibc-relayer-types = { version = "0.24.0", path = "../relayer-types" }
tendermint-rpc = { version = "0.32.0", features = ["http-client", "websocket-client"] }

async-trait = "0.1.67"
Expand Down
2 changes: 1 addition & 1 deletion crates/relayer-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ telemetry = ["ibc-relayer/telemetry", "ibc-telemetry"]
rest-server = ["ibc-relayer-rest"]

[dependencies]
ibc-relayer-types = { version = "0.24.0", path = "../relayer-types", features = ["std", "clock"] }
ibc-relayer-types = { version = "0.24.0", path = "../relayer-types" }
ibc-relayer = { version = "0.24.0", path = "../relayer" }
ibc-telemetry = { version = "0.24.0", path = "../telemetry", optional = true }
ibc-relayer-rest = { version = "0.24.0", path = "../relayer-rest", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/relayer-cli/src/commands/config/auto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ impl Runnable for AutoCmd {
.iter_mut()
.zip(names_and_keys.iter().map(|n| &n.1).cloned());

for (mut chain_config, key_option) in configs_and_keys {
for (chain_config, key_option) in configs_and_keys {
// If a key is provided, use it
if let Some(key_name) = key_option {
info!("{}: uses key \"{}\"", &chain_config.id, &key_name);
Expand Down
14 changes: 6 additions & 8 deletions crates/relayer-types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,14 @@ description = """
all-features = true

[features]
default = ["std"]
std = ["flex-error/std", "flex-error/eyre_tracer", "ibc-proto/std", "clock"]
clock = ["tendermint/clock", "time/std"]

clock = []
# This feature grants access to development-time mocking libraries, such as `MockContext` or `MockHeader`.
# Depends on the `testgen` suite for generating Tendermint light blocks.
mocks = ["tendermint-testgen", "clock", "std"]
mocks = ["tendermint-testgen", "clock"]

[dependencies]
# Proto definitions for all IBC-related interfaces, e.g., connections or channels.
ibc-proto = { version = "0.31.0-alpha.2", features = ["std"] }
ibc-proto = { version = "0.31.0-alpha.2" }
ics23 = { version = "0.10.1", features = ["std", "host-functions"] }
time = { version = ">=0.3.0, <0.3.21" }
serde_derive = { version = "1.0.104" }
Expand All @@ -39,15 +36,16 @@ bytes = { version = "1.4.0" }
safe-regex = { version = "0.2.5" }
subtle-encoding = { version = "0.5" }
flex-error = { version = "0.4.4" }
derive_more = { version = "0.99.17", default-features = false, features = ["from", "into", "display"] }
derive_more = { version = "0.99.17", features = ["from", "into", "display"] }
romac marked this conversation as resolved.
Show resolved Hide resolved
uint = { version = "0.9" }
itertools = { version = "0.10.3" }
primitive-types = { version = "0.12.1", default-features = false, features = ["serde_no_std"] }
primitive-types = { version = "0.12.1", features = ["serde_no_std"] }
romac marked this conversation as resolved.
Show resolved Hide resolved
romac marked this conversation as resolved.
Show resolved Hide resolved
dyn-clone = "1.0.8"
num-rational = "0.4.1"

[dependencies.tendermint]
version = "0.32.0"
features = ["clock"]

[dependencies.tendermint-proto]
version = "0.32.0"
Expand Down
1 change: 0 additions & 1 deletion crates/relayer-types/src/applications/ics29_fee/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ use prost::EncodeError;
use crate::applications::transfer::error::Error as TransferError;
use crate::core::ics04_channel::error::Error as ChannelError;
use crate::core::ics24_host::error::ValidationError;
use crate::prelude::*;
use crate::signer::SignerError;

define_error! {
Expand Down
6 changes: 3 additions & 3 deletions crates/relayer-types/src/applications/ics29_fee/events.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
use core::fmt::Display;
use core::str::FromStr;
use itertools::Itertools;
use serde_derive::{Deserialize, Serialize};
use std::fmt::Display;
use std::str::FromStr;
use tendermint::abci;

use super::error::Error;
use crate::applications::transfer::coin::RawCoin;
use crate::core::ics04_channel::packet::Sequence;
use crate::core::ics24_host::identifier::{ChannelId, PortId};
use crate::events::IbcEventType;
use crate::prelude::*;

use crate::signer::Signer;

#[derive(Debug, Clone, Serialize, Deserialize, Eq, PartialEq)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use ibc_proto::ibc::applications::fee::v1::{Fee as ProtoFee, MsgPayPacketFee};
use crate::applications::ics29_fee::error::Error;
use crate::applications::transfer::coin::RawCoin;
use crate::core::ics24_host::identifier::{ChannelId, PortId};
use crate::prelude::*;

use crate::signer::Signer;
use crate::tx_msg::encode_message;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::applications::ics29_fee::error::Error;
use crate::applications::transfer::coin::RawCoin;
use crate::core::ics04_channel::packet::Sequence;
use crate::core::ics24_host::identifier::{ChannelId, PortId};
use crate::prelude::*;

use crate::signer::Signer;
use crate::tx_msg::encode_message;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use ibc_proto::ibc::applications::fee::v1::{MsgRegisterCounterpartyPayee, MsgReg

use crate::applications::ics29_fee::error::Error;
use crate::core::ics24_host::identifier::{ChannelId, PortId};
use crate::prelude::*;

use crate::signer::Signer;
use crate::tx_msg::encode_message;

Expand Down
4 changes: 2 additions & 2 deletions crates/relayer-types/src/applications/ics29_fee/packet_fee.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
use core::str::FromStr;
use ibc_proto::cosmos::base::v1beta1::Coin as ProtoCoin;
use ibc_proto::ibc::applications::fee::v1::{
Fee as ProtoFee, IdentifiedPacketFees as ProtoIdentifiedPacketFees, PacketFee as ProtoPacketFee,
};
use std::str::FromStr;

use super::error::Error;
use crate::applications::transfer::amount::Amount;
use crate::applications::transfer::coin::RawCoin;
use crate::core::ics04_channel::packet_id::PacketId;
use crate::prelude::*;

use crate::signer::Signer;

/// The core type that encodes the different fees that are redeemable by relayers for relaying
Expand Down
1 change: 0 additions & 1 deletion crates/relayer-types/src/applications/ics31_icq/error.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
use crate::core::ics24_host::error::ValidationError as Ics24ValidationError;
use tendermint::error::Error as TendermintError;

use crate::prelude::*;
use flex_error::define_error;

define_error! {
Expand Down
5 changes: 2 additions & 3 deletions crates/relayer-types/src/applications/ics31_icq/events.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
use alloc::collections::BTreeMap;
use core::str::FromStr;
use std::collections::BTreeMap;
use std::str::FromStr;

use serde::{Deserialize, Serialize};
use tendermint::{abci, block::Height};

use crate::core::ics24_host::identifier::{ChainId, ConnectionId};
use crate::events::IbcEvent;
use crate::prelude::*;

use super::error::Error;

Expand Down
Loading