From d5cb53a5ba52496be287a2ffa134db091cb8a182 Mon Sep 17 00:00:00 2001 From: taslimmuhammed Date: Wed, 30 Oct 2024 16:44:17 +0530 Subject: [PATCH] dropped eventuals --- Cargo.lock | 68 ++----------------- tap-agent/Cargo.toml | 2 +- .../src/agent/sender_accounts_manager.rs | 2 +- tap-agent/src/agent/sender_allocation.rs | 30 ++++---- 4 files changed, 21 insertions(+), 81 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7bbfa977..a363f3db 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3428,7 +3428,7 @@ checksum = "1822d18e4384a5e79d94dc9e4d1239cfa9fad24e55b44d2efeff5b394c9fece4" dependencies = [ "jsonrpsee-core 0.18.2", "jsonrpsee-proc-macros", - "jsonrpsee-server 0.18.2", + "jsonrpsee-server", "jsonrpsee-types 0.18.2", "tracing", ] @@ -3441,9 +3441,7 @@ checksum = "c5c71d8c1a731cc4227c2f698d377e7848ca12c8a48866fc5e6951c43a4db843" dependencies = [ "jsonrpsee-core 0.24.7", "jsonrpsee-http-client", - "jsonrpsee-server 0.24.7", "jsonrpsee-types 0.24.7", - "tokio", "tracing", ] @@ -3462,10 +3460,10 @@ dependencies = [ "jsonrpsee-types 0.18.2", "parking_lot", "rand 0.8.5", - "rustc-hash 1.1.0", + "rustc-hash", "serde", "serde_json", - "soketto 0.7.1", + "soketto", "thiserror", "tokio", "tracing", @@ -3484,9 +3482,6 @@ dependencies = [ "http-body 1.0.1", "http-body-util", "jsonrpsee-types 0.24.7", - "parking_lot", - "rand 0.8.5", - "rustc-hash 2.0.0", "serde", "serde_json", "thiserror", @@ -3544,34 +3539,7 @@ dependencies = [ "jsonrpsee-types 0.18.2", "serde", "serde_json", - "soketto 0.7.1", - "tokio", - "tokio-stream", - "tokio-util", - "tower 0.4.13", - "tracing", -] - -[[package]] -name = "jsonrpsee-server" -version = "0.24.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82ad8ddc14be1d4290cd68046e7d1d37acd408efed6d3ca08aefcc3ad6da069c" -dependencies = [ - "futures-util", - "http 1.1.0", - "http-body 1.0.1", - "http-body-util", - "hyper 1.5.0", - "hyper-util", - "jsonrpsee-core 0.24.7", - "jsonrpsee-types 0.24.7", - "pin-project", - "route-recognizer", - "serde", - "serde_json", - "soketto 0.8.0", - "thiserror", + "soketto", "tokio", "tokio-stream", "tokio-util", @@ -5031,12 +4999,6 @@ dependencies = [ "rustc-hex", ] -[[package]] -name = "route-recognizer" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afab94fb28594581f62d981211a9a4d53cc8130bbcbbb89a0440d9b8e81a7746" - [[package]] name = "rsa" version = "0.9.6" @@ -5141,12 +5103,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" -[[package]] -name = "rustc-hash" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" - [[package]] name = "rustc-hex" version = "2.1.0" @@ -5755,22 +5711,6 @@ dependencies = [ "sha-1", ] -[[package]] -name = "soketto" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37468c595637c10857701c990f93a40ce0e357cedb0953d1c26c8d8027f9bb53" -dependencies = [ - "base64 0.22.1", - "bytes", - "futures", - "http 1.1.0", - "httparse", - "log", - "rand 0.8.5", - "sha1", -] - [[package]] name = "spez" version = "0.1.2" diff --git a/tap-agent/Cargo.toml b/tap-agent/Cargo.toml index f33e9162..4fa99a42 100644 --- a/tap-agent/Cargo.toml +++ b/tap-agent/Cargo.toml @@ -35,7 +35,7 @@ ruint = { version = "1.12.3", features = [ "num-traits", ], default-features = false } futures-util = { version = "0.3.28", default-features = false } -jsonrpsee = { version = "0.24.0", features = ["http-client", "tracing", "server"] } +jsonrpsee = { version = "0.24.0", features = ["http-client", "tracing"] } tap_aggregator = { git = "https://github.com/semiotic-ai/timeline-aggregation-protocol", rev = "eb8447e" } ractor = { version = "0.13", features = [ "async-trait", diff --git a/tap-agent/src/agent/sender_accounts_manager.rs b/tap-agent/src/agent/sender_accounts_manager.rs index 9bad7b7d..debbb3a5 100644 --- a/tap-agent/src/agent/sender_accounts_manager.rs +++ b/tap-agent/src/agent/sender_accounts_manager.rs @@ -14,13 +14,13 @@ use anyhow::{anyhow, bail}; use futures::{stream, StreamExt}; use indexer_common::escrow_accounts::EscrowAccounts; use indexer_common::prelude::{Allocation, SubgraphClient}; -use ractor::concurrency::JoinHandle; use ractor::{Actor, ActorCell, ActorProcessingErr, ActorRef, SupervisionEvent}; use reqwest::Url; use serde::Deserialize; use sqlx::{postgres::PgListener, PgPool}; use tokio::select; use tokio::sync::watch::{self, Receiver}; +use tokio::task::JoinHandle; use tracing::{error, warn}; use prometheus::{register_counter_vec, CounterVec}; diff --git a/tap-agent/src/agent/sender_allocation.rs b/tap-agent/src/agent/sender_allocation.rs index 4dde9b4d..f14423bd 100644 --- a/tap-agent/src/agent/sender_allocation.rs +++ b/tap-agent/src/agent/sender_allocation.rs @@ -1042,7 +1042,7 @@ pub mod tests { .unwrap(); let handle = Mutex::new(handle); - + let aggregator_endpoint = "http://".to_owned() + &aggregator_endpoint.to_string(); // Start mock GraphQL server let mock_server = MockServer::start().await; @@ -1058,7 +1058,7 @@ pub mod tests { ) .await; - (handle, aggregator_endpoint.to_string(), mock_server) + (handle, aggregator_endpoint, mock_server) } #[sqlx::test(migrations = "../migrations")] async fn should_update_unaggregated_fees_on_start(pgpool: PgPool) { @@ -1076,7 +1076,7 @@ pub mod tests { // Create a sender_allocation. let sender_allocation = create_sender_allocation( pgpool.clone(), - "http://".to_owned() + &aggregator_endpoint.to_string(), + aggregator_endpoint, &mock_server.uri(), Some(sender_account), ) @@ -1124,7 +1124,7 @@ pub mod tests { // Create a sender_allocation. let sender_allocation = create_sender_allocation( pgpool.clone(), - "http://".to_owned() + &aggregator_endpoint.to_string(), + aggregator_endpoint, &mock_server.uri(), Some(sender_account), ) @@ -1173,7 +1173,7 @@ pub mod tests { // Create a sender_allocation. let sender_allocation = create_sender_allocation( pgpool.clone(), - "http://".to_owned() + &aggregator_endpoint.to_string(), + aggregator_endpoint, &mock_server.uri(), Some(sender_account), ) @@ -1257,7 +1257,7 @@ pub mod tests { // Create a sender_allocation. let sender_allocation = create_sender_allocation( pgpool.clone(), - "http://".to_owned() + &aggregator_endpoint.to_string(), + aggregator_endpoint, &mock_server.uri(), Some(sender_account), ) @@ -1322,7 +1322,7 @@ pub mod tests { // create allocation let sender_allocation = create_sender_allocation( pgpool.clone(), - "http://".to_owned() + &aggregator_endpoint.to_string(), + aggregator_endpoint, &mock_server.uri(), Some(sender_account), ) @@ -1445,7 +1445,7 @@ pub mod tests { // create allocation let args = create_sender_allocation_args( pgpool.clone(), - "http://".to_owned() + &aggregator_endpoint.to_string(), + aggregator_endpoint, &mock_server.uri(), None, ) @@ -1476,7 +1476,7 @@ pub mod tests { // create allocation let args = create_sender_allocation_args( pgpool.clone(), - "http://".to_owned() + &aggregator_endpoint.to_string(), + aggregator_endpoint, &mock_server.uri(), None, ) @@ -1514,7 +1514,7 @@ pub mod tests { // create allocation let args = create_sender_allocation_args( pgpool.clone(), - "http://".to_owned() + &aggregator_endpoint.to_string(), + aggregator_endpoint, &mock_server.uri(), None, ) @@ -1550,7 +1550,7 @@ pub mod tests { // create allocation let args = create_sender_allocation_args( pgpool.clone(), - "http://".to_owned() + &aggregator_endpoint.to_string(), + aggregator_endpoint, &mock_server.uri(), None, ) @@ -1590,7 +1590,7 @@ pub mod tests { // create allocation let args = create_sender_allocation_args( pgpool.clone(), - "http://".to_owned() + &aggregator_endpoint.to_string(), + aggregator_endpoint, &mock_server.uri(), None, ) @@ -1637,7 +1637,7 @@ pub mod tests { // create allocation let args = create_sender_allocation_args( pgpool.clone(), - "http://".to_owned() + &aggregator_endpoint.to_string(), + aggregator_endpoint, &mock_server.uri(), None, ) @@ -1673,7 +1673,7 @@ pub mod tests { // create allocation let sender_allocation = create_sender_allocation( pgpool.clone(), - "http://".to_owned() + &aggregator_endpoint.to_string(), + aggregator_endpoint, &mock_server.uri(), Some(sender_account), ) @@ -1752,7 +1752,7 @@ pub mod tests { // create allocation let sender_allocation = create_sender_allocation( pgpool.clone(), - "http://".to_owned() + &aggregator_endpoint.to_string(), + aggregator_endpoint, &mock_server.uri(), Some(sender_account), )