From 74280bc329cbf2ab531f4a12bee9caf606d92b85 Mon Sep 17 00:00:00 2001 From: Bryan Stitt Date: Thu, 8 Jun 2023 11:33:16 -0700 Subject: [PATCH] lint --- web3_proxy/src/frontend/users/authentication.rs | 2 +- web3_proxy/src/frontend/users/payment.rs | 2 +- web3_proxy/src/frontend/users/subuser.rs | 2 +- web3_proxy/src/stats/influxdb_queries.rs | 6 ++---- web3_proxy/src/stats/mod.rs | 9 ++++----- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/web3_proxy/src/frontend/users/authentication.rs b/web3_proxy/src/frontend/users/authentication.rs index e7ce6546..44cfde21 100644 --- a/web3_proxy/src/frontend/users/authentication.rs +++ b/web3_proxy/src/frontend/users/authentication.rs @@ -18,7 +18,7 @@ use entities::{balance, login, pending_login, referee, referrer, rpc_key, user}; use ethers::{prelude::Address, types::Bytes}; use hashbrown::HashMap; use http::StatusCode; -use log::{debug, warn}; +use log::{debug, warn, trace}; use migration::sea_orm::prelude::{Decimal, Uuid}; use migration::sea_orm::{ self, ActiveModelTrait, ColumnTrait, EntityTrait, IntoActiveModel, QueryFilter, diff --git a/web3_proxy/src/frontend/users/payment.rs b/web3_proxy/src/frontend/users/payment.rs index f717af1c..60bb7e2d 100644 --- a/web3_proxy/src/frontend/users/payment.rs +++ b/web3_proxy/src/frontend/users/payment.rs @@ -181,7 +181,7 @@ pub async fn user_balance_post( // .topics[0] // { // debug!("Bloom input bytes is: {:?}", x); - // debug!("Bloom input bytes is: {:?}", x..as_fixed_bytes()); + // debug!("Bloom input bytes is: {:?}", x.as_fixed_bytes()); // debug!("Bloom input as hex is: {:?}", hex!(x)); // let bloom_input = BloomInput::Raw(hex!(x)); // debug!( diff --git a/web3_proxy/src/frontend/users/subuser.rs b/web3_proxy/src/frontend/users/subuser.rs index 2137ede3..35352518 100644 --- a/web3_proxy/src/frontend/users/subuser.rs +++ b/web3_proxy/src/frontend/users/subuser.rs @@ -15,7 +15,7 @@ use entities::{balance, rpc_key, secondary_user, user}; use ethers::types::Address; use hashbrown::HashMap; use http::StatusCode; -use log::{trace, warn}; +use log::trace; use migration::sea_orm; use migration::sea_orm::ActiveModelTrait; use migration::sea_orm::ColumnTrait; diff --git a/web3_proxy/src/stats/influxdb_queries.rs b/web3_proxy/src/stats/influxdb_queries.rs index 7df6ccae..fe3d966b 100644 --- a/web3_proxy/src/stats/influxdb_queries.rs +++ b/web3_proxy/src/stats/influxdb_queries.rs @@ -20,10 +20,8 @@ use fstrings::{f, format_args_f}; use hashbrown::HashMap; use influxdb2::api::query::FluxRecord; use influxdb2::models::Query; -use log::{debug, error, info, trace, warn}; -use migration::sea_orm::ColumnTrait; -use migration::sea_orm::EntityTrait; -use migration::sea_orm::QueryFilter; +use log::{debug, error, trace, warn}; +use migration::sea_orm::{ColumnTrait, EntityTrait, QueryFilter}; use serde_json::json; use ulid::Ulid; diff --git a/web3_proxy/src/stats/mod.rs b/web3_proxy/src/stats/mod.rs index 7dd93b2a..6409aead 100644 --- a/web3_proxy/src/stats/mod.rs +++ b/web3_proxy/src/stats/mod.rs @@ -426,9 +426,9 @@ impl BufferedRpcQueryStats { } // Duplicate code, I should fix this later ... - let user_balance = (sender_balance.total_deposits + let user_balance = sender_balance.total_deposits - sender_balance.total_spent_outside_free_tier - + deltas.usage_bonus_to_request_sender_through_referral); + + deltas.usage_bonus_to_request_sender_through_referral; // Split up the component of into how much of the paid component was used, and how much of the free component was used (anything after "balance") if user_balance - self.sum_credits_used >= Decimal::from(0) { @@ -439,12 +439,11 @@ impl BufferedRpcQueryStats { deltas.balance_spent_excluding_free_credits = self.sum_credits_used; } - Ok((deltas, Some((referral_entity, referrer_code_entity)))) } else { - let user_balance = (sender_balance.total_deposits + let user_balance = sender_balance.total_deposits - sender_balance.total_spent_outside_free_tier - + deltas.usage_bonus_to_request_sender_through_referral); + + deltas.usage_bonus_to_request_sender_through_referral; // Split up the component of into how much of the paid component was used, and how much of the free component was used (anything after "balance") if user_balance - self.sum_credits_used >= Decimal::from(0) {