use graph::blockchain::{Blockchain, BlockchainKind};
use graph::prelude::*;
#[async_trait]
impl Blockchain for Chain {
// Unique identifier for this blockchain
const KIND: BlockchainKind = BlockchainKind::Ethereum;
// Aliases for backward compatibility
const ALIASES: &'static [&'static str] = &["ethereum/contract"];
// Associated types
type Client = EthereumNetworkAdapters;
type Block = BlockFinality;
type DataSource = DataSource;
type UnresolvedDataSource = UnresolvedDataSource;
type DataSourceTemplate = DataSourceTemplate;
type UnresolvedDataSourceTemplate = UnresolvedDataSourceTemplate;
type TriggerData = EthereumTrigger;
type MappingTrigger = MappingTrigger;
type TriggerFilter = TriggerFilter;
type NodeCapabilities = NodeCapabilities;
type DecoderHook = DecoderHook;
// Required methods
fn triggers_adapter(
&self,
loc: &DeploymentLocator,
capabilities: &Self::NodeCapabilities,
unified_api_version: UnifiedMappingApiVersion,
) -> Result<Arc<dyn TriggersAdapterTrait<Self>>, Error>;
async fn new_block_stream(
&self,
deployment: DeploymentLocator,
store: impl DeploymentCursorTracker,
start_blocks: Vec<BlockNumber>,
filter: Arc<TriggerFilterWrapper<Self>>,
unified_api_version: UnifiedMappingApiVersion,
) -> Result<Box<dyn BlockStream<Self>>, Error>;
async fn chain_head_ptr(&self) -> Result<Option<BlockPtr>, Error>;
async fn block_pointer_from_number(
&self,
logger: &Logger,
number: BlockNumber,
) -> Result<BlockPtr, IngestorError>;
fn is_refetch_block_required(&self) -> bool;
async fn refetch_firehose_block(
&self,
logger: &Logger,
cursor: FirehoseCursor,
) -> Result<Self::Block, Error>;
async fn runtime(
&self,
) -> Result<(Arc<dyn RuntimeAdapterTrait<Self>>, Self::DecoderHook)>;
fn chain_client(&self) -> Arc<ChainClient<Self>>;
async fn block_ingestor(&self) -> Result<Box<dyn BlockIngestor>>;
}