diff --git a/digital_asset_types/src/dao/full_asset.rs b/digital_asset_types/src/dao/full_asset.rs index a8a3dd391..fda932d21 100644 --- a/digital_asset_types/src/dao/full_asset.rs +++ b/digital_asset_types/src/dao/full_asset.rs @@ -1,5 +1,4 @@ use crate::dao::{asset, asset_authority, asset_creators, asset_data, asset_grouping}; -use sea_orm::FromQueryResult; #[derive(Clone, Debug, PartialEq)] pub struct FullAsset { diff --git a/digital_asset_types/src/dao/mod.rs b/digital_asset_types/src/dao/mod.rs index 3c0e2ff65..bd874f32b 100644 --- a/digital_asset_types/src/dao/mod.rs +++ b/digital_asset_types/src/dao/mod.rs @@ -3,19 +3,16 @@ mod generated; pub mod scopes; pub use full_asset::*; pub use generated::*; -use solana_sdk::pubkey::Pubkey; use self::sea_orm_active_enums::{ OwnerType, RoyaltyTargetType, SpecificationAssetClass, SpecificationVersions, }; use sea_orm::{ entity::*, - query::*, sea_query::Expr, sea_query::{ConditionType, IntoCondition}, Condition, DbErr, RelationDef, }; -use serde::{self, Deserialize, Serialize}; pub struct GroupingSize { pub size: u64, diff --git a/digital_asset_types/src/dapi/common/asset.rs b/digital_asset_types/src/dapi/common/asset.rs index 54d658edb..d454e34af 100644 --- a/digital_asset_types/src/dapi/common/asset.rs +++ b/digital_asset_types/src/dapi/common/asset.rs @@ -1,7 +1,7 @@ -use crate::dao::sea_orm_active_enums::{SpecificationAssetClass, SpecificationVersions}; +use crate::dao::sea_orm_active_enums::SpecificationVersions; use crate::dao::Pagination; use crate::dao::{asset, asset_authority, asset_creators, asset_data, asset_grouping}; -use crate::dao::{FullAsset, FullAssetList}; +use crate::dao::FullAsset; use crate::rpc::filter::{AssetSortBy, AssetSortDirection, AssetSorting}; use crate::rpc::response::{AssetError, AssetList}; @@ -12,10 +12,9 @@ use crate::rpc::{ use jsonpath_lib::JsonPathError; use mime_guess::Mime; -use sea_orm::DatabaseConnection; -use sea_orm::{entity::*, query::*, DbErr}; +use sea_orm::DbErr; use serde_json::Value; -use std::collections::{BTreeMap, HashMap}; +use std::collections::HashMap; use std::path::Path; use url::Url; diff --git a/nft_ingester/src/account_updates.rs b/nft_ingester/src/account_updates.rs index 97e5fa061..f25933fd4 100644 --- a/nft_ingester/src/account_updates.rs +++ b/nft_ingester/src/account_updates.rs @@ -1,16 +1,14 @@ use std::{ - collections::{HashMap, HashSet}, sync::Arc, }; use crate::{ - config::rand_string, error::IngesterError, metric, metrics::capture_result, + metric, metrics::capture_result, program_transformers::ProgramTransformer, tasks::TaskData, }; -use cadence_macros::{is_global_default_set, statsd_count, statsd_gauge, statsd_time}; +use cadence_macros::{is_global_default_set, statsd_count, statsd_time}; use chrono::Utc; -use futures::{stream::FuturesUnordered, StreamExt}; -use log::{debug, error, info}; +use log::{debug, error}; use plerkle_messenger::{ConsumptionType, Messenger, MessengerConfig, RecvData, ACCOUNT_STREAM}; use plerkle_serialization::root_as_account_info; use sqlx::{Pool, Postgres}; diff --git a/nft_ingester/src/backfiller.rs b/nft_ingester/src/backfiller.rs index 4e85a84f6..a1d95729d 100644 --- a/nft_ingester/src/backfiller.rs +++ b/nft_ingester/src/backfiller.rs @@ -37,7 +37,7 @@ use solana_transaction_status::{ use spl_account_compression::state::{ merkle_tree_get_size, ConcurrentMerkleTreeHeader, CONCURRENT_MERKLE_TREE_HEADER_SIZE_V1, }; -use sqlx::{self, postgres::PgListener, Pool, Postgres}; +use sqlx::{self, Pool, Postgres}; use std::{ cmp, collections::{HashMap, HashSet}, @@ -206,7 +206,7 @@ impl<'a, T: Messenger> Backfiller<'a, T> { let db = SqlxPostgresConnector::from_sqlx_postgres_pool(pool.clone()); // Get database listener channel. - let channel = config + let _channel = config .database_config .get(DATABASE_LISTENER_CHANNEL_KEY) .and_then(|u| u.clone().into_string()) diff --git a/nft_ingester/src/database.rs b/nft_ingester/src/database.rs index 209480135..435ad229a 100644 --- a/nft_ingester/src/database.rs +++ b/nft_ingester/src/database.rs @@ -2,7 +2,6 @@ use sqlx::{postgres::{PgPoolOptions, PgConnectOptions}, PgPool, ConnectOptions}; use crate::{ config::{IngesterConfig, IngesterRole}, - error, }; const BARE_MINIMUM_CONNECTIONS: u32 = 5; const DEFAULT_MAX: u32 = 125; diff --git a/nft_ingester/src/program_transformers/bubblegum/decompress.rs b/nft_ingester/src/program_transformers/bubblegum/decompress.rs index b76ccdd74..fa81a42be 100644 --- a/nft_ingester/src/program_transformers/bubblegum/decompress.rs +++ b/nft_ingester/src/program_transformers/bubblegum/decompress.rs @@ -1,9 +1,8 @@ -use super::{save_changelog_event, update_asset}; use crate::error::IngesterError; use blockbuster::{instruction::InstructionBundle, programs::bubblegum::BubblegumInstruction}; use digital_asset_types::dao::asset; use sea_orm::{ - entity::*, query::*, ColumnTrait, ConnectionTrait, DatabaseTransaction, DbBackend, EntityTrait, + entity::*, query::*, ColumnTrait, ConnectionTrait, DbBackend, EntityTrait, }; pub async fn decompress<'c, T>( diff --git a/nft_ingester/src/program_transformers/mod.rs b/nft_ingester/src/program_transformers/mod.rs index d7952d3b7..3f74411d3 100644 --- a/nft_ingester/src/program_transformers/mod.rs +++ b/nft_ingester/src/program_transformers/mod.rs @@ -7,9 +7,9 @@ use blockbuster::{ token_metadata::TokenMetadataParser, ProgramParseResult, }, }; -use log::{debug, error, info}; +use log::{debug, info}; use plerkle_serialization::{AccountInfo, Pubkey as FBPubkey, TransactionInfo}; -use sea_orm::{DatabaseConnection, SqlxPostgresConnector, TransactionTrait}; +use sea_orm::{DatabaseConnection, SqlxPostgresConnector}; use solana_sdk::pubkey::Pubkey; use sqlx::PgPool; use std::collections::{HashMap, HashSet, VecDeque}; diff --git a/nft_ingester/src/program_transformers/token/mod.rs b/nft_ingester/src/program_transformers/token/mod.rs index d2b38dd9c..86d5f0178 100644 --- a/nft_ingester/src/program_transformers/token/mod.rs +++ b/nft_ingester/src/program_transformers/token/mod.rs @@ -7,7 +7,7 @@ use sea_orm::{ DatabaseConnection, DbBackend, EntityTrait, }; use solana_sdk::program_option::COption; -use spl_token::state::{AccountState, Mint, Account}; +use spl_token::state::{AccountState}; use tokio::sync::mpsc::UnboundedSender; pub async fn handle_token_program_account<'a, 'b, 'c>( diff --git a/nft_ingester/src/transaction_notifications.rs b/nft_ingester/src/transaction_notifications.rs index b71096d7a..6e66fb799 100644 --- a/nft_ingester/src/transaction_notifications.rs +++ b/nft_ingester/src/transaction_notifications.rs @@ -1,13 +1,12 @@ use std::sync::Arc; use crate::{ - config::rand_string, error::IngesterError, metric, metrics::capture_result, + metric, metrics::capture_result, program_transformers::ProgramTransformer, tasks::TaskData, }; -use cadence_macros::{is_global_default_set, statsd_count, statsd_gauge, statsd_time}; +use cadence_macros::{is_global_default_set, statsd_count, statsd_time}; use chrono::Utc; -use futures::{stream::FuturesUnordered, StreamExt}; -use log::{debug, error, info}; +use log::{debug, error}; use plerkle_messenger::{ ConsumptionType, Messenger, MessengerConfig, RecvData, TRANSACTION_STREAM, }; @@ -15,7 +14,7 @@ use plerkle_serialization::root_as_transaction_info; use sqlx::{Pool, Postgres}; use tokio::{ - sync::{mpsc::UnboundedSender, Semaphore}, + sync::mpsc::UnboundedSender, task::{JoinHandle, JoinSet}, time::Instant, };