Skip to content

Commit

Permalink
add create_transaction_parser
Browse files Browse the repository at this point in the history
  • Loading branch information
KappaShilaff committed May 19, 2023
1 parent 15a4114 commit c5a1143
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ pub mod models;
mod sqlx_client;

use crate::cache::RawCache;
use crate::models::{AnyExtractable, BufferedConsumerChannels, BufferedConsumerConfig, RawTransaction};
use crate::models::{
AnyExtractable, BufferedConsumerChannels, BufferedConsumerConfig, RawTransaction,
};
use crate::sqlx_client::{
create_table_raw_transactions, get_count_not_processed_raw_transactions,
get_count_raw_transactions, get_raw_transactions, insert_raw_transaction,
Expand Down Expand Up @@ -38,6 +40,16 @@ pub fn split_any_extractable(
(functions, events)
}

pub fn create_transaction_parser(any_extractable: Vec<AnyExtractable>) -> TransactionParser {
let (functions, events) = split_any_extractable(any_extractable);
TransactionParser::builder()
.function_in_list(functions.clone(), false)
.functions_out_list(functions, false)
.events_list(events)
.build()
.unwrap()
}

pub fn split_extracted_owned(
extracted: Vec<ExtractedOwned>,
) -> (Vec<ExtractedOwned>, Vec<ExtractedOwned>) // functions, events
Expand Down

0 comments on commit c5a1143

Please sign in to comment.