Skip to content

Commit 7bbd26e

Browse files
committed
graph, store: Remove BlockStore.create_chain_store
It's not needed
1 parent 8a570e3 commit 7bbd26e

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

graph/src/components/store/traits.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -447,11 +447,6 @@ pub trait QueryStoreManager: Send + Sync + 'static {
447447
pub trait BlockStore: ChainIdStore + Send + Sync + 'static {
448448
type ChainStore: ChainStore;
449449

450-
fn create_chain_store(
451-
&self,
452-
network: &str,
453-
ident: ChainIdentifier,
454-
) -> anyhow::Result<Arc<Self::ChainStore>>;
455450
fn chain_store(&self, network: &str) -> Option<Arc<Self::ChainStore>>;
456451
}
457452

store/postgres/src/block_store.rs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -570,20 +570,11 @@ impl BlockStore {
570570

571571
Ok(())
572572
}
573-
}
574-
575-
impl BlockStoreTrait for BlockStore {
576-
type ChainStore = ChainStore;
577-
578-
fn chain_store(&self, network: &str) -> Option<Arc<Self::ChainStore>> {
579-
self.store(network)
580-
}
581-
582-
fn create_chain_store(
573+
pub fn create_chain_store(
583574
&self,
584575
network: &str,
585576
ident: ChainIdentifier,
586-
) -> anyhow::Result<Arc<Self::ChainStore>> {
577+
) -> anyhow::Result<Arc<ChainStore>> {
587578
match self.store(network) {
588579
Some(chain_store) => {
589580
return Ok(chain_store);
@@ -609,6 +600,14 @@ impl BlockStoreTrait for BlockStore {
609600
}
610601
}
611602

603+
impl BlockStoreTrait for BlockStore {
604+
type ChainStore = ChainStore;
605+
606+
fn chain_store(&self, network: &str) -> Option<Arc<Self::ChainStore>> {
607+
self.store(network)
608+
}
609+
}
610+
612611
impl ChainIdStore for BlockStore {
613612
fn chain_identifier(&self, chain_name: &ChainName) -> Result<ChainIdentifier, anyhow::Error> {
614613
let chain_store = self

tests/src/fixture/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use graph::cheap_clone::CheapClone;
2020
use graph::components::link_resolver::{ArweaveClient, ArweaveResolver, FileSizeLimit};
2121
use graph::components::metrics::MetricsRegistry;
2222
use graph::components::network_provider::ChainName;
23-
use graph::components::store::{BlockStore, DeploymentLocator, EthereumCallCache, SourceableStore};
23+
use graph::components::store::{DeploymentLocator, EthereumCallCache, SourceableStore};
2424
use graph::components::subgraph::Settings;
2525
use graph::data::graphql::load_manager::LoadManager;
2626
use graph::data::query::{Query, QueryTarget};

0 commit comments

Comments
 (0)