Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
KappaShilaff committed May 19, 2023
1 parent 543b40a commit fb8a5bf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
8 changes: 1 addition & 7 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pub mod models;
mod sqlx_client;

use crate::cache::RawCache;
use crate::models::{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 @@ -418,12 +418,6 @@ pub fn filter_extracted(
Some(extracted.into_iter().map(|x| x.into_owned()).collect())
}

#[derive(Debug, Clone)]
pub enum AnyExtractable {
Event(ton_abi::Event),
Function(ton_abi::Function),
}

#[cfg(test)]
mod test {
use crate::{extract_events, filter_extracted};
Expand Down
7 changes: 6 additions & 1 deletion src/models.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use tokio::sync::Notify;
use ton_block::{Deserializable, GetRepresentationHash, Serializable, Transaction};
use ton_types::UInt256;
use transaction_consumer::TransactionConsumer;
use crate::AnyExtractable;

pub struct BufferedConsumerConfig {
pub transaction_consumer: Arc<TransactionConsumer>,
Expand All @@ -19,6 +18,12 @@ pub struct BufferedConsumerConfig {
pub cache_timer: i32,
}

#[derive(Debug, Clone)]
pub enum AnyExtractable {
Event(ton_abi::Event),
Function(ton_abi::Function),
}

impl BufferedConsumerConfig {
pub fn new(
transaction_consumer: Arc<TransactionConsumer>,
Expand Down

0 comments on commit fb8a5bf

Please sign in to comment.