From f38f5faeb646d4d7cee19d199645e5dc1c98561a Mon Sep 17 00:00:00 2001 From: Gustavo Inacio Date: Thu, 17 Oct 2024 15:24:24 +0200 Subject: [PATCH] chore: bump jsonrpsee Signed-off-by: Gustavo Inacio --- Cargo.toml | 4 ++-- tap_aggregator/Cargo.toml | 13 +++++++------ tap_aggregator/src/server.rs | 10 +++++----- tap_integration_tests/tests/indexer_mock.rs | 2 +- tap_integration_tests/tests/showcase.rs | 8 ++++---- 5 files changed, 19 insertions(+), 18 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e1482fbd..870a4c9f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ repository = "https://github.com/semiotic-ai/timeline-aggregation-protocol" alloy = { version = "0.4.2", features = ["full"] } serde = { version = "1.0.163", features = ["derive"] } rstest = "0.22.0" -anyhow = { version = "1.0.70", default-features = false } +anyhow = { version = "1.0.89" } tokio = { version = "1.40.0", features = ["macros", "signal"] } rand = "0.8.5" -jsonrpsee = { version = "0.18.0", features = ["macros", "server"] } +jsonrpsee = { version = "0.24.7", features = ["macros", "server"] } diff --git a/tap_aggregator/Cargo.toml b/tap_aggregator/Cargo.toml index b71de945..c9af2de2 100644 --- a/tap_aggregator/Cargo.toml +++ b/tap_aggregator/Cargo.toml @@ -25,16 +25,17 @@ tracing-subscriber = "0.3.17" log = "0.4.19" prometheus = "0.13.3" axum = { version = "0.7.5", features = [ - "http1", - "json", - "matched-path", - "original-uri", - "query", - "tokio", + "http1", + "json", + "matched-path", + "original-uri", + "query", + "tokio", ], default-features = false } futures-util = "0.3.28" lazy_static = "1.4.0" ruint = "1.10.1" +tower = { version = "0.4", features = ["util"] } [dev-dependencies] jsonrpsee = { workspace = true, features = ["http-client", "jsonrpsee-core"] } diff --git a/tap_aggregator/src/server.rs b/tap_aggregator/src/server.rs index 7565c630..0ff03d3b 100644 --- a/tap_aggregator/src/server.rs +++ b/tap_aggregator/src/server.rs @@ -233,7 +233,7 @@ pub async fn run_server( accepted_addresses, domain_separator, }; - let handle = server.start(rpc_impl.into_rpc())?; + let handle = server.start(rpc_impl.into_rpc()); Ok((handle, addr)) } @@ -547,7 +547,7 @@ mod tests { // Create RAV through the JSON-RPC server. let res: Result< server::JsonRpcResponse>, - jsonrpsee::core::Error, + jsonrpsee::core::ClientError, > = client .request( "aggregate_receipts", @@ -566,7 +566,7 @@ mod tests { // Check the API versions returned by the server match res.expect_err("Expected an error") { - jsonrpsee::core::Error::Call(err) => { + jsonrpsee::core::ClientError::Call(err) => { let versions: server::TapRpcApiVersionsInfo = serde_json::from_str(err.data().unwrap().get()).unwrap(); assert!(versions @@ -645,7 +645,7 @@ mod tests { // Test with a number of receipts that stays within request size limit let res: Result< server::JsonRpcResponse>, - jsonrpsee::core::Error, + jsonrpsee::core::ClientError, > = client .request( "aggregate_receipts", @@ -662,7 +662,7 @@ mod tests { // Test with all receipts to exceed request size limit let res: Result< server::JsonRpcResponse>, - jsonrpsee::core::Error, + jsonrpsee::core::ClientError, > = client .request( "aggregate_receipts", diff --git a/tap_integration_tests/tests/indexer_mock.rs b/tap_integration_tests/tests/indexer_mock.rs index 433e38a2..3687e9a5 100644 --- a/tap_integration_tests/tests/indexer_mock.rs +++ b/tap_integration_tests/tests/indexer_mock.rs @@ -167,7 +167,7 @@ where aggregate_server_api_version, )?; - let handle = server.start(rpc_manager.into_rpc())?; + let handle = server.start(rpc_manager.into_rpc()); Ok((handle, addr)) } diff --git a/tap_integration_tests/tests/showcase.rs b/tap_integration_tests/tests/showcase.rs index 444e5d5d..19210b34 100644 --- a/tap_integration_tests/tests/showcase.rs +++ b/tap_integration_tests/tests/showcase.rs @@ -572,7 +572,7 @@ async fn test_manager_wrong_aggregator_keys( let mut counter = 1; for receipt_1 in requests_1 { - let result: Result<(), jsonrpsee::core::Error> = + let result: Result<(), jsonrpsee::core::ClientError> = client_1.request("request", (receipt_1,)).await; // The rav request is being made with messages that have been signed with a key that differs from the sender aggregator's. // So the Sender Aggregator should send an error to the requesting Indexer. @@ -612,7 +612,7 @@ async fn test_manager_wrong_requestor_keys( let client_1 = HttpClientBuilder::default().build(indexer_1_address)?; for receipt_1 in wrong_requests { - let result: Result<(), jsonrpsee::core::Error> = + let result: Result<(), jsonrpsee::core::ClientError> = client_1.request("request", (receipt_1,)).await; // The receipts have been signed with a key that the Indexer is not expecting. // This is one of the initial tests, so it should fail to receive the receipt @@ -657,7 +657,7 @@ async fn test_tap_manager_rav_timestamp_cuttoff( let mut counter = 1; for receipt_1 in repeated_timestamp_request { - let result: Result<(), jsonrpsee::core::Error> = + let result: Result<(), jsonrpsee::core::ClientError> = client_1.request("request", (receipt_1,)).await; // The first receipt in the second batch has the same timestamp as the last receipt in the first batch. @@ -732,7 +732,7 @@ async fn test_tap_aggregator_rav_timestamp_cuttoff( ); let second_rav_response: Result< jsonrpsee_helpers::JsonRpcResponse, - jsonrpsee::core::Error, + jsonrpsee::core::ClientError, > = client.request("aggregate_receipts", params).await; assert!( second_rav_response.is_err(),