diff --git a/packages/fuel-indexer-macros/src/tokens.rs b/packages/fuel-indexer-macros/src/tokens.rs index d9d2c199e..51f753434 100644 --- a/packages/fuel-indexer-macros/src/tokens.rs +++ b/packages/fuel-indexer-macros/src/tokens.rs @@ -7,8 +7,8 @@ use quote::{format_ident, quote}; use std::collections::HashMap; use syn::Ident; -/// `TokenStream` that represents the `Decoder` from which all data is decoded, and all -/// functions are dispatched. +/// `TokenStream` that represents the `Decoder` from which all incoming data to the transaction handler +/// is decoded, and all indexer handlers are dispatched. #[allow(clippy::too_many_arguments)] pub fn decoder_struct_tokens( decoder_fields: Vec, @@ -120,6 +120,8 @@ pub fn decoder_struct_tokens( } /// `TokenStream` used to build the transaction handler in the `handle_events` entrypoint. +/// +/// This triggers the `Decoder` based on the supplied inputs (i.e., the outputs received from Fuel client). pub fn process_transaction_tokens( contract_subscription: TokenStream, predicate_block: TokenStream, @@ -331,6 +333,8 @@ pub fn process_transaction_tokens( /// `TokenStream` used to augment the `process_transaction_tokens` `TokenStream` with logic /// specific to the handling of predicates in the `handle_events` entrypoint. +/// +/// If predicates are not enabled, the AST will not be augmented with these tokens. pub fn transaction_predicate_tokens(manifest: &Manifest) -> TokenStream { let configurables_match = configurables_match_tokens(manifest); let verification_tokens = predicate_verification_tokens(manifest); @@ -408,7 +412,7 @@ pub fn transaction_predicate_tokens(manifest: &Manifest) -> TokenStream { let signaled_predicates = submitted_predicates.iter().filter(|p| { let owner = p.coin_output().to; - PredicateCoinOutputEntity::find(PredicateCoinOutputEntity::to().eq(owner.to_owned())).is_some() + PredicateCoinOutputEntity::find(PredicateCoinOutputEntity::owner().eq(owner.to_owned())).is_some() }); signaled_predicates.for_each(|pred| { diff --git a/packages/fuel-indexer-types/src/indexer.rs b/packages/fuel-indexer-types/src/indexer.rs index 626e0b8b3..36e2c64a4 100644 --- a/packages/fuel-indexer-types/src/indexer.rs +++ b/packages/fuel-indexer-types/src/indexer.rs @@ -73,7 +73,7 @@ impl GraphQLEntity for PredicateCoinOutput { type PredicateCoinOutputEntity @entity { id: ID! - to: Address! + owner: Address! amount: U64! asset_id: AssetId! }