From f2cb6ebc1b75612cb22b5135dd0ad1f133b3a197 Mon Sep 17 00:00:00 2001 From: Daniel Savu <23065004+daniel-savu@users.noreply.github.com> Date: Tue, 23 Apr 2024 11:42:45 +0100 Subject: [PATCH] refactor: organize files in `hyperlane-ethereum` (#3633) ### Description Some cleanup along my way to integrating with `Multicall3` in hyp-ethereum. - Categorizes most files from `src` into `ism`, `contracts`, `signer` modules - Renames the previous `contracts` dir (that held the abi interfaces) to `interfaces`, so we can use `contracts` for the actual contracts (e.g. mailbox, igp) --- rust/chains/hyperlane-ethereum/.gitignore | 2 +- rust/chains/hyperlane-ethereum/build.rs | 2 +- .../src/{ => contracts}/interchain_gas.rs | 7 +-- .../src/{ => contracts}/mailbox.rs | 13 ++-- .../src/{ => contracts}/merkle_tree_hook.rs | 5 +- .../hyperlane-ethereum/src/contracts/mod.rs | 9 +++ .../src/{ => contracts}/validator_announce.rs | 7 +-- .../src/{ => ism}/aggregation_ism.rs | 7 +-- .../src/{ => ism}/ccip_read_ism.rs | 7 +-- .../{ => ism}/interchain_security_module.rs | 7 +-- rust/chains/hyperlane-ethereum/src/ism/mod.rs | 10 ++++ .../src/{ => ism}/multisig_ism.rs | 7 +-- .../src/{ => ism}/routing_ism.rs | 9 +-- rust/chains/hyperlane-ethereum/src/lib.rs | 60 ++----------------- .../hyperlane-ethereum/src/rpc_clients/mod.rs | 4 +- .../src/{ => rpc_clients}/provider.rs | 0 .../src/{ => rpc_clients}/trait_builder.rs | 4 +- .../src/{signers.rs => signer/mod.rs} | 5 +- .../singleton.rs} | 0 19 files changed, 67 insertions(+), 98 deletions(-) rename rust/chains/hyperlane-ethereum/src/{ => contracts}/interchain_gas.rs (96%) rename rust/chains/hyperlane-ethereum/src/{ => contracts}/mailbox.rs (97%) rename rust/chains/hyperlane-ethereum/src/{ => contracts}/merkle_tree_hook.rs (97%) create mode 100644 rust/chains/hyperlane-ethereum/src/contracts/mod.rs rename rust/chains/hyperlane-ethereum/src/{ => contracts}/validator_announce.rs (96%) rename rust/chains/hyperlane-ethereum/src/{ => ism}/aggregation_ism.rs (93%) rename rust/chains/hyperlane-ethereum/src/{ => ism}/ccip_read_ism.rs (93%) rename rust/chains/hyperlane-ethereum/src/{ => ism}/interchain_security_module.rs (94%) create mode 100644 rust/chains/hyperlane-ethereum/src/ism/mod.rs rename rust/chains/hyperlane-ethereum/src/{ => ism}/multisig_ism.rs (94%) rename rust/chains/hyperlane-ethereum/src/{ => ism}/routing_ism.rs (91%) rename rust/chains/hyperlane-ethereum/src/{ => rpc_clients}/provider.rs (100%) rename rust/chains/hyperlane-ethereum/src/{ => rpc_clients}/trait_builder.rs (98%) rename rust/chains/hyperlane-ethereum/src/{signers.rs => signer/mod.rs} (98%) rename rust/chains/hyperlane-ethereum/src/{singleton_signer.rs => signer/singleton.rs} (100%) diff --git a/rust/chains/hyperlane-ethereum/.gitignore b/rust/chains/hyperlane-ethereum/.gitignore index 7040d337a..87b67b9b1 100644 --- a/rust/chains/hyperlane-ethereum/.gitignore +++ b/rust/chains/hyperlane-ethereum/.gitignore @@ -1 +1 @@ -src/contracts \ No newline at end of file +src/interfaces \ No newline at end of file diff --git a/rust/chains/hyperlane-ethereum/build.rs b/rust/chains/hyperlane-ethereum/build.rs index 7f51f3a29..d1b3fe960 100644 --- a/rust/chains/hyperlane-ethereum/build.rs +++ b/rust/chains/hyperlane-ethereum/build.rs @@ -1,3 +1,3 @@ fn main() { - abigen::generate_bindings_for_dir("./abis", "./src/contracts", abigen::BuildType::Ethers); + abigen::generate_bindings_for_dir("./abis", "./src/interfaces", abigen::BuildType::Ethers); } diff --git a/rust/chains/hyperlane-ethereum/src/interchain_gas.rs b/rust/chains/hyperlane-ethereum/src/contracts/interchain_gas.rs similarity index 96% rename from rust/chains/hyperlane-ethereum/src/interchain_gas.rs rename to rust/chains/hyperlane-ethereum/src/contracts/interchain_gas.rs index eb19e7def..c51e8d0ef 100644 --- a/rust/chains/hyperlane-ethereum/src/interchain_gas.rs +++ b/rust/chains/hyperlane-ethereum/src/contracts/interchain_gas.rs @@ -14,11 +14,10 @@ use hyperlane_core::{ }; use tracing::instrument; -use crate::contracts::i_interchain_gas_paymaster::{ +use crate::interfaces::i_interchain_gas_paymaster::{ IInterchainGasPaymaster as EthereumInterchainGasPaymasterInternal, IINTERCHAINGASPAYMASTER_ABI, }; -use crate::trait_builder::BuildableWithProvider; -use crate::{ConnectionConf, EthereumProvider}; +use crate::{BuildableWithProvider, ConnectionConf, EthereumProvider}; impl Display for EthereumInterchainGasPaymasterInternal where @@ -224,6 +223,6 @@ impl HyperlaneAbi for EthereumInterchainGasPaymasterAbi { const SELECTOR_SIZE_BYTES: usize = 4; fn fn_map() -> HashMap, &'static str> { - super::extract_fn_map(&IINTERCHAINGASPAYMASTER_ABI) + crate::extract_fn_map(&IINTERCHAINGASPAYMASTER_ABI) } } diff --git a/rust/chains/hyperlane-ethereum/src/mailbox.rs b/rust/chains/hyperlane-ethereum/src/contracts/mailbox.rs similarity index 97% rename from rust/chains/hyperlane-ethereum/src/mailbox.rs rename to rust/chains/hyperlane-ethereum/src/contracts/mailbox.rs index dab1424b3..3b030fbd3 100644 --- a/rust/chains/hyperlane-ethereum/src/mailbox.rs +++ b/rust/chains/hyperlane-ethereum/src/contracts/mailbox.rs @@ -19,11 +19,12 @@ use hyperlane_core::{ TxCostEstimate, TxOutcome, H160, H256, U256, }; -use crate::contracts::arbitrum_node_interface::ArbitrumNodeInterface; -use crate::contracts::i_mailbox::{IMailbox as EthereumMailboxInternal, ProcessCall, IMAILBOX_ABI}; -use crate::trait_builder::BuildableWithProvider; +use crate::interfaces::arbitrum_node_interface::ArbitrumNodeInterface; +use crate::interfaces::i_mailbox::{ + IMailbox as EthereumMailboxInternal, ProcessCall, IMAILBOX_ABI, +}; use crate::tx::{call_with_lag, fill_tx_gas_params, report_tx}; -use crate::{ConnectionConf, EthereumProvider, TransactionOverrides}; +use crate::{BuildableWithProvider, ConnectionConf, EthereumProvider, TransactionOverrides}; impl std::fmt::Display for EthereumMailboxInternal where @@ -420,7 +421,7 @@ impl HyperlaneAbi for EthereumMailboxAbi { const SELECTOR_SIZE_BYTES: usize = 4; fn fn_map() -> HashMap, &'static str> { - super::extract_fn_map(&IMAILBOX_ABI) + crate::extract_fn_map(&IMAILBOX_ABI) } } @@ -438,7 +439,7 @@ mod test { TxCostEstimate, H160, H256, U256, }; - use crate::{ConnectionConf, EthereumMailbox, RpcConnectionConf}; + use crate::{contracts::EthereumMailbox, ConnectionConf, RpcConnectionConf}; /// An amount of gas to add to the estimated gas const GAS_ESTIMATE_BUFFER: u32 = 50000; diff --git a/rust/chains/hyperlane-ethereum/src/merkle_tree_hook.rs b/rust/chains/hyperlane-ethereum/src/contracts/merkle_tree_hook.rs similarity index 97% rename from rust/chains/hyperlane-ethereum/src/merkle_tree_hook.rs rename to rust/chains/hyperlane-ethereum/src/contracts/merkle_tree_hook.rs index a39b07018..f920c28cc 100644 --- a/rust/chains/hyperlane-ethereum/src/merkle_tree_hook.rs +++ b/rust/chains/hyperlane-ethereum/src/contracts/merkle_tree_hook.rs @@ -14,10 +14,9 @@ use hyperlane_core::{ MerkleTreeInsertion, SequenceAwareIndexer, H256, }; -use crate::contracts::merkle_tree_hook::{MerkleTreeHook as MerkleTreeHookContract, Tree}; -use crate::trait_builder::BuildableWithProvider; +use crate::interfaces::merkle_tree_hook::{MerkleTreeHook as MerkleTreeHookContract, Tree}; use crate::tx::call_with_lag; -use crate::{ConnectionConf, EthereumProvider}; +use crate::{BuildableWithProvider, ConnectionConf, EthereumProvider}; // We don't need the reverse of this impl, so it's ok to disable the clippy lint #[allow(clippy::from_over_into)] diff --git a/rust/chains/hyperlane-ethereum/src/contracts/mod.rs b/rust/chains/hyperlane-ethereum/src/contracts/mod.rs new file mode 100644 index 000000000..2b85733f6 --- /dev/null +++ b/rust/chains/hyperlane-ethereum/src/contracts/mod.rs @@ -0,0 +1,9 @@ +pub use {interchain_gas::*, mailbox::*, merkle_tree_hook::*, validator_announce::*}; + +mod interchain_gas; + +mod mailbox; + +mod merkle_tree_hook; + +mod validator_announce; diff --git a/rust/chains/hyperlane-ethereum/src/validator_announce.rs b/rust/chains/hyperlane-ethereum/src/contracts/validator_announce.rs similarity index 96% rename from rust/chains/hyperlane-ethereum/src/validator_announce.rs rename to rust/chains/hyperlane-ethereum/src/contracts/validator_announce.rs index b4c93e078..2d9fa3f68 100644 --- a/rust/chains/hyperlane-ethereum/src/validator_announce.rs +++ b/rust/chains/hyperlane-ethereum/src/contracts/validator_announce.rs @@ -13,12 +13,11 @@ use hyperlane_core::{ use tracing::{instrument, log::trace}; use crate::{ - contracts::i_validator_announce::{ + interfaces::i_validator_announce::{ IValidatorAnnounce as EthereumValidatorAnnounceInternal, IVALIDATORANNOUNCE_ABI, }, - trait_builder::BuildableWithProvider, tx::{fill_tx_gas_params, report_tx}, - ConnectionConf, EthereumProvider, + BuildableWithProvider, ConnectionConf, EthereumProvider, }; impl std::fmt::Display for EthereumValidatorAnnounceInternal @@ -176,6 +175,6 @@ impl HyperlaneAbi for EthereumValidatorAnnounceAbi { const SELECTOR_SIZE_BYTES: usize = 4; fn fn_map() -> HashMap, &'static str> { - super::extract_fn_map(&IVALIDATORANNOUNCE_ABI) + crate::extract_fn_map(&IVALIDATORANNOUNCE_ABI) } } diff --git a/rust/chains/hyperlane-ethereum/src/aggregation_ism.rs b/rust/chains/hyperlane-ethereum/src/ism/aggregation_ism.rs similarity index 93% rename from rust/chains/hyperlane-ethereum/src/aggregation_ism.rs rename to rust/chains/hyperlane-ethereum/src/ism/aggregation_ism.rs index 3cfcf1b3a..56e2bd722 100644 --- a/rust/chains/hyperlane-ethereum/src/aggregation_ism.rs +++ b/rust/chains/hyperlane-ethereum/src/ism/aggregation_ism.rs @@ -13,11 +13,10 @@ use hyperlane_core::{ HyperlaneDomain, HyperlaneMessage, HyperlaneProvider, RawHyperlaneMessage, H256, }; -use crate::contracts::i_aggregation_ism::{ +use crate::interfaces::i_aggregation_ism::{ IAggregationIsm as EthereumAggregationIsmInternal, IAGGREGATIONISM_ABI, }; -use crate::trait_builder::BuildableWithProvider; -use crate::{ConnectionConf, EthereumProvider}; +use crate::{BuildableWithProvider, ConnectionConf, EthereumProvider}; pub struct AggregationIsmBuilder {} @@ -113,6 +112,6 @@ impl HyperlaneAbi for EthereumAggregationIsmAbi { const SELECTOR_SIZE_BYTES: usize = 4; fn fn_map() -> HashMap, &'static str> { - super::extract_fn_map(&IAGGREGATIONISM_ABI) + crate::extract_fn_map(&IAGGREGATIONISM_ABI) } } diff --git a/rust/chains/hyperlane-ethereum/src/ccip_read_ism.rs b/rust/chains/hyperlane-ethereum/src/ism/ccip_read_ism.rs similarity index 93% rename from rust/chains/hyperlane-ethereum/src/ccip_read_ism.rs rename to rust/chains/hyperlane-ethereum/src/ism/ccip_read_ism.rs index 82845fac5..682def774 100644 --- a/rust/chains/hyperlane-ethereum/src/ccip_read_ism.rs +++ b/rust/chains/hyperlane-ethereum/src/ism/ccip_read_ism.rs @@ -13,11 +13,10 @@ use hyperlane_core::{ HyperlaneDomain, HyperlaneProvider, H256, }; -pub use crate::contracts::i_ccip_read_ism::{ +pub use crate::interfaces::i_ccip_read_ism::{ ICcipReadIsm as EthereumCcipReadIsmInternal, OffchainLookup, ICCIPREADISM_ABI, }; -use crate::trait_builder::BuildableWithProvider; -use crate::{ConnectionConf, EthereumProvider}; +use crate::{BuildableWithProvider, ConnectionConf, EthereumProvider}; pub struct CcipReadIsmBuilder {} @@ -105,6 +104,6 @@ impl HyperlaneAbi for EthereumCcipReadIsmAbi { const SELECTOR_SIZE_BYTES: usize = 4; fn fn_map() -> HashMap, &'static str> { - super::extract_fn_map(&ICCIPREADISM_ABI) + crate::extract_fn_map(&ICCIPREADISM_ABI) } } diff --git a/rust/chains/hyperlane-ethereum/src/interchain_security_module.rs b/rust/chains/hyperlane-ethereum/src/ism/interchain_security_module.rs similarity index 94% rename from rust/chains/hyperlane-ethereum/src/interchain_security_module.rs rename to rust/chains/hyperlane-ethereum/src/ism/interchain_security_module.rs index e47750217..614b85547 100644 --- a/rust/chains/hyperlane-ethereum/src/interchain_security_module.rs +++ b/rust/chains/hyperlane-ethereum/src/ism/interchain_security_module.rs @@ -16,12 +16,11 @@ use hyperlane_core::{ }; use num_traits::cast::FromPrimitive; -use crate::contracts::i_interchain_security_module::{ +use crate::interfaces::i_interchain_security_module::{ IInterchainSecurityModule as EthereumInterchainSecurityModuleInternal, IINTERCHAINSECURITYMODULE_ABI, }; -use crate::trait_builder::BuildableWithProvider; -use crate::{ConnectionConf, EthereumProvider}; +use crate::{BuildableWithProvider, ConnectionConf, EthereumProvider}; pub struct InterchainSecurityModuleBuilder {} @@ -135,6 +134,6 @@ impl HyperlaneAbi for EthereumInterchainSecurityModuleAbi { const SELECTOR_SIZE_BYTES: usize = 4; fn fn_map() -> HashMap, &'static str> { - super::extract_fn_map(&IINTERCHAINSECURITYMODULE_ABI) + crate::extract_fn_map(&IINTERCHAINSECURITYMODULE_ABI) } } diff --git a/rust/chains/hyperlane-ethereum/src/ism/mod.rs b/rust/chains/hyperlane-ethereum/src/ism/mod.rs new file mode 100644 index 000000000..5dc146d86 --- /dev/null +++ b/rust/chains/hyperlane-ethereum/src/ism/mod.rs @@ -0,0 +1,10 @@ +pub use { + aggregation_ism::*, ccip_read_ism::*, interchain_security_module::*, multisig_ism::*, + routing_ism::*, +}; + +mod aggregation_ism; +mod ccip_read_ism; +mod interchain_security_module; +mod multisig_ism; +mod routing_ism; diff --git a/rust/chains/hyperlane-ethereum/src/multisig_ism.rs b/rust/chains/hyperlane-ethereum/src/ism/multisig_ism.rs similarity index 94% rename from rust/chains/hyperlane-ethereum/src/multisig_ism.rs rename to rust/chains/hyperlane-ethereum/src/ism/multisig_ism.rs index 9571f6fb7..19aecf464 100644 --- a/rust/chains/hyperlane-ethereum/src/multisig_ism.rs +++ b/rust/chains/hyperlane-ethereum/src/ism/multisig_ism.rs @@ -13,11 +13,10 @@ use hyperlane_core::{ HyperlaneMessage, HyperlaneProvider, MultisigIsm, RawHyperlaneMessage, H256, }; -use crate::contracts::i_multisig_ism::{ +use crate::interfaces::i_multisig_ism::{ IMultisigIsm as EthereumMultisigIsmInternal, IMULTISIGISM_ABI, }; -use crate::trait_builder::BuildableWithProvider; -use crate::{ConnectionConf, EthereumProvider}; +use crate::{BuildableWithProvider, ConnectionConf, EthereumProvider}; impl std::fmt::Display for EthereumMultisigIsmInternal where @@ -119,6 +118,6 @@ impl HyperlaneAbi for EthereumMultisigIsmAbi { const SELECTOR_SIZE_BYTES: usize = 4; fn fn_map() -> HashMap, &'static str> { - super::extract_fn_map(&IMULTISIGISM_ABI) + crate::extract_fn_map(&IMULTISIGISM_ABI) } } diff --git a/rust/chains/hyperlane-ethereum/src/routing_ism.rs b/rust/chains/hyperlane-ethereum/src/ism/routing_ism.rs similarity index 91% rename from rust/chains/hyperlane-ethereum/src/routing_ism.rs rename to rust/chains/hyperlane-ethereum/src/ism/routing_ism.rs index f884dcf69..23e92014e 100644 --- a/rust/chains/hyperlane-ethereum/src/routing_ism.rs +++ b/rust/chains/hyperlane-ethereum/src/ism/routing_ism.rs @@ -13,9 +13,10 @@ use hyperlane_core::{ HyperlaneMessage, HyperlaneProvider, RawHyperlaneMessage, RoutingIsm, H256, }; -use crate::contracts::i_routing_ism::{IRoutingIsm as EthereumRoutingIsmInternal, IROUTINGISM_ABI}; -use crate::trait_builder::BuildableWithProvider; -use crate::{ConnectionConf, EthereumProvider}; +use crate::interfaces::i_routing_ism::{ + IRoutingIsm as EthereumRoutingIsmInternal, IROUTINGISM_ABI, +}; +use crate::{BuildableWithProvider, ConnectionConf, EthereumProvider}; pub struct RoutingIsmBuilder {} @@ -104,6 +105,6 @@ impl HyperlaneAbi for EthereumRoutingIsmAbi { const SELECTOR_SIZE_BYTES: usize = 4; fn fn_map() -> HashMap, &'static str> { - super::extract_fn_map(&IROUTINGISM_ABI) + crate::extract_fn_map(&IROUTINGISM_ABI) } } diff --git a/rust/chains/hyperlane-ethereum/src/lib.rs b/rust/chains/hyperlane-ethereum/src/lib.rs index 90ec70c01..bf02f4a69 100644 --- a/rust/chains/hyperlane-ethereum/src/lib.rs +++ b/rust/chains/hyperlane-ethereum/src/lib.rs @@ -8,71 +8,21 @@ use std::collections::HashMap; use ethers::abi::FunctionExt; use ethers::prelude::{abi, Lazy, Middleware}; -#[cfg(not(doctest))] -pub use self::{ - aggregation_ism::*, ccip_read_ism::*, config::*, config::*, interchain_gas::*, - interchain_gas::*, interchain_security_module::*, interchain_security_module::*, mailbox::*, - mailbox::*, merkle_tree_hook::*, multisig_ism::*, provider::*, routing_ism::*, rpc_clients::*, - signers::*, singleton_signer::*, trait_builder::*, validator_announce::*, -}; +pub use self::{config::*, contracts::*, ism::*, rpc_clients::*, signer::*}; -#[cfg(not(doctest))] mod tx; -/// Mailbox abi -#[cfg(not(doctest))] -mod mailbox; - -#[cfg(not(doctest))] -mod trait_builder; - -/// Provider abi -#[cfg(not(doctest))] -mod provider; - -/// InterchainGasPaymaster abi -#[cfg(not(doctest))] -mod interchain_gas; - -/// interchain_security_module abi -#[cfg(not(doctest))] -mod interchain_security_module; - -/// Merkle tree hook abi -#[cfg(not(doctest))] -mod merkle_tree_hook; - -/// MultisigIsm abi -#[cfg(not(doctest))] -mod multisig_ism; - -/// RoutingIsm abi -#[cfg(not(doctest))] -mod routing_ism; - -/// CcipReadIsm abi -#[cfg(not(doctest))] -mod ccip_read_ism; - -/// ValidatorAnnounce abi -#[cfg(not(doctest))] -mod validator_announce; +mod contracts; -/// AggregationIsm abi -#[cfg(not(doctest))] -mod aggregation_ism; +mod ism; /// Generated contract bindings. -#[cfg(not(doctest))] -mod contracts; +mod interfaces; /// Ethers JSONRPC Client implementations mod rpc_clients; -mod signers; - -#[cfg(not(doctest))] -mod singleton_signer; +mod signer; mod config; mod error; diff --git a/rust/chains/hyperlane-ethereum/src/rpc_clients/mod.rs b/rust/chains/hyperlane-ethereum/src/rpc_clients/mod.rs index 9a97d7b3d..d7cdb80cd 100644 --- a/rust/chains/hyperlane-ethereum/src/rpc_clients/mod.rs +++ b/rust/chains/hyperlane-ethereum/src/rpc_clients/mod.rs @@ -1,10 +1,12 @@ use ethers::providers::HttpClientError; use tracing::{info, trace, warn}; -pub use self::{fallback::*, retrying::*}; +pub use self::{fallback::*, provider::*, retrying::*, trait_builder::*}; mod fallback; +mod provider; mod retrying; +mod trait_builder; enum CategorizedResponse { IsOk(R), diff --git a/rust/chains/hyperlane-ethereum/src/provider.rs b/rust/chains/hyperlane-ethereum/src/rpc_clients/provider.rs similarity index 100% rename from rust/chains/hyperlane-ethereum/src/provider.rs rename to rust/chains/hyperlane-ethereum/src/rpc_clients/provider.rs diff --git a/rust/chains/hyperlane-ethereum/src/trait_builder.rs b/rust/chains/hyperlane-ethereum/src/rpc_clients/trait_builder.rs similarity index 98% rename from rust/chains/hyperlane-ethereum/src/trait_builder.rs rename to rust/chains/hyperlane-ethereum/src/rpc_clients/trait_builder.rs index e81412a8b..04894aa49 100644 --- a/rust/chains/hyperlane-ethereum/src/trait_builder.rs +++ b/rust/chains/hyperlane-ethereum/src/rpc_clients/trait_builder.rs @@ -23,8 +23,8 @@ use hyperlane_core::{ ChainCommunicationError, ChainResult, ContractLocator, HyperlaneDomain, KnownHyperlaneDomain, }; -use crate::{signers::Signers, ConnectionConf, RetryingProvider}; -use crate::{EthereumFallbackProvider, RpcConnectionConf}; +use crate::signer::Signers; +use crate::{ConnectionConf, EthereumFallbackProvider, RetryingProvider, RpcConnectionConf}; // This should be whatever the prometheus scrape interval is const HTTP_CLIENT_TIMEOUT: Duration = Duration::from_secs(60); diff --git a/rust/chains/hyperlane-ethereum/src/signers.rs b/rust/chains/hyperlane-ethereum/src/signer/mod.rs similarity index 98% rename from rust/chains/hyperlane-ethereum/src/signers.rs rename to rust/chains/hyperlane-ethereum/src/signer/mod.rs index 7165cd1bc..5dbac122e 100644 --- a/rust/chains/hyperlane-ethereum/src/signers.rs +++ b/rust/chains/hyperlane-ethereum/src/signer/mod.rs @@ -8,6 +8,9 @@ use hyperlane_core::{ HyperlaneSigner, HyperlaneSignerError, Signature as HyperlaneSignature, H160, H256, }; +mod singleton; +pub use singleton::*; + /// Ethereum-supported signer types #[derive(Debug, Clone)] pub enum Signers { @@ -120,7 +123,7 @@ mod test { Checkpoint, CheckpointWithMessageId, HyperlaneSigner, HyperlaneSignerExt, H256, }; - use crate::signers::Signers; + use super::Signers; #[test] fn it_sign() { diff --git a/rust/chains/hyperlane-ethereum/src/singleton_signer.rs b/rust/chains/hyperlane-ethereum/src/signer/singleton.rs similarity index 100% rename from rust/chains/hyperlane-ethereum/src/singleton_signer.rs rename to rust/chains/hyperlane-ethereum/src/signer/singleton.rs