Skip to content

Commit

Permalink
feat: Use old types in block-streamer/coordinator
Browse files Browse the repository at this point in the history
  • Loading branch information
morgsmccauley committed Feb 5, 2024
1 parent 8c30168 commit 7e721b8
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion block-streamer/src/block_stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ mod tests {
)
.unwrap(),
function_name: "test".to_string(),
indexer_rule: registry_types::IndexerRule {
indexer_rule: registry_types::OldIndexerRule {
indexer_rule_kind: registry_types::IndexerRuleKind::Action,
matching_rule: registry_types::MatchingRule::ActionAny {
affected_account_id: "queryapi.dataplatform.near".to_string(),
Expand Down
2 changes: 1 addition & 1 deletion block-streamer/src/indexer_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use near_lake_framework::near_indexer_primitives::types::AccountId;
use std::collections::hash_map::DefaultHasher;
use std::hash::{Hash, Hasher};

use registry_types::IndexerRule;
use registry_types::OldIndexerRule as IndexerRule;

#[derive(serde::Serialize, serde::Deserialize, Clone, Debug)]
pub struct IndexerConfig {
Expand Down
2 changes: 1 addition & 1 deletion block-streamer/src/rules/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pub mod outcomes_reducer;
pub mod types;

use near_lake_framework::near_indexer_primitives::StreamerMessage;
use registry_types::{IndexerRule, MatchingRule};
use registry_types::{MatchingRule, OldIndexerRule as IndexerRule};

use types::{ChainId, IndexerRuleMatch};

Expand Down
2 changes: 1 addition & 1 deletion block-streamer/src/rules/outcomes_reducer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ fn build_indexer_rule_match_payload(

#[cfg(test)]
mod tests {
use registry_types::{IndexerRule, IndexerRuleKind, MatchingRule, Status};
use registry_types::{IndexerRuleKind, MatchingRule, OldIndexerRule as IndexerRule, Status};

use crate::rules::outcomes_reducer::reduce_indexer_rule_matches_from_outcomes;
use crate::rules::types::{ChainId, IndexerRuleMatch};
Expand Down
2 changes: 1 addition & 1 deletion block-streamer/src/server/block_streamer_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use tonic::{Request, Response, Status};

use crate::indexer_config::IndexerConfig;
use crate::rules::types::ChainId;
use registry_types::{IndexerRule, IndexerRuleKind, MatchingRule};
use registry_types::{IndexerRuleKind, MatchingRule, OldIndexerRule as IndexerRule};

use crate::block_stream;
use crate::server::blockstreamer;
Expand Down
2 changes: 1 addition & 1 deletion coordinator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ mod tests {
use mockall::predicate;
use std::collections::HashMap;

use registry_types::{IndexerRule, IndexerRuleKind, MatchingRule, Status};
use registry_types::{IndexerRuleKind, MatchingRule, OldIndexerRule as IndexerRule, Status};

use crate::registry::IndexerConfig;

Expand Down
6 changes: 4 additions & 2 deletions coordinator/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ use near_jsonrpc_client::JsonRpcClient;
use near_jsonrpc_primitives::types::query::QueryResponseKind;
use near_primitives::types::{AccountId, BlockReference, Finality, FunctionArgs};
use near_primitives::views::QueryRequest;
use registry_types::{AccountOrAllIndexers, IndexerRule};
use registry_types::{
OldAccountOrAllIndexers as AccountOrAllIndexers, OldIndexerRule as IndexerRule,
};

use crate::utils::exponential_retry;

Expand Down Expand Up @@ -61,7 +63,7 @@ impl RegistryImpl {

fn enrich_indexer_registry(
&self,
registry: HashMap<AccountId, HashMap<String, registry_types::IndexerConfig>>,
registry: HashMap<AccountId, HashMap<String, registry_types::OldIndexerConfig>>,
) -> IndexerRegistry {
registry
.into_iter()
Expand Down

0 comments on commit 7e721b8

Please sign in to comment.