Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ra0x3 committed Nov 21, 2023
1 parent 2b460e3 commit eb041f2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions packages/fuel-indexer-macros/src/tokens.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<TokenStream>,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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| {
Expand Down
2 changes: 1 addition & 1 deletion packages/fuel-indexer-types/src/indexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl GraphQLEntity for PredicateCoinOutput {
type PredicateCoinOutputEntity @entity {
id: ID!
to: Address!
owner: Address!
amount: U64!
asset_id: AssetId!
}
Expand Down

0 comments on commit eb041f2

Please sign in to comment.