1
0
mirror of https://github.com/romanz/electrs.git synced 2024-11-19 01:43:29 +01:00

Use bitcoincore-rpc 0.14.0 release

Since it now uses `bitcoin` 0.27
This commit is contained in:
Roman Zeyde 2021-09-23 18:29:59 +03:00
parent 5ae3d6526e
commit 7c55c784c3
7 changed files with 36 additions and 36 deletions

50
Cargo.lock generated
View File

@ -100,6 +100,30 @@ dependencies = [
"serde",
]
[[package]]
name = "bitcoincore-rpc"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b8d99d58466295cb2bf72c6959b784d59f8f0d6977458d2ba3eb75c834f36c3"
dependencies = [
"bitcoincore-rpc-json",
"jsonrpc",
"log",
"serde",
"serde_json",
]
[[package]]
name = "bitcoincore-rpc-json"
version = "0.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dce91de73c61f5776cf938bfa88378c5b404a70e3369b761dacbe6024fea79dd"
dependencies = [
"bitcoin",
"serde",
"serde_json",
]
[[package]]
name = "bitflags"
version = "1.2.1"
@ -219,30 +243,6 @@ dependencies = [
"void",
]
[[package]]
name = "core-rpc"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "68fce2983316049bfa3d12a2a55ffe39a786f712c1f36a924bf1abc55db85c57"
dependencies = [
"core-rpc-json",
"jsonrpc",
"log",
"serde",
"serde_json",
]
[[package]]
name = "core-rpc-json"
version = "0.15.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ae96a4e39cd114fed258c9e303014d311312d6ab46565c97104bd9c151ed167d"
dependencies = [
"bitcoin",
"serde",
"serde_json",
]
[[package]]
name = "crossbeam-channel"
version = "0.5.1"
@ -320,9 +320,9 @@ version = "0.9.0-rc2"
dependencies = [
"anyhow",
"bitcoin",
"bitcoincore-rpc",
"configure_me",
"configure_me_codegen",
"core-rpc",
"crossbeam-channel",
"dirs-next",
"electrs-rocksdb",

View File

@ -22,6 +22,7 @@ spec = "internal/config_specification.toml"
[dependencies]
anyhow = "1.0"
bitcoin = { version = "0.27.1", features = ["use-serde", "rand"] }
bitcoincore-rpc = "0.14.0"
configure_me = "0.4"
crossbeam-channel = "0.5"
dirs-next = "2.0"
@ -36,9 +37,6 @@ serde_json = "1.0"
signal-hook = "0.3"
tiny_http = { version = "0.8", optional = true }
[dependencies.core-rpc]
version = "0.15.0" # Use bitcoincore-rpc fork for now
[dependencies.electrs-rocksdb]
# support building with Rust 1.41.1 and workaround the following issues:
# https://github.com/romanz/electrs/issues/403 (support building on ARM 32-bit)

View File

@ -1,5 +1,5 @@
use bitcoin::network::constants::Network;
use core_rpc::Auth;
use bitcoincore_rpc::Auth;
use dirs_next::home_dir;
use std::ffi::{OsStr, OsString};

View File

@ -3,7 +3,7 @@ use anyhow::{Context, Result};
use bitcoin::{
consensus::serialize, hashes::hex::ToHex, Amount, Block, BlockHash, Transaction, Txid,
};
use core_rpc::{json, jsonrpc, Auth, Client, RpcApi};
use bitcoincore_rpc::{json, jsonrpc, Auth, Client, RpcApi};
use parking_lot::Mutex;
use serde_json::{json, Value};
@ -224,10 +224,12 @@ impl Daemon {
}
}
pub(crate) type RpcError = core_rpc::jsonrpc::error::RpcError;
pub(crate) type RpcError = bitcoincore_rpc::jsonrpc::error::RpcError;
pub(crate) fn extract_bitcoind_error(err: &core_rpc::Error) -> Option<&RpcError> {
use core_rpc::{jsonrpc::error::Error::Rpc as ServerError, Error::JsonRpc as JsonRpcError};
pub(crate) fn extract_bitcoind_error(err: &bitcoincore_rpc::Error) -> Option<&RpcError> {
use bitcoincore_rpc::{
jsonrpc::error::Error::Rpc as ServerError, Error::JsonRpc as JsonRpcError,
};
match err {
JsonRpcError(ServerError(e)) => Some(e),
_ => None,

View File

@ -446,7 +446,7 @@ impl Rpc {
Err(err) => {
warn!("RPC {} failed: {:#}", method, err);
match err
.downcast_ref::<core_rpc::Error>()
.downcast_ref::<bitcoincore_rpc::Error>()
.and_then(extract_bitcoind_error)
{
Some(e) => error_msg(id, RpcError::DaemonError(e.clone())),

View File

@ -7,7 +7,7 @@ use std::ops::Bound;
use bitcoin::hashes::Hash;
use bitcoin::{Amount, OutPoint, Transaction, Txid};
use core_rpc::json;
use bitcoincore_rpc::json;
use rayon::prelude::*;
use serde::ser::{Serialize, SerializeSeq, Serializer};

View File

@ -1,6 +1,6 @@
use anyhow::{Context, Result};
use bitcoin::BlockHash;
use core_rpc::RpcApi;
use bitcoincore_rpc::RpcApi;
use crossbeam_channel::{bounded, select, unbounded, Receiver, Sender};
use rayon::prelude::*;