@@ -353,31 +353,11 @@ impl<C: Blockchain> TriggersAdapter<C> for TriggersAdapterWrapper<C> {
353353 async fn parent_ptr ( & self , block : & BlockPtr ) -> Result < Option < BlockPtr > , Error > {
354354 self . adapter . parent_ptr ( block) . await
355355 }
356- }
357356
358- // fn create_mock_trigger<C: Blockchain>() -> Trigger<C> {
359- // let entity = create_mock_entity();
360- // Trigger::Subgraph(subgraph::TriggerData {
361- // source: DeploymentHash::new("test").unwrap(),
362- // entity,
363- // entity_type: "User".to_string(),
364- // })
365- // }
366-
367- // fn create_mock_entity() -> Entity {
368- // let schema = InputSchema::parse_latest(
369- // "type User @entity { id: String!, val: String! }",
370- // DeploymentHash::new("test").unwrap(),
371- // )
372- // .unwrap();
373-
374- // schema
375- // .make_entity(vec![
376- // ("id".into(), Value::String("id".to_owned())),
377- // ("val".into(), Value::String("content".to_owned())),
378- // ])
379- // .unwrap()
380- // }
357+ async fn chain_head_ptr ( & self ) -> Result < Option < BlockPtr > , Error > {
358+ self . adapter . chain_head_ptr ( ) . await
359+ }
360+ }
381361
382362#[ async_trait]
383363pub trait TriggersAdapter < C : Blockchain > : Send + Sync {
@@ -419,6 +399,9 @@ pub trait TriggersAdapter<C: Blockchain>: Send + Sync {
419399
420400 /// Get pointer to parent of `block`. This is called when reverting `block`.
421401 async fn parent_ptr ( & self , block : & BlockPtr ) -> Result < Option < BlockPtr > , Error > ;
402+
403+ /// Get pointer to parent of `block`. This is called when reverting `block`.
404+ async fn chain_head_ptr ( & self ) -> Result < Option < BlockPtr > , Error > ;
422405}
423406
424407#[ async_trait]
0 commit comments