Skip to content

Commit

Permalink
pow-migration: Switch back to upstream nimiq_rpc
Browse files Browse the repository at this point in the history
- Switch back to upstream `nimiq_rpc` now that the upstream
  repository supports the required RPC methods.
- Update `jsonrpsee` dependency from version 0.20.3 to 0.22.1.
- Remove `jsonrpsee` as a direct dependency from the `pow-migration`
  subcrate.
  • Loading branch information
jsdanielh committed Feb 28, 2024
1 parent 454c1c3 commit 89a8b67
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 22 deletions.
28 changes: 14 additions & 14 deletions Cargo.lock

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

3 changes: 1 addition & 2 deletions pow-migration/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ convert_case = "0.6"
hex = "0.4"
humantime = "2.1"
indicatif = "0.17"
jsonrpsee = { version = "0.20", features = ["client-core"] }
log = { package = "tracing", version = "0.1", features = ["log"] }
nimiq-blockchain = { workspace = true }
nimiq-bls = { workspace = true }
Expand All @@ -52,7 +51,7 @@ nimiq-primitives = { workspace = true, features = ["policy"]}
nimiq-serde = { workspace = true }
nimiq-transaction = { workspace = true }
nimiq-vrf = { workspace = true }
nimiq_rpc = { git = "https://github.com/jsdanielh/rust-client.git" }
nimiq_rpc = "0.3"
percentage = "0.1"
rand = "0.8"
serde = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion pow-migration/src/genesis/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::state::types::GenesisValidator;
pub enum Error {
/// RPC error
#[error("RPC error: {0}")]
Rpc(#[from] jsonrpsee::core::Error),
Rpc(#[from] nimiq_rpc::jsonrpsee::core::ClientError),
/// Unknown PoW block
#[error("Unknown PoW block")]
UnknownBlock,
Expand Down
6 changes: 3 additions & 3 deletions pow-migration/src/history/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use nimiq_primitives::{
};
use nimiq_rpc::{
primitives::{
TransactionDetails as PoWTransaction, TransactionSequence as PoWTransactionSequence,
TransactionDetails2 as PoWTransaction, TransactionSequence as PoWTransactionSequence,
},
Client,
};
Expand All @@ -29,7 +29,7 @@ use thiserror::Error;
pub enum Error {
/// RPC error
#[error("RPC error: {0}")]
Rpc(#[from] jsonrpsee::core::Error),
Rpc(#[from] nimiq_rpc::jsonrpsee::core::ClientError),
/// Unknown PoW block
#[error("Unknown PoW block")]
UnknownBlock,
Expand Down Expand Up @@ -159,7 +159,7 @@ pub async fn get_history_root(
}
for hash in hashes {
log::trace!(hash, "Processing transaction");
let pow_transaction = client.get_transaction_by_hash(&hash).await?;
let pow_transaction = client.get_transaction_by_hash_2(&hash).await?;
let pos_transaction = from_pow_transaction(&pow_transaction)?;
network_id = pos_transaction.network_id;

Expand Down
2 changes: 1 addition & 1 deletion pow-migration/src/monitor/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ pub enum ValidatorsReadiness {
pub enum Error {
/// RPC error
#[error("RPC error: {0}")]
Rpc(#[from] jsonrpsee::core::Error),
Rpc(#[from] nimiq_rpc::jsonrpsee::core::ClientError),
}
2 changes: 1 addition & 1 deletion pow-migration/src/state/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use thiserror::Error;
pub enum Error {
/// RPC error
#[error("RPC error: {0}")]
Rpc(#[from] jsonrpsee::core::Error),
Rpc(#[from] nimiq_rpc::jsonrpsee::core::ClientError),
/// Address parsing error
#[error("Failed to parse Nimiq address: {0}")]
Address(#[from] AddressParseError),
Expand Down

0 comments on commit 89a8b67

Please sign in to comment.