Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JsonRpsee for Zaino client #246

Merged
merged 8 commits into from
Mar 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ tonic-build = "0.12"
prost = "0.13"
serde = "1.0"
serde_json = "1.0"
jsonrpc-core = "18.0"
jsonrpsee-core = "0.24"
jsonrpsee-types = "0.24"

# Hashmaps, channels, DBs
Expand Down
2 changes: 1 addition & 1 deletion docs/internal_spec.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ The Zaino repo consists of several crates that collectively provide an indexing
- prost
- serde
- serde_json
- jsonrpc-core
- jsonrpsee-core
- jsonrpsee-types

**Hashmaps, channels, DBs:**
Expand Down
6 changes: 3 additions & 3 deletions integration-tests/tests/fetch_service.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use futures::StreamExt as _;
use zaino_fetch::jsonrpc::connector::{test_node_and_return_url, JsonRpcConnector};
use zaino_fetch::jsonrpsee::connector::{test_node_and_return_url, JsonRpSeeConnector};
use zaino_proto::proto::service::{
AddressList, BlockId, BlockRange, Exclude, GetAddressUtxosArg, GetSubtreeRootsArg,
TransparentAddressBlockFilter, TxFilter,
Expand Down Expand Up @@ -221,7 +221,7 @@ async fn fetch_service_get_raw_mempool(validator: &str) {
.as_ref()
.expect("Clients are not initialized");

let json_service = JsonRpcConnector::new_with_basic_auth(
let json_service = JsonRpSeeConnector::new_with_basic_auth(
test_node_and_return_url(
test_manager.zebrad_rpc_listen_address,
false,
Expand Down Expand Up @@ -586,7 +586,7 @@ async fn fetch_service_get_latest_block(validator: &str) {
test_manager.local_net.generate_blocks(1).await.unwrap();
tokio::time::sleep(tokio::time::Duration::from_secs(1)).await;

let json_service = JsonRpcConnector::new_with_basic_auth(
let json_service = JsonRpSeeConnector::new_with_basic_auth(
test_node_and_return_url(
test_manager.zebrad_rpc_listen_address,
false,
Expand Down
6 changes: 3 additions & 3 deletions integration-tests/tests/local_cache.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use core::panic;
use zaino_fetch::jsonrpc::connector::{test_node_and_return_url, JsonRpcConnector};
use zaino_fetch::jsonrpsee::connector::{test_node_and_return_url, JsonRpSeeConnector};
use zaino_state::{
config::BlockCacheConfig,
local_cache::{BlockCache, BlockCacheSubscriber},
Expand All @@ -18,7 +18,7 @@ async fn create_test_manager_and_block_cache(
enable_clients: bool,
) -> (
TestManager,
JsonRpcConnector,
JsonRpSeeConnector,
BlockCache,
BlockCacheSubscriber,
) {
Expand All @@ -34,7 +34,7 @@ async fn create_test_manager_and_block_cache(
.await
.unwrap();

let json_service = JsonRpcConnector::new_with_basic_auth(
let json_service = JsonRpSeeConnector::new_with_basic_auth(
test_node_and_return_url(
test_manager.zebrad_rpc_listen_address,
false,
Expand Down
56 changes: 29 additions & 27 deletions integration-tests/tests/wallet_to_validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use zingo_infra_testutils::services::validator::Validator;
use zingolib::testutils::lightclient::from_inputs;

mod wallet_basic {
use zaino_fetch::jsonrpc::connector::test_node_and_return_url;
use zaino_fetch::jsonrpsee::connector::test_node_and_return_url;

use super::*;

Expand Down Expand Up @@ -199,20 +199,21 @@ mod wallet_basic {
test_manager.local_net.generate_blocks(1).await.unwrap();
tokio::time::sleep(std::time::Duration::from_millis(500)).await;

let fetch_service = zaino_fetch::jsonrpc::connector::JsonRpcConnector::new_with_basic_auth(
test_node_and_return_url(
test_manager.zebrad_rpc_listen_address,
false,
None,
Some("xxxxxx".to_string()),
Some("xxxxxx".to_string()),
let fetch_service =
zaino_fetch::jsonrpsee::connector::JsonRpSeeConnector::new_with_basic_auth(
test_node_and_return_url(
test_manager.zebrad_rpc_listen_address,
false,
None,
Some("xxxxxx".to_string()),
Some("xxxxxx".to_string()),
)
.await
.unwrap(),
"xxxxxx".to_string(),
"xxxxxx".to_string(),
)
.await
.unwrap(),
"xxxxxx".to_string(),
"xxxxxx".to_string(),
)
.unwrap();
.unwrap();

println!("\n\nFetching Chain Height!\n");

Expand Down Expand Up @@ -543,20 +544,21 @@ mod wallet_basic {

// test_manager.local_net.print_stdout();

let fetch_service = zaino_fetch::jsonrpc::connector::JsonRpcConnector::new_with_basic_auth(
test_node_and_return_url(
test_manager.zebrad_rpc_listen_address,
false,
None,
Some("xxxxxx".to_string()),
Some("xxxxxx".to_string()),
let fetch_service =
zaino_fetch::jsonrpsee::connector::JsonRpSeeConnector::new_with_basic_auth(
test_node_and_return_url(
test_manager.zebrad_rpc_listen_address,
false,
None,
Some("xxxxxx".to_string()),
Some("xxxxxx".to_string()),
)
.await
.unwrap(),
"xxxxxx".to_string(),
"xxxxxx".to_string(),
)
.await
.unwrap(),
"xxxxxx".to_string(),
"xxxxxx".to_string(),
)
.unwrap();
.unwrap();

println!("\n\nFetching Raw Mempool!\n");

Expand Down
1 change: 0 additions & 1 deletion zaino-fetch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,3 @@ base64 = { workspace = true }
byteorder = { workspace = true }
sha2 = { workspace = true }
jsonrpsee-types = { workspace = true }

File renamed without changes.
Loading
Loading