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

feat: Add "StartBlock::Continue" to registry contract/types #548

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
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 {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be migrated to new types in a future PR

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 @@ -255,7 +255,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};
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will be migrated to new types in a future PR


use crate::registry::IndexerConfig;

Expand Down
6 changes: 3 additions & 3 deletions coordinator/src/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ mod tests {
use std::collections::HashMap;

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

use crate::registry::IndexerConfig;

Expand All @@ -296,7 +296,7 @@ mod tests {
function_name: "test".to_string(),
code: String::new(),
schema: Some(String::new()),
filter: IndexerRule {
filter: OldIndexerRule {
id: None,
name: None,
indexer_rule_kind: IndexerRuleKind::Action,
Expand Down Expand Up @@ -369,7 +369,7 @@ mod tests {
function_name: "test".to_string(),
code: String::new(),
schema: Some(String::new()),
filter: IndexerRule {
filter: OldIndexerRule {
id: None,
name: None,
indexer_rule_kind: IndexerRuleKind::Action,
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 @@ -69,7 +71,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
Loading
Loading