|
1 | 1 | use ethabi; |
2 | 2 |
|
3 | | -use graph::blockchain::block_stream::{EntityOperationKind, EntitySourceOperation}; |
4 | 3 | use graph::data::store::scalar::Timestamp; |
5 | 4 | use graph::data::value::Word; |
6 | 5 | use graph::prelude::{BigDecimal, BigInt}; |
7 | 6 | use graph::runtime::gas::GasCounter; |
8 | 7 | use graph::runtime::{ |
9 | | - asc_get, asc_new, AscIndexId, AscPtr, AscType, AscValue, HostExportError, IndexForAscTypeId, |
10 | | - ToAscObj, |
| 8 | + asc_get, asc_new, AscIndexId, AscPtr, AscType, AscValue, HostExportError, ToAscObj, |
11 | 9 | }; |
12 | 10 | use graph::{data::store, runtime::DeterministicHostError}; |
13 | 11 | use graph::{prelude::serde_json, runtime::FromAscObj}; |
@@ -474,39 +472,6 @@ pub enum AscSubgraphEntityOp { |
474 | 472 | Delete, |
475 | 473 | } |
476 | 474 |
|
477 | | -#[derive(AscType)] |
478 | | -pub struct AscEntityTrigger { |
479 | | - pub entity_op: AscSubgraphEntityOp, |
480 | | - pub entity_type: AscPtr<AscString>, |
481 | | - pub entity: AscPtr<AscEntity>, |
482 | | - pub vid: i64, |
483 | | -} |
484 | | - |
485 | | -impl ToAscObj<AscEntityTrigger> for EntitySourceOperation { |
486 | | - fn to_asc_obj<H: AscHeap + ?Sized>( |
487 | | - &self, |
488 | | - heap: &mut H, |
489 | | - gas: &GasCounter, |
490 | | - ) -> Result<AscEntityTrigger, HostExportError> { |
491 | | - let entity_op = match self.entity_op { |
492 | | - EntityOperationKind::Create => AscSubgraphEntityOp::Create, |
493 | | - EntityOperationKind::Modify => AscSubgraphEntityOp::Modify, |
494 | | - EntityOperationKind::Delete => AscSubgraphEntityOp::Delete, |
495 | | - }; |
496 | | - |
497 | | - Ok(AscEntityTrigger { |
498 | | - entity_op, |
499 | | - entity_type: asc_new(heap, &self.entity_type.as_str(), gas)?, |
500 | | - entity: asc_new(heap, &self.entity.sorted_ref(), gas)?, |
501 | | - vid: self.vid, |
502 | | - }) |
503 | | - } |
504 | | -} |
505 | | - |
506 | | -impl AscIndexId for AscEntityTrigger { |
507 | | - const INDEX_ASC_TYPE_ID: IndexForAscTypeId = IndexForAscTypeId::AscEntityTrigger; |
508 | | -} |
509 | | - |
510 | 475 | impl ToAscObj<AscEnum<YamlValueKind>> for serde_yaml::Value { |
511 | 476 | fn to_asc_obj<H: AscHeap + ?Sized>( |
512 | 477 | &self, |
|
0 commit comments