Skip to content

Commit

Permalink
Rename MessageContractSync -> SequencedDataContractSync
Browse files Browse the repository at this point in the history
  • Loading branch information
tkporter committed Nov 2, 2023
1 parent db6da26 commit 3424a1f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
9 changes: 5 additions & 4 deletions rust/agents/relayer/src/relayer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use derive_more::AsRef;
use eyre::Result;
use hyperlane_base::{
db::{HyperlaneRocksDB, DB},
run_all, BaseAgent, ContractSyncMetrics, CoreMetrics, HyperlaneAgentCore, MessageContractSync,
WatermarkContractSync,
run_all, BaseAgent, ContractSyncMetrics, CoreMetrics, HyperlaneAgentCore,
SequencedDataContractSync, WatermarkContractSync,
};
use hyperlane_core::{
HyperlaneDomain, HyperlaneMessage, InterchainGasPayment, MerkleTreeInsertion, U256,
Expand Down Expand Up @@ -52,14 +52,15 @@ pub struct Relayer {
destination_chains: HashSet<HyperlaneDomain>,
#[as_ref]
core: HyperlaneAgentCore,
message_syncs: HashMap<HyperlaneDomain, Arc<MessageContractSync<HyperlaneMessage>>>,
message_syncs: HashMap<HyperlaneDomain, Arc<SequencedDataContractSync<HyperlaneMessage>>>,
interchain_gas_payment_syncs:
HashMap<HyperlaneDomain, Arc<WatermarkContractSync<InterchainGasPayment>>>,
/// Context data for each (origin, destination) chain pair a message can be
/// sent between
msg_ctxs: HashMap<ContextKey, Arc<MessageContext>>,
prover_syncs: HashMap<HyperlaneDomain, Arc<RwLock<MerkleTreeBuilder>>>,
merkle_tree_hook_syncs: HashMap<HyperlaneDomain, Arc<MessageContractSync<MerkleTreeInsertion>>>,
merkle_tree_hook_syncs:
HashMap<HyperlaneDomain, Arc<SequencedDataContractSync<MerkleTreeInsertion>>>,
dbs: HashMap<HyperlaneDomain, HyperlaneRocksDB>,
whitelist: Arc<MatchingList>,
blacklist: Arc<MatchingList>,
Expand Down
4 changes: 2 additions & 2 deletions rust/agents/validator/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use tracing::{error, info, info_span, instrument::Instrumented, warn, Instrument
use hyperlane_base::{
db::{HyperlaneRocksDB, DB},
run_all, BaseAgent, CheckpointSyncer, ContractSyncMetrics, CoreMetrics, HyperlaneAgentCore,
MessageContractSync,
SequencedDataContractSync,
};

use hyperlane_core::{
Expand All @@ -33,7 +33,7 @@ pub struct Validator {
#[as_ref]
core: HyperlaneAgentCore,
db: HyperlaneRocksDB,
merkle_tree_hook_sync: Arc<MessageContractSync<MerkleTreeInsertion>>,
merkle_tree_hook_sync: Arc<SequencedDataContractSync<MerkleTreeInsertion>>,
mailbox: Arc<dyn Mailbox>,
merkle_tree_hook: Arc<dyn MerkleTreeHook>,
validator_announce: Arc<dyn ValidatorAnnounce>,
Expand Down
4 changes: 2 additions & 2 deletions rust/hyperlane-base/src/contract_sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ where
}

/// A ContractSync for syncing messages using a SequenceSyncCursor
pub type MessageContractSync<T> =
pub type SequencedDataContractSync<T> =
ContractSync<T, Arc<dyn HyperlaneSequenceIndexerStore<T>>, Arc<dyn SequenceIndexer<T>>>;
impl<T: Sequenced> MessageContractSync<T> {
impl<T: Sequenced> SequencedDataContractSync<T> {
/// Returns a new cursor to be used for syncing dispatched messages from the indexer
pub async fn forward_message_sync_cursor(
&self,
Expand Down
6 changes: 3 additions & 3 deletions rust/hyperlane-base/src/settings/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use hyperlane_core::{

use crate::{
settings::{chains::ChainConf, trace::TracingConfig},
ContractSync, ContractSyncMetrics, CoreMetrics, HyperlaneAgentCore, MessageContractSync,
ContractSync, ContractSyncMetrics, CoreMetrics, HyperlaneAgentCore, SequencedDataContractSync,
WatermarkContractSync,
};

Expand Down Expand Up @@ -184,7 +184,7 @@ impl Settings {
build_contract_fns!(build_validator_announce, build_validator_announces -> dyn ValidatorAnnounce);
build_contract_fns!(build_provider, build_providers -> dyn HyperlaneProvider);
build_indexer_fns!(build_delivery_indexer, build_delivery_indexers -> dyn HyperlaneWatermarkedLogStore<Delivery>, WatermarkContractSync<Delivery>);
build_indexer_fns!(build_message_indexer, build_message_indexers -> dyn HyperlaneSequenceIndexerStore<HyperlaneMessage>, MessageContractSync<HyperlaneMessage>);
build_indexer_fns!(build_message_indexer, build_message_indexers -> dyn HyperlaneSequenceIndexerStore<HyperlaneMessage>, SequencedDataContractSync<HyperlaneMessage>);
build_indexer_fns!(build_interchain_gas_payment_indexer, build_interchain_gas_payment_indexers -> dyn HyperlaneWatermarkedLogStore<InterchainGasPayment>, WatermarkContractSync<InterchainGasPayment>);
build_indexer_fns!(build_merkle_tree_hook_indexer, build_merkle_tree_hook_indexers -> dyn HyperlaneSequenceIndexerStore<MerkleTreeInsertion>, MessageContractSync<MerkleTreeInsertion>);
build_indexer_fns!(build_merkle_tree_hook_indexer, build_merkle_tree_hook_indexers -> dyn HyperlaneSequenceIndexerStore<MerkleTreeInsertion>, SequencedDataContractSync<MerkleTreeInsertion>);
}

0 comments on commit 3424a1f

Please sign in to comment.