diff --git a/core/apps/dynode/src/jsonrpc_types.rs b/core/apps/dynode/src/jsonrpc_types.rs index 86370d6b06..2663d03e70 100644 --- a/core/apps/dynode/src/jsonrpc_types.rs +++ b/core/apps/dynode/src/jsonrpc_types.rs @@ -94,10 +94,6 @@ pub enum JsonRpcRequest { } impl JsonRpcRequest { - pub fn get_methods_list(&self) -> String { - self.get_methods_for_metrics().join(",") - } - pub fn get_methods_for_metrics(&self) -> Vec { match self { Self::Single(call) => vec![call.method.clone()], diff --git a/core/crates/api_connector/src/app_store_client/client.rs b/core/crates/api_connector/src/app_store_client/client.rs deleted file mode 100644 index a1abdebc8f..0000000000 --- a/core/crates/api_connector/src/app_store_client/client.rs +++ /dev/null @@ -1,44 +0,0 @@ -use super::models::{App, AppStoreError, AppStoreResponse, AppStoreReviews}; -pub struct AppStoreClient { - base_url: String, - client: reqwest::Client, -} - -impl Default for AppStoreClient { - fn default() -> Self { - Self::new() - } -} - -impl AppStoreClient { - pub fn new() -> Self { - AppStoreClient { - base_url: "https://itunes.apple.com".to_string(), - client: gem_client::reqwest_client(), - } - } - - pub async fn lookup(&self, app_id: u64, country: &str) -> Result { - let url = format!("{}/lookup", self.base_url); - let query = [("id", &app_id.to_string()), ("country", &country.to_string())]; - - let response = self.client.get(&url).query(&query).send().await?.json::().await?; - match response.results.first() { - Some(app) => Ok(app.clone()), - None => Err(AppStoreError::AppNotFound), - } - } - - pub async fn search_apps(&self, term: &str, country: &str, limit: u32) -> Result { - let url = format!("{}/search", self.base_url); - let query = [("term", term), ("country", country), ("entity", "software"), ("limit", &limit.to_string())]; - let response = self.client.get(&url).query(&query).send().await?.json::().await?; - Ok(response) - } - - pub async fn reviews(&self, app_id: u64, country: &str) -> Result { - let url = format!("{}/{}/rss/customerreviews/id={}/mostRecent/json", self.base_url, country, app_id); - let response = self.client.get(&url).send().await?.json::().await?; - Ok(response) - } -} diff --git a/core/crates/api_connector/src/app_store_client/mod.rs b/core/crates/api_connector/src/app_store_client/mod.rs deleted file mode 100644 index 04f3e94ba1..0000000000 --- a/core/crates/api_connector/src/app_store_client/mod.rs +++ /dev/null @@ -1,2 +0,0 @@ -pub mod client; -pub mod models; diff --git a/core/crates/api_connector/src/app_store_client/models.rs b/core/crates/api_connector/src/app_store_client/models.rs deleted file mode 100644 index 9cf5b47092..0000000000 --- a/core/crates/api_connector/src/app_store_client/models.rs +++ /dev/null @@ -1,75 +0,0 @@ -use chrono::NaiveDateTime; -use serde::Deserialize; -#[derive(Debug)] -pub enum AppStoreError { - Request(reqwest::Error), - AppNotFound, -} - -impl From for AppStoreError { - fn from(err: reqwest::Error) -> AppStoreError { - AppStoreError::Request(err) - } -} - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct AppStoreResponse { - pub results: Vec, -} - -#[derive(Debug, Clone, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct App { - pub track_id: u64, - pub version: String, - pub user_rating_count: Option, - pub average_user_rating: Option, - pub track_name: String, - pub release_date: NaiveDateTime, - pub current_version_release_date: NaiveDateTime, -} - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct AppStoreReviews { - pub feed: AppStoreFeed, -} - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct AppStoreFeed { - pub entry: Option, -} - -#[derive(Debug, Deserialize)] -#[serde(untagged)] -pub enum AppStoreReviewEntries { - Single(AppStoreReviewEntry), - Multiple(Vec), -} - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct AppStoreReviewEntry { - #[serde(rename = "im:rating")] - pub rating: AppStoreReviewLabel, - #[serde(rename = "im:version")] - pub version: AppStoreReviewLabel, - pub id: AppStoreReviewLabel, - pub title: AppStoreReviewLabel, - pub content: AppStoreReviewLabel, - pub author: AppStoreReviewAuthor, -} - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct AppStoreReviewLabel { - pub label: String, -} - -#[derive(Debug, Deserialize)] -#[serde(rename_all = "camelCase")] -pub struct AppStoreReviewAuthor { - pub name: AppStoreReviewLabel, -} diff --git a/core/crates/api_connector/src/lib.rs b/core/crates/api_connector/src/lib.rs index fbf4f4ad09..47409704f1 100644 --- a/core/crates/api_connector/src/lib.rs +++ b/core/crates/api_connector/src/lib.rs @@ -1,7 +1,5 @@ -pub mod app_store_client; pub mod pusher; pub mod static_assets_client; -pub use self::app_store_client::client::AppStoreClient; pub use self::pusher::client::PusherClient; pub use self::pusher::model::PushResult; pub use self::static_assets_client::client::StaticAssetsClient; diff --git a/core/crates/cacher/src/lib.rs b/core/crates/cacher/src/lib.rs index e116223987..05cd3d7ca0 100644 --- a/core/crates/cacher/src/lib.rs +++ b/core/crates/cacher/src/lib.rs @@ -20,14 +20,6 @@ impl CacherClient { Ok(Self { connection }) } - pub async fn set_values(&self, values: Vec<(String, String)>) -> Result> { - if values.is_empty() { - return Ok(0); - } - self.connection.clone().mset::(values.as_slice()).await?; - Ok(values.len()) - } - pub async fn set_values_with_publish(&self, values: Vec<(String, String)>, ttl_seconds: i64) -> Result> { let values = values.into_iter().map(|(key, value)| (key, value, ttl_seconds)).collect(); self.set_serialized_values_with_ttl_and_publish(values, true).await @@ -121,10 +113,6 @@ impl CacherClient { Ok(self.connection.clone().del(keys).await?) } - pub async fn increment(&self, key: &str) -> Result> { - Ok(self.connection.clone().incr(key, 1).await?) - } - pub async fn increment_with_ttl(&self, key: &str, ttl: i64) -> Result> { let mut pipe = redis::pipe(); pipe.atomic(); @@ -144,10 +132,6 @@ impl CacherClient { Ok(()) } - pub async fn get_cached(&self, key: CacheKey<'_>) -> Result> { - self.get_value(&key.key()).await - } - pub async fn get_cached_optional(&self, key: CacheKey<'_>) -> Result, Box> { self.get_value_optional(&key.key()).await } @@ -245,15 +229,6 @@ impl CacherClient { self.can_process_now(&key.key(), key.ttl()).await } - pub async fn set_i64(&self, key: &str, value: i64, ttl_seconds: u64) -> Result<(), Box> { - self.connection.clone().set_ex::<&str, i64, ()>(key, value, ttl_seconds).await?; - Ok(()) - } - - pub async fn get_i64(&self, key: &str) -> Result, Box> { - Ok(self.connection.clone().get::<&str, Option>(key).await?) - } - pub async fn sorted_set_incr_with_expire(&self, key: &str, members: &[String], ttl: i64) -> Result<(), Box> { if members.is_empty() { return Ok(()); @@ -272,10 +247,6 @@ impl CacherClient { Ok(self.connection.clone().publish(channel, &message).await?) } - pub async fn keys(&self, pattern: &str) -> Result, Box> { - Ok(redis::cmd("KEYS").arg(pattern).query_async(&mut self.connection.clone()).await?) - } - pub async fn sorted_set_range_by_score(&self, key: &str, min: f64, max: f64, limit: usize) -> Result, Box> { Ok(redis::cmd("ZRANGEBYSCORE") .arg(key) diff --git a/core/crates/chain_traits/src/node_check.rs b/core/crates/chain_traits/src/node_check.rs index 3e1e9fdebf..563f9cd335 100644 --- a/core/crates/chain_traits/src/node_check.rs +++ b/core/crates/chain_traits/src/node_check.rs @@ -59,10 +59,6 @@ impl NodeCheckRecorder { self.record_result(method, result.map(|value| (value, "available".to_string())), started.elapsed()).0 } - pub fn record_available(self, method: &str, result: Result) -> Self { - self.record_result(method, result.map(|value| (value, "available".to_string())), Duration::ZERO).0 - } - pub async fn record_optional_available_timed>>(self, method: &str, future: F) -> Self { let started = Instant::now(); let result = future.await; diff --git a/core/crates/coingecko/src/testkit.rs b/core/crates/coingecko/src/testkit.rs index 30b19216a6..02dcd0c9a1 100644 --- a/core/crates/coingecko/src/testkit.rs +++ b/core/crates/coingecko/src/testkit.rs @@ -3,10 +3,6 @@ use chrono::{DateTime, Utc}; use crate::CoinMarket; impl CoinMarket { - pub fn mock() -> Self { - Self::mock_with_id("bitcoin") - } - pub fn mock_with_id(id: &str) -> Self { Self { id: id.to_string(), diff --git a/core/crates/coinmarketcap/src/client.rs b/core/crates/coinmarketcap/src/client.rs index e80402d1bc..1665086d23 100644 --- a/core/crates/coinmarketcap/src/client.rs +++ b/core/crates/coinmarketcap/src/client.rs @@ -13,10 +13,6 @@ pub struct CoinMarketCapClient { } impl CoinMarketCapClient { - pub fn new(api_key: &str) -> Self { - Self::new_with_reqwest_client(gem_client::reqwest_client(), api_key) - } - pub fn new_with_reqwest_client(client: reqwest::Client, api_key: &str) -> Self { Self::new_with_client_and_api_key(ReqwestClient::new(COINMARKETCAP_API_URL.to_string(), client), api_key) } diff --git a/core/crates/fiat/src/client.rs b/core/crates/fiat/src/client.rs index 9b7d34ff47..f889c97e52 100644 --- a/core/crates/fiat/src/client.rs +++ b/core/crates/fiat/src/client.rs @@ -84,13 +84,6 @@ impl FiatClient { Ok(FiatRepository::get_fiat_providers_countries(&mut self.database.fiat()?)?) } - pub async fn get_order_status(&self, provider_name: &str, order_id: &str) -> Result> { - let provider = self.provider(provider_name)?; - let update = provider.get_order_status(order_id).await?; - let transaction = self.database.fiat()?.update_fiat_transaction(provider.name(), update)?; - Ok(transaction.as_primitive()?) - } - pub async fn process_and_publish_webhook(&self, request: FiatWebhookRequest, provider_name: &str) -> Result> { let provider = self.provider(provider_name)?; let provider_id = provider.name().id().to_string(); @@ -231,10 +224,6 @@ impl FiatClient { Ok(FiatQuotes { quotes, errors }) } - pub async fn get_quote(&self, quote_id: &str) -> Result> { - Ok(self.fiat_cacher.get_quote(quote_id).await?.quote) - } - pub async fn get_quote_url(&self, quote_id: &str, wallet_id: i32, device_id: i32, ip_address: &str, locale: &str) -> Result> { let crate::CachedFiatQuoteData { quote, diff --git a/core/crates/fiat/src/providers/mercuryo/widget.rs b/core/crates/fiat/src/providers/mercuryo/widget.rs index 780fed8e38..4c79cfb454 100644 --- a/core/crates/fiat/src/providers/mercuryo/widget.rs +++ b/core/crates/fiat/src/providers/mercuryo/widget.rs @@ -71,10 +71,6 @@ impl MercuryoWidget { format!("v2:{}", hash) } - pub fn merchant_transaction_id(&self) -> &str { - &self.merchant_transaction_id - } - pub fn to_url(&self) -> String { let mut url = Url::parse(MERCURYO_REDIRECT_URL).unwrap(); diff --git a/core/crates/gem_algorand/src/rpc/client.rs b/core/crates/gem_algorand/src/rpc/client.rs index e7beb64b71..302284ad2b 100644 --- a/core/crates/gem_algorand/src/rpc/client.rs +++ b/core/crates/gem_algorand/src/rpc/client.rs @@ -1,7 +1,7 @@ use std::collections::HashMap; use std::error::Error; -use crate::models::{Account, AssetDetails, Block, TransactionBroadcast, TransactionStatus, TransactionsParams}; +use crate::models::{Account, AssetDetails, TransactionBroadcast, TransactionStatus, TransactionsParams}; use gem_client::{CONTENT_TYPE, ContentType}; #[cfg(feature = "rpc")] @@ -36,10 +36,6 @@ impl AlgorandClient { Ok(self.client.get("/v2/transactions/params").await?) } - pub async fn get_block(&self, block_number: u64) -> Result> { - Ok(self.client.get(&format!("/v2/blocks/{}", block_number)).await?) - } - pub async fn broadcast_transaction(&self, data: &str) -> Result> { let headers = HashMap::from([(CONTENT_TYPE.to_string(), ContentType::ApplicationXBinary.as_str().to_string())]); diff --git a/core/crates/gem_encoding/src/protobuf/decode.rs b/core/crates/gem_encoding/src/protobuf/decode.rs index 9991476748..296c2f323e 100644 --- a/core/crates/gem_encoding/src/protobuf/decode.rs +++ b/core/crates/gem_encoding/src/protobuf/decode.rs @@ -22,13 +22,6 @@ impl<'a> Field<'a> { } } - pub fn fixed32(self) -> MessageResult { - match self.value { - FieldValue::Fixed32(value) => Ok(value), - _ => Err(format!("protobuf field {} is not fixed32", self.number).into()), - } - } - pub fn bytes(self) -> MessageResult<&'a [u8]> { match self.value { FieldValue::Bytes(value) => Ok(value), @@ -50,7 +43,7 @@ enum FieldValue<'a> { Varint(u64), Fixed64(u64), Bytes(&'a [u8]), - Fixed32(u32), + Fixed32, } pub fn visit_fields(data: &[u8], mut visitor: impl FnMut(Field<'_>) -> MessageResult<()>) -> MessageResult<()> { @@ -72,7 +65,10 @@ pub fn visit_fields(data: &[u8], mut visitor: impl FnMut(Field<'_>) -> MessageRe position = end; FieldValue::Bytes(value) } - WIRE_FIXED32 => FieldValue::Fixed32(read_fixed32(data, &mut position)?), + WIRE_FIXED32 => { + skip_fixed32(data, &mut position)?; + FieldValue::Fixed32 + } _ => return Err(format!("unsupported protobuf wire type {wire_type}").into()), }; visitor(Field { number, value })?; @@ -112,14 +108,13 @@ fn read_fixed64(data: &[u8], position: &mut usize) -> MessageResult { Ok(value) } -fn read_fixed32(data: &[u8], position: &mut usize) -> MessageResult { +fn skip_fixed32(data: &[u8], position: &mut usize) -> MessageResult<()> { let end = position.checked_add(4).ok_or("invalid protobuf fixed32 length")?; if end > data.len() { return Err("truncated protobuf fixed32".into()); } - let value = u32::from_le_bytes(data[*position..end].try_into()?); *position = end; - Ok(value) + Ok(()) } #[macro_export] diff --git a/core/crates/gem_encoding/src/protobuf/field_codec.rs b/core/crates/gem_encoding/src/protobuf/field_codec.rs index 14d6623b47..3c0a67c925 100644 --- a/core/crates/gem_encoding/src/protobuf/field_codec.rs +++ b/core/crates/gem_encoding/src/protobuf/field_codec.rs @@ -23,10 +23,6 @@ pub mod string { *value = field.string()?; Ok(()) } - - pub fn encode(field_number: u32, value: &str) -> Vec { - encode_string_field(field_number, value) - } } pub mod optional_bytes { @@ -88,10 +84,6 @@ pub mod varint_u64 { *value = field.varint()?; Ok(()) } - - pub fn encode(field_number: u32, value: &u64) -> Vec { - encode_optional_u64_field(field_number, Some(*value)) - } } pub mod optional_varint_i32 { @@ -107,19 +99,6 @@ pub mod optional_varint_i32 { } } -pub mod optional_varint_i64 { - use super::*; - - pub fn decode(value: &mut Option, field: Field<'_>) -> MessageResult<()> { - *value = Some(field.varint()? as i64); - Ok(()) - } - - pub fn encode(field_number: u32, value: &Option) -> Vec { - encode_optional_u64_field(field_number, value.map(|value| value as u64)) - } -} - pub mod varint_i32 { use super::*; @@ -127,10 +106,6 @@ pub mod varint_i32 { *value = field.varint()? as i32; Ok(()) } - - pub fn encode(field_number: u32, value: &i32) -> Vec { - encode_optional_u64_field(field_number, Some(*value as u64)) - } } pub mod varint_i64 { @@ -140,10 +115,6 @@ pub mod varint_i64 { *value = field.varint()? as i64; Ok(()) } - - pub fn encode(field_number: u32, value: &i64) -> Vec { - encode_optional_u64_field(field_number, Some(*value as u64)) - } } pub mod optional_enum_varint { @@ -183,11 +154,6 @@ pub mod repeated_message { pub mod repeated_string { use super::*; - pub fn decode(value: &mut Vec, field: Field<'_>) -> MessageResult<()> { - value.push(field.string()?); - Ok(()) - } - pub fn encode(field_number: u32, value: &[String]) -> Vec { value.iter().flat_map(|value| encode_string_field(field_number, value)).collect() } diff --git a/core/crates/gem_encoding/src/protobuf/message.rs b/core/crates/gem_encoding/src/protobuf/message.rs index f0c9f03fb7..7ed11bcb75 100644 --- a/core/crates/gem_encoding/src/protobuf/message.rs +++ b/core/crates/gem_encoding/src/protobuf/message.rs @@ -9,7 +9,3 @@ pub trait MessageEncode { pub trait MessageDecode: Sized { fn decode(data: &[u8]) -> MessageResult; } - -pub trait Message: MessageEncode + MessageDecode {} - -impl Message for T where T: MessageEncode + MessageDecode {} diff --git a/core/crates/gem_encoding/src/protobuf/mod.rs b/core/crates/gem_encoding/src/protobuf/mod.rs index bceac37c8e..61f6b815db 100644 --- a/core/crates/gem_encoding/src/protobuf/mod.rs +++ b/core/crates/gem_encoding/src/protobuf/mod.rs @@ -12,4 +12,4 @@ pub use encode::{ encode_optional_u64_field, encode_raw_varint_field, encode_string_field, encode_varint, encode_varint_field, }; pub use grpc::{decode_grpc_frame, decode_grpc_message, encode_grpc_frame, encode_grpc_message}; -pub use message::{Message, MessageDecode, MessageEncode, MessageResult}; +pub use message::{MessageDecode, MessageEncode, MessageResult}; diff --git a/core/crates/gem_evm/src/provider/testkit.rs b/core/crates/gem_evm/src/provider/testkit.rs index 5e71b0f0de..3e10ca0e35 100644 --- a/core/crates/gem_evm/src/provider/testkit.rs +++ b/core/crates/gem_evm/src/provider/testkit.rs @@ -71,12 +71,6 @@ pub fn create_smartchain_test_client() -> EthereumProvider { build_test_client(EVMChain::SmartChain, &settings.chains.smartchain.url) } -#[cfg(all(test, feature = "rpc", feature = "reqwest"))] -pub fn create_polygon_test_client() -> EthereumProvider { - let settings = get_test_settings(); - build_test_client(EVMChain::Polygon, &settings.chains.polygon.url) -} - #[cfg(all(test, feature = "rpc", feature = "reqwest"))] pub fn create_arbitrum_test_client() -> EthereumProvider { let settings = get_test_settings(); diff --git a/core/crates/gem_hypercore/src/rpc/client.rs b/core/crates/gem_hypercore/src/rpc/client.rs index 3a004b60f5..373e5a563a 100644 --- a/core/crates/gem_hypercore/src/rpc/client.rs +++ b/core/crates/gem_hypercore/src/rpc/client.rs @@ -104,11 +104,6 @@ impl HyperCoreClient { self.info(json!({"type": "delegations", "user": user})).await } - pub async fn get_staking_apy(&self) -> Result> { - let validators = self.get_validators().await?; - Ok(Validator::max_apr(validators)) - } - pub async fn get_spot_balances(&self, user: &str) -> Result> { self.info(json!({ "type": "spotClearinghouseState", diff --git a/core/crates/gem_hypercore/src/testkit.rs b/core/crates/gem_hypercore/src/testkit.rs index 87fb1fe463..de82f4c43c 100644 --- a/core/crates/gem_hypercore/src/testkit.rs +++ b/core/crates/gem_hypercore/src/testkit.rs @@ -94,10 +94,6 @@ impl AssetMetadata { #[cfg(test)] impl HyperCoreClient { - pub fn mock() -> Self { - Self::mock_with_client(MockClient::new()) - } - pub fn mock_with_responses_by_request_type(responses: Vec<(&'static str, Vec)>) -> Self { let responses = Arc::new(responses); Self::mock_with_client(MockClient::new().with_post(move |path, body| { diff --git a/core/crates/gem_jsonrpc/src/grpc/reqwest_transport.rs b/core/crates/gem_jsonrpc/src/grpc/reqwest_transport.rs index 1a5183470f..9a687dd883 100644 --- a/core/crates/gem_jsonrpc/src/grpc/reqwest_transport.rs +++ b/core/crates/gem_jsonrpc/src/grpc/reqwest_transport.rs @@ -14,10 +14,6 @@ impl ReqwestGrpcTransport { client: gem_client::reqwest_client(), } } - - pub fn new_with_client(client: reqwest::Client) -> Self { - Self { client } - } } impl Default for ReqwestGrpcTransport { diff --git a/core/crates/gem_jsonrpc/src/types.rs b/core/crates/gem_jsonrpc/src/types.rs index 9c1c9b1e07..6b4110040c 100644 --- a/core/crates/gem_jsonrpc/src/types.rs +++ b/core/crates/gem_jsonrpc/src/types.rs @@ -6,7 +6,6 @@ pub const JSONRPC_VERSION: &str = "2.0"; pub const ERROR_INVALID_REQUEST: i32 = -32600; pub const ERROR_METHOD_NOT_FOUND: i32 = -32601; -pub const ERROR_INVALID_PARAMS: i32 = -32602; pub const ERROR_INTERNAL_ERROR: i32 = -32603; pub const ERROR_CLIENT_ERROR: i32 = -32900; diff --git a/core/crates/gem_solana/src/models/block.rs b/core/crates/gem_solana/src/models/block.rs index 4afe4b67a3..4a433a8bd0 100644 --- a/core/crates/gem_solana/src/models/block.rs +++ b/core/crates/gem_solana/src/models/block.rs @@ -1,4 +1,3 @@ -use crate::models::rpc::ValueResult; use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Deserialize)] @@ -27,8 +26,6 @@ pub struct Blockhash { pub blockhash: String, } -pub type LatestBlockhash = ValueResult; - #[derive(Debug, Clone, Deserialize)] #[serde(rename_all = "camelCase")] pub struct EpochInfo { diff --git a/core/crates/gem_solana/src/rpc/client.rs b/core/crates/gem_solana/src/rpc/client.rs index b006d514b7..55cebe4604 100644 --- a/core/crates/gem_solana/src/rpc/client.rs +++ b/core/crates/gem_solana/src/rpc/client.rs @@ -1,7 +1,7 @@ use crate::jsonrpc::{SolanaAccountEncoding, SolanaProgramAccountsFilter, SolanaRpc, SolanaRpcConfig, SolanaTokenAccountsFilter}; use crate::models::{ - AccountData, EpochInfo, InflationRate, ResultTokenInfo, Signature, SupplyResult, TokenAccountInfo, ValueResult, VoteAccounts, balances::SolanaBalance, - blockhash::SolanaBlockhashResult, prioritization_fee::SolanaPrioritizationFee, simulation::SimulateTransactionResult, transaction::BlockTransactions, + AccountData, EpochInfo, InflationRate, ResultTokenInfo, SupplyResult, TokenAccountInfo, ValueResult, VoteAccounts, balances::SolanaBalance, blockhash::SolanaBlockhashResult, + prioritization_fee::SolanaPrioritizationFee, simulation::SimulateTransactionResult, transaction::BlockTransactions, }; use crate::{ STAKE_PROGRAM_ID, @@ -164,15 +164,6 @@ impl SolanaClient { self.client.request(SolanaRpc::GetBlock(slot)).await } - pub async fn get_signatures_for_address(&self, address: &str, limit: usize) -> Result, JsonRpcError> { - self.client - .request(SolanaRpc::GetSignaturesForAddress { - address: address.to_string(), - limit, - }) - .await - } - pub async fn get_token_accounts(&self, address: &str, token_mints: &[String]) -> Result>>, Box> { let requests: Vec = token_mints .iter() diff --git a/core/crates/gem_sui/src/models/coin.rs b/core/crates/gem_sui/src/models/coin.rs index 5c270df96e..d5c8837758 100644 --- a/core/crates/gem_sui/src/models/coin.rs +++ b/core/crates/gem_sui/src/models/coin.rs @@ -50,14 +50,6 @@ impl OwnedCoins { address_balance, } } - - pub fn map(self, f: impl FnMut(T) -> U) -> OwnedCoins { - OwnedCoins { - coin_type: self.coin_type, - coins: self.coins.into_iter().map(f).collect(), - address_balance: self.address_balance, - } - } } impl OwnedCoins { diff --git a/core/crates/gem_sui/src/tx_builder/mod.rs b/core/crates/gem_sui/src/tx_builder/mod.rs index 5af4acad6e..95dc4e8576 100644 --- a/core/crates/gem_sui/src/tx_builder/mod.rs +++ b/core/crates/gem_sui/src/tx_builder/mod.rs @@ -22,7 +22,5 @@ pub(crate) use transaction::build_amount_coin; pub use transaction::{build_input_coin, decode_transaction, finish_transaction, move_call, validate_and_hash, zero_coin}; pub use transaction_json::is_transaction_json; #[cfg(feature = "rpc")] -pub use transaction_json::{ - ReplayedTransaction, TransactionJsonReplay, finish_transaction_json, finish_transaction_json_from_sender, prepare_transaction_json_replay, replay_transaction_json, -}; +pub use transaction_json::{ReplayedTransaction, TransactionJsonReplay, finish_transaction_json, finish_transaction_json_from_sender, prepare_transaction_json_replay}; pub use transfer::*; diff --git a/core/crates/gem_sui/src/tx_builder/transaction_json/mod.rs b/core/crates/gem_sui/src/tx_builder/transaction_json/mod.rs index 5e1e7c6558..5357f6a566 100644 --- a/core/crates/gem_sui/src/tx_builder/transaction_json/mod.rs +++ b/core/crates/gem_sui/src/tx_builder/transaction_json/mod.rs @@ -20,4 +20,4 @@ pub fn is_transaction_json(data: &[u8]) -> bool { #[cfg(feature = "rpc")] pub use finish::{finish_transaction_json, finish_transaction_json_from_sender}; #[cfg(feature = "rpc")] -pub use replay::{ReplayedTransaction, TransactionJsonReplay, prepare_transaction_json_replay, replay_transaction_json}; +pub use replay::{ReplayedTransaction, TransactionJsonReplay, prepare_transaction_json_replay}; diff --git a/core/crates/gem_sui/src/tx_builder/transaction_json/replay.rs b/core/crates/gem_sui/src/tx_builder/transaction_json/replay.rs index 1021378be6..bb03e424dd 100644 --- a/core/crates/gem_sui/src/tx_builder/transaction_json/replay.rs +++ b/core/crates/gem_sui/src/tx_builder/transaction_json/replay.rs @@ -44,10 +44,6 @@ impl TransactionJsonReplay { } } -pub async fn replay_transaction_json(client: &SuiClient, transaction_json: &str) -> Result { - prepare_transaction_json_replay(client, transaction_json).await?.replay() -} - pub async fn prepare_transaction_json_replay(client: &SuiClient, transaction_json: &str) -> Result { prepare_replay(client, parse_transaction_json(transaction_json)?).await } diff --git a/core/crates/gem_ton/src/provider/testkit.rs b/core/crates/gem_ton/src/provider/testkit.rs index 191ca1a82d..4c43e80060 100644 --- a/core/crates/gem_ton/src/provider/testkit.rs +++ b/core/crates/gem_ton/src/provider/testkit.rs @@ -25,8 +25,6 @@ pub const FAILED_SWAP_ROOT_TRANSACTION_HEX_HASH: &str = "2f9120a5ff48decb8897a09 #[cfg(test)] pub const SUCCESS_SWAP_MESSAGE_HASH: &str = "e993d4c13053978b6265157561c454ef731274d836e3139ed64fdf58b6635bf7"; #[cfg(test)] -pub const SUCCESS_SWAP_ROOT_TRANSACTION_HASH: &str = "6ZPUwTBTl4tiZRV1YcRU73MSdNg24xOe1k/fWLZjW/c="; -#[cfg(test)] pub const SUCCESS_SWAP_ROOT_TRANSACTION_HEX_HASH: &str = "e993d4c13053978b6265157561c454ef731274d836e3139ed64fdf58b6635bf7"; #[cfg(test)] diff --git a/core/crates/gem_ton/src/tvm/writer.rs b/core/crates/gem_ton/src/tvm/writer.rs index 318f40826b..38dceb883f 100644 --- a/core/crates/gem_ton/src/tvm/writer.rs +++ b/core/crates/gem_ton/src/tvm/writer.rs @@ -9,10 +9,6 @@ pub struct BitWriter { } impl BitWriter { - pub fn new() -> Self { - Self::default() - } - pub fn write_bit(&mut self, value: bool) -> Result<(), TvmError> { if self.bit_len == MAX_CELL_BITS { return Err(TvmError::new(format!("cell exceeds {MAX_CELL_BITS} bits"))); diff --git a/core/crates/jupiter/src/client.rs b/core/crates/jupiter/src/client.rs index a7c94c675a..afe87524e7 100644 --- a/core/crates/jupiter/src/client.rs +++ b/core/crates/jupiter/src/client.rs @@ -12,10 +12,6 @@ pub struct JupiterClient { } impl JupiterClient { - pub fn new_with_api_key(url: String, api_key: String) -> Self { - Self::new_with_client_and_api_key(ReqwestClient::new(url, gem_client::reqwest_client()), api_key) - } - pub fn new_with_reqwest_client(client: reqwest::Client) -> Self { Self::new_with_client(ReqwestClient::new(JUPITER_API_URL.to_string(), client)) } diff --git a/core/crates/localizer/src/lib.rs b/core/crates/localizer/src/lib.rs index eb3d378fec..85879ab897 100644 --- a/core/crates/localizer/src/lib.rs +++ b/core/crates/localizer/src/lib.rs @@ -215,10 +215,6 @@ impl LanguageLocalizer { fl!(self.loader.as_ref(), "notification_reward_pending_title") } - pub fn notification_reward_pending_description(&self) -> String { - fl!(self.loader.as_ref(), "notification_reward_pending_description") - } - pub fn notification_reward_redeemed_title(&self) -> String { fl!(self.loader.as_ref(), "notification_rewards_redeem_points_title") } diff --git a/core/crates/name_resolver/src/testkit.rs b/core/crates/name_resolver/src/testkit.rs index 02954f9aad..8369adb531 100644 --- a/core/crates/name_resolver/src/testkit.rs +++ b/core/crates/name_resolver/src/testkit.rs @@ -29,10 +29,6 @@ impl TestProvider { response, } } - - pub fn boxed(provider: NameProvider, domains: Vec<&'static str>, chains: Vec, response: Result<&'static str, &'static str>) -> Box { - Box::new(Self::new(provider, domains, chains, response)) - } } #[async_trait] diff --git a/core/crates/nft/src/provider.rs b/core/crates/nft/src/provider.rs index 708c149323..52f01f3ecc 100644 --- a/core/crates/nft/src/provider.rs +++ b/core/crates/nft/src/provider.rs @@ -53,23 +53,6 @@ impl NFTProviders { .filter(move |provider| provider.chains().iter().any(|nft_chain| Chain::from(*nft_chain) == chain)) } - async fn fetch_assets(chain: Chain, address: String, providers: impl Iterator>) -> Vec { - let operations = providers.map(|provider| provider.get_assets(chain, address.clone())).collect::>(); - match try_in_order(operations).await { - Ok(Some(asset_ids)) => asset_ids, - Ok(None) | Err(_) => Vec::new(), - } - } - - pub async fn get_assets(&self, addresses: HashMap) -> Vec { - let futures = addresses.into_iter().map(|(chain, address)| { - let providers = self.providers_for_chain(chain); - async move { Self::fetch_assets(chain, address, providers).await } - }); - - futures::future::join_all(futures).await.into_iter().flatten().collect() - } - pub async fn get_collection(&self, collection_id: NFTCollectionId) -> Option { let operations = self .providers_for_chain(collection_id.chain) diff --git a/core/crates/number_formatter/src/currency.rs b/core/crates/number_formatter/src/currency.rs index 9be341c7a0..b72a269149 100644 --- a/core/crates/number_formatter/src/currency.rs +++ b/core/crates/number_formatter/src/currency.rs @@ -361,10 +361,6 @@ impl Money { Ok(Money { amount, currency }) } - pub fn new(amount: Decimal, currency: Currency) -> Self { - Money { amount, currency } - } - pub fn currency(&self) -> &Currency { &self.currency } diff --git a/core/crates/serde_serializers/src/f64.rs b/core/crates/serde_serializers/src/f64.rs index f9a2989b31..15948b8990 100644 --- a/core/crates/serde_serializers/src/f64.rs +++ b/core/crates/serde_serializers/src/f64.rs @@ -1,12 +1,5 @@ use serde::{Deserialize, Deserializer, de}; -pub fn serialize_f64(value: &f64, serializer: S) -> Result -where - S: serde::Serializer, -{ - serializer.serialize_str(&value.to_string()) -} - pub fn deserialize_f64_from_str<'de, D>(deserializer: D) -> Result where D: Deserializer<'de>, diff --git a/core/crates/serde_serializers/src/lib.rs b/core/crates/serde_serializers/src/lib.rs index e4571b3db0..c41a4c17cf 100644 --- a/core/crates/serde_serializers/src/lib.rs +++ b/core/crates/serde_serializers/src/lib.rs @@ -15,10 +15,10 @@ pub use biguint::{ pub mod duration; pub use duration::{deserialize as deserialize_duration, deserialize_option as deserialize_option_duration}; pub mod f64; -pub use f64::{deserialize_f64_from_str, deserialize_option_f64_from_str, serialize_f64}; +pub use f64::{deserialize_f64_from_str, deserialize_option_f64_from_str}; pub mod hex_bytes; pub mod size; pub mod u64; -pub use u64::{deserialize_option_u64_from_str, deserialize_option_u64_from_str_or_int, deserialize_u64_from_str, deserialize_u64_from_str_or_int, serialize_u64}; +pub use u64::{deserialize_option_u64_from_str, deserialize_option_u64_from_str_or_int, deserialize_u64_from_str, deserialize_u64_from_str_or_int}; pub mod u128; -pub use u128::{deserialize_option_u128_from_str, deserialize_u128_from_str, serialize_u128}; +pub use u128::deserialize_option_u128_from_str; diff --git a/core/crates/serde_serializers/src/u128.rs b/core/crates/serde_serializers/src/u128.rs index 7775b26e58..7b4e9df503 100644 --- a/core/crates/serde_serializers/src/u128.rs +++ b/core/crates/serde_serializers/src/u128.rs @@ -1,20 +1,5 @@ use serde::{Deserialize, Deserializer}; -pub fn serialize_u128(value: &u128, serializer: S) -> Result -where - S: serde::Serializer, -{ - serializer.serialize_str(&value.to_string()) -} - -pub fn deserialize_u128_from_str<'de, D>(deserializer: D) -> Result -where - D: Deserializer<'de>, -{ - let s: String = Deserialize::deserialize(deserializer)?; - s.parse::().map_err(serde::de::Error::custom) -} - pub fn deserialize_option_u128_from_str<'de, D>(deserializer: D) -> Result, D::Error> where D: Deserializer<'de>, diff --git a/core/crates/serde_serializers/src/u64.rs b/core/crates/serde_serializers/src/u64.rs index 60b6d1168d..35cdb5ab5c 100644 --- a/core/crates/serde_serializers/src/u64.rs +++ b/core/crates/serde_serializers/src/u64.rs @@ -35,13 +35,6 @@ impl StringOrNumberFromValue for u64 { } } -pub fn serialize_u64(value: &u64, serializer: S) -> Result -where - S: serde::Serializer, -{ - serializer.serialize_str(&value.to_string()) -} - pub fn deserialize_u64_from_str<'de, D>(deserializer: D) -> Result where D: Deserializer<'de>, diff --git a/core/crates/settings_chain/src/chain_providers.rs b/core/crates/settings_chain/src/chain_providers.rs index 5acfbac0e3..a78d792534 100644 --- a/core/crates/settings_chain/src/chain_providers.rs +++ b/core/crates/settings_chain/src/chain_providers.rs @@ -45,10 +45,6 @@ impl ChainProviders { self.get_provider(chain)?.get_balance_coin(address).await } - pub async fn get_balance_tokens(&self, chain: Chain, address: String, token_ids: Vec) -> Result, Box> { - self.get_provider(chain)?.get_balance_tokens(address, token_ids).await - } - pub async fn get_balance_assets(&self, chain: Chain, address: String) -> Result, Box> { self.get_provider(chain)?.get_balance_assets(address).await } diff --git a/core/crates/storage/src/database/fiat.rs b/core/crates/storage/src/database/fiat.rs index 7e6c6e7d8e..b3cdab4568 100644 --- a/core/crates/storage/src/database/fiat.rs +++ b/core/crates/storage/src/database/fiat.rs @@ -326,10 +326,6 @@ impl DatabaseClient { FiatStore::add_fiat_providers_countries(self, values) } - pub fn get_fiat_providers_countries(&mut self) -> Result, diesel::result::Error> { - FiatStore::get_fiat_providers_countries(self) - } - pub fn update_fiat_transaction(&mut self, provider: FiatProviderName, update: FiatTransactionUpdate) -> Result { FiatStore::update_fiat_transaction(self, provider, update) } @@ -338,22 +334,10 @@ impl DatabaseClient { FiatStore::get_fiat_transaction(self, provider, transaction_id) } - pub fn get_fiat_transactions_by_device_and_wallet_id(&mut self, device_id: i32, wallet_id: i32) -> Result, diesel::result::Error> { - FiatStore::get_fiat_transactions_by_device_and_wallet_id(self, device_id, wallet_id) - } - - pub fn get_fiat_transactions_by_device_id(&mut self, device_id: i32) -> Result, diesel::result::Error> { - FiatStore::get_fiat_transactions_by_device_id(self, device_id) - } - pub fn get_fiat_assets_by_filter(&mut self, filters: Vec) -> Result, diesel::result::Error> { FiatStore::get_fiat_assets_by_filter(self, filters) } - pub fn get_fiat_assets_popular(&mut self, from: NaiveDateTime, limit: i64) -> Result, diesel::result::Error> { - FiatStore::get_fiat_assets_popular(self, from, limit) - } - pub fn set_fiat_rates(&mut self, rates: Vec) -> Result { FiatStore::set_fiat_rates(self, rates) } diff --git a/core/crates/storage/src/database/mod.rs b/core/crates/storage/src/database/mod.rs index 0799ee4fd0..a902c390d5 100644 --- a/core/crates/storage/src/database/mod.rs +++ b/core/crates/storage/src/database/mod.rs @@ -38,14 +38,8 @@ pub type PgPool = Pool>; pub type PgPooledConnection = PooledConnection>; use crate::repositories::{ - api_clients_repository::ApiClientsRepository, assets_addresses_repository::AssetsAddressesRepository, assets_links_repository::AssetsLinksRepository, - assets_repository::AssetsRepository, assets_usage_ranks_repository::AssetsUsageRanksRepository, chains_repository::ChainsRepository, charts_repository::ChartsRepository, - config_repository::ConfigRepository, devices_repository::DevicesRepository, fiat_repository::FiatRepository, migrations_repository::MigrationsRepository, - nft_repository::NftRepository, notifications_repository::NotificationsRepository, parser_state_repository::ParserStateRepository, perpetuals_repository::PerpetualsRepository, - price_alerts_repository::PriceAlertsRepository, prices_providers_repository::PricesProvidersRepository, prices_repository::PricesRepository, - releases_repository::ReleasesRepository, rewards_redemptions_repository::RewardsRedemptionsRepository, rewards_repository::RewardsRepository, - scan_addresses_repository::ScanAddressesRepository, support_sessions_repository::SupportSessionsRepository, tag_repository::TagRepository, - transactions_repository::TransactionsRepository, wallets_repository::WalletsRepository, + config_repository::ConfigRepository, devices_repository::DevicesRepository, fiat_repository::FiatRepository, nft_repository::NftRepository, + perpetuals_repository::PerpetualsRepository, rewards_repository::RewardsRepository, }; pub fn create_pool(database_url: &str, pool_size: u32) -> PgPool { @@ -66,34 +60,6 @@ impl DatabaseClient { Ok(Self { connection }) } - pub fn assets(&mut self) -> &mut dyn AssetsRepository { - self - } - - pub fn api_clients(&mut self) -> &mut dyn ApiClientsRepository { - self - } - - pub fn assets_addresses(&mut self) -> &mut dyn AssetsAddressesRepository { - self - } - - pub fn assets_links(&mut self) -> &mut dyn AssetsLinksRepository { - self - } - - pub fn assets_usage_ranks(&mut self) -> &mut dyn AssetsUsageRanksRepository { - self - } - - pub fn chains(&mut self) -> &mut dyn ChainsRepository { - self - } - - pub fn charts(&mut self) -> &mut dyn ChartsRepository { - self - } - pub fn config(&mut self) -> &mut dyn ConfigRepository { self } @@ -106,10 +72,6 @@ impl DatabaseClient { self } - pub fn migrations(&mut self) -> &mut dyn MigrationsRepository { - self - } - pub fn perpetuals(&mut self) -> &mut dyn PerpetualsRepository { self } @@ -118,55 +80,7 @@ impl DatabaseClient { self } - pub fn notifications(&mut self) -> &mut dyn NotificationsRepository { - self - } - - pub fn parser_state(&mut self) -> &mut dyn ParserStateRepository { - self - } - - pub fn price_alerts(&mut self) -> &mut dyn PriceAlertsRepository { - self - } - - pub fn prices(&mut self) -> &mut dyn PricesRepository { - self - } - - pub fn prices_providers(&mut self) -> &mut dyn PricesProvidersRepository { - self - } - pub fn rewards(&mut self) -> &mut dyn RewardsRepository { self } - - pub fn rewards_redemptions(&mut self) -> &mut dyn RewardsRedemptionsRepository { - self - } - - pub fn releases(&mut self) -> &mut dyn ReleasesRepository { - self - } - - pub fn scan_addresses(&mut self) -> &mut dyn ScanAddressesRepository { - self - } - - pub fn support_sessions(&mut self) -> &mut dyn SupportSessionsRepository { - self - } - - pub fn tag(&mut self) -> &mut dyn TagRepository { - self - } - - pub fn transactions(&mut self) -> &mut dyn TransactionsRepository { - self - } - - pub fn wallets(&mut self) -> &mut dyn WalletsRepository { - self - } } diff --git a/core/crates/storage/src/models/config.rs b/core/crates/storage/src/models/config.rs index 7ec6566f5f..47c9629fa2 100644 --- a/core/crates/storage/src/models/config.rs +++ b/core/crates/storage/src/models/config.rs @@ -1,6 +1,5 @@ use diesel::prelude::*; use primitives::{ConfigKey, ConfigParamKey}; -use std::str::FromStr; #[derive(Debug, Clone, Queryable, Selectable, Insertable)] #[diesel(table_name = crate::schema::config)] @@ -27,8 +26,4 @@ impl ConfigRow { default_value: key.default_value().to_string(), } } - - pub fn key(&self) -> Option { - ConfigKey::from_str(&self.key).ok() - } } diff --git a/core/crates/storage/src/models/fiat.rs b/core/crates/storage/src/models/fiat.rs index 14073395c5..cfcf72d655 100644 --- a/core/crates/storage/src/models/fiat.rs +++ b/core/crates/storage/src/models/fiat.rs @@ -165,14 +165,6 @@ impl FiatProviderRow { payment_methods, } } - - pub fn is_buy_enabled(&self) -> bool { - self.enabled && self.buy_enabled - } - - pub fn is_sell_enabled(&self) -> bool { - self.enabled && self.sell_enabled - } } #[derive(Debug, Queryable, Selectable, Clone)] diff --git a/core/crates/storage/src/models/perpetual.rs b/core/crates/storage/src/models/perpetual.rs index b4688ee784..6349351a95 100644 --- a/core/crates/storage/src/models/perpetual.rs +++ b/core/crates/storage/src/models/perpetual.rs @@ -1,9 +1,6 @@ use chrono::NaiveDateTime; use diesel::prelude::*; -use primitives::{ - AssetId as PrimitiveAssetId, - perpetual::{Perpetual as PrimitivePerpetual, PerpetualBasic}, -}; +use primitives::perpetual::Perpetual as PrimitivePerpetual; use serde::{Deserialize, Serialize}; use crate::sql_types::{AssetId, PerpetualIdRow, PerpetualProviderRow}; @@ -53,15 +50,6 @@ pub struct NewPerpetualAssetRow { pub asset_id: AssetId, } -impl NewPerpetualAssetRow { - pub fn new(perpetual_id: String, asset_id: PrimitiveAssetId) -> Self { - Self { - perpetual_id, - asset_id: asset_id.into(), - } - } -} - impl NewPerpetualRow { pub fn from_primitive(perpetual: PrimitivePerpetual) -> Self { Self { @@ -98,12 +86,4 @@ impl PerpetualRow { is_isolated_only: self.is_isolated_only, } } - - pub fn as_basic(&self) -> PerpetualBasic { - PerpetualBasic { - asset_id: self.asset_id.0.clone(), - perpetual_id: self.id.0.clone(), - provider: self.provider.0.clone(), - } - } } diff --git a/core/crates/storage/src/models/username.rs b/core/crates/storage/src/models/username.rs index 8ba517b0f2..84e4d7da3e 100644 --- a/core/crates/storage/src/models/username.rs +++ b/core/crates/storage/src/models/username.rs @@ -16,10 +16,6 @@ impl UsernameRow { let len = self.username.len(); (4..=16).contains(&len) && self.username.chars().all(|c| c.is_ascii_alphanumeric()) } - - pub fn is_verified(&self) -> bool { - self.status.is_verified() - } } #[derive(Debug, Insertable, Clone)] diff --git a/core/crates/streamer/src/payload.rs b/core/crates/streamer/src/payload.rs index 77b517b2cd..59f0202345 100644 --- a/core/crates/streamer/src/payload.rs +++ b/core/crates/streamer/src/payload.rs @@ -167,12 +167,6 @@ pub struct FetchNFTCollectionPayload { pub collection_id: String, } -impl FetchNFTCollectionPayload { - pub fn new(chain: Chain, collection_id: String) -> Self { - Self { chain, collection_id } - } -} - impl fmt::Display for FetchNFTCollectionPayload { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "chain={}, collection_id={}", self.chain.as_ref(), self.collection_id) @@ -201,12 +195,6 @@ pub struct AssetsAddressPayload { pub values: Vec, } -impl AssetsAddressPayload { - pub fn new(values: Vec) -> Self { - Self { values } - } -} - impl fmt::Display for AssetsAddressPayload { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { for value in self.values.iter() { diff --git a/core/crates/streamer/src/stream_producer.rs b/core/crates/streamer/src/stream_producer.rs index 878a1cfdb8..348bb85aba 100644 --- a/core/crates/streamer/src/stream_producer.rs +++ b/core/crates/streamer/src/stream_producer.rs @@ -191,13 +191,6 @@ impl StreamProducer { .await } - pub async fn bind_exchange(&self, exchange: ExchangeName, queues: Vec) -> Result<(), Box> { - for queue in queues { - self.bind_queue(&queue.to_string(), &exchange.to_string(), "").await?; - } - Ok(()) - } - pub async fn bind_queue_routing_key(&self, queue: QueueName, routing_key: &str) -> Result<(), Box> { let exchange_name = format!("{}{}", queue, ROUTING_KEY_EXCHANGE_SUFFIX); let queue_name = format!("{}.{}", queue, routing_key); @@ -254,13 +247,6 @@ impl StreamProducer { Ok(true) } - pub async fn publish_to_exchange(&self, exchange: ExchangeName, message: &T) -> Result> - where - T: serde::Serialize, - { - self.publish_message(&exchange.to_string(), "", message).await - } - pub async fn publish_to_exchange_with_routing_key(&self, exchange: ExchangeName, routing_key: &str, message: &T) -> Result> where T: serde::Serialize, diff --git a/core/crates/streamer/src/stream_reader.rs b/core/crates/streamer/src/stream_reader.rs index 5029c4f8d4..99b4508be2 100644 --- a/core/crates/streamer/src/stream_reader.rs +++ b/core/crates/streamer/src/stream_reader.rs @@ -49,11 +49,6 @@ impl StreamReader { Self::configure_channel(connection.create_channel().await?, config.prefetch).await } - pub async fn close(self) -> Result<(), Box> { - self.channel.close(0, "Normal shutdown".into()).await?; - Ok(()) - } - async fn create_channel(connection: &StreamConnection, prefetch: u16) -> Result> { Self::configure_channel(connection.create_channel().await?, prefetch).await } diff --git a/core/crates/swapper/src/fees/referral.rs b/core/crates/swapper/src/fees/referral.rs index 85f0a7b082..158d35e1bf 100644 --- a/core/crates/swapper/src/fees/referral.rs +++ b/core/crates/swapper/src/fees/referral.rs @@ -22,10 +22,6 @@ pub struct ReferralFee { } impl ReferralFees { - pub fn evm(evm: ReferralFee) -> Self { - Self { evm, ..Default::default() } - } - pub fn for_chain(&self, chain: Chain) -> Option<&ReferralFee> { let fee = match chain.chain_type() { ChainType::Ethereum => &self.evm, diff --git a/core/crates/swapper/src/near_intents/provider.rs b/core/crates/swapper/src/near_intents/provider.rs index dd0d721d19..f41d8648d8 100644 --- a/core/crates/swapper/src/near_intents/provider.rs +++ b/core/crates/swapper/src/near_intents/provider.rs @@ -83,10 +83,6 @@ impl NearIntents { let sui_client = create_sui_client(rpc_provider.clone()).expect("failed to create Sui gRPC client"); Self::with_client(client, explorer, sui_client) } - - pub fn boxed(rpc_provider: Arc) -> Box { - Box::new(Self::new(rpc_provider)) - } } impl NearIntents diff --git a/core/crates/swapper/src/thorchain/mod.rs b/core/crates/swapper/src/thorchain/mod.rs index c945f1da2d..3849544e57 100644 --- a/core/crates/swapper/src/thorchain/mod.rs +++ b/core/crates/swapper/src/thorchain/mod.rs @@ -11,8 +11,6 @@ mod swap_mapper; pub use provider::ThorChain; -use chain::ChainName; -use primitives::Chain; use strum::Display; use super::SwapperProvider; @@ -54,8 +52,4 @@ impl THORChainNetwork { ], } } - - pub fn supported_chains(&self) -> Vec { - ChainName::supported(*self).iter().map(|name| name.chain()).collect() - } }