diff --git a/.gitignore b/.gitignore
index 01259d892..44cdbf52d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,6 +3,7 @@
.grin*
node*
!node_clients
+!node_clients.rs
target
Cargo.lock
*.iml
diff --git a/Cargo.lock b/Cargo.lock
index 5c13bdd0a..c85e4cffc 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -751,7 +751,6 @@ dependencies = [
"grin_keychain 0.4.2",
"grin_store 0.4.2",
"grin_util 0.4.2",
- "grin_wallet 0.4.2",
"lmdb-zero 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"lru-cache 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -854,7 +853,6 @@ dependencies = [
"grin_keychain 0.4.2",
"grin_store 0.4.2",
"grin_util 0.4.2",
- "grin_wallet 0.4.2",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.80 (registry+https://github.com/rust-lang/crates.io-index)",
diff --git a/Cargo.toml b/Cargo.toml
index ad5625825..0b4fe7d9a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -9,6 +9,7 @@ keywords = [ "crypto", "grin", "mimblewimble" ]
readme = "README.md"
exclude = ["**/*.grin", "**/*.grin2"]
build = "src/build/build.rs"
+edition = "2018"
[workspace]
members = ["api", "chain", "config", "core", "keychain", "p2p", "servers", "store", "util", "pool", "wallet"]
diff --git a/api/Cargo.toml b/api/Cargo.toml
index 16a12ae99..61a691024 100644
--- a/api/Cargo.toml
+++ b/api/Cargo.toml
@@ -7,6 +7,7 @@ license = "Apache-2.0"
repository = "https://github.com/mimblewimble/grin"
keywords = [ "crypto", "grin", "mimblewimble" ]
workspace = ".."
+edition = "2018"
[dependencies]
failure = "0.1.1"
diff --git a/api/src/auth.rs b/api/src/auth.rs
index 84a48248e..5b2b2f8da 100644
--- a/api/src/auth.rs
+++ b/api/src/auth.rs
@@ -12,11 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
+use crate::router::{Handler, HandlerObj, ResponseFuture};
use futures::future::ok;
use hyper::header::{HeaderValue, AUTHORIZATION, WWW_AUTHENTICATE};
use hyper::{Body, Request, Response, StatusCode};
use ring::constant_time::verify_slices_are_equal;
-use router::{Handler, HandlerObj, ResponseFuture};
// Basic Authentication Middleware
pub struct BasicAuthMiddleware {
@@ -37,12 +37,14 @@ impl Handler for BasicAuthMiddleware {
fn call(
&self,
req: Request
,
- mut handlers: Box>,
+ mut handlers: Box>,
) -> ResponseFuture {
- if req.headers().contains_key(AUTHORIZATION) && verify_slices_are_equal(
- req.headers()[AUTHORIZATION].as_bytes(),
- &self.api_basic_auth.as_bytes(),
- ).is_ok()
+ if req.headers().contains_key(AUTHORIZATION)
+ && verify_slices_are_equal(
+ req.headers()[AUTHORIZATION].as_bytes(),
+ &self.api_basic_auth.as_bytes(),
+ )
+ .is_ok()
{
handlers.next().unwrap().call(req, handlers)
} else {
@@ -58,7 +60,8 @@ fn unauthorized_response(basic_realm: &str) -> ResponseFuture {
.header(
WWW_AUTHENTICATE,
HeaderValue::from_str(basic_realm).unwrap(),
- ).body(Body::empty())
+ )
+ .body(Body::empty())
.unwrap();
Box::new(ok(response))
}
diff --git a/api/src/client.rs b/api/src/client.rs
index b6bac3b33..bc176924c 100644
--- a/api/src/client.rs
+++ b/api/src/client.rs
@@ -14,22 +14,20 @@
//! High level JSON/HTTP client API
+use crate::rest::{Error, ErrorKind};
+use crate::util::to_base64;
use failure::{Fail, ResultExt};
+use futures::future::{err, ok, Either};
use http::uri::{InvalidUri, Uri};
use hyper::header::{ACCEPT, AUTHORIZATION, USER_AGENT};
use hyper::rt::{Future, Stream};
use hyper::{Body, Client, Request};
+use hyper_rustls;
use serde::{Deserialize, Serialize};
use serde_json;
-
-use futures::future::{err, ok, Either};
-use hyper_rustls;
use tokio::runtime::Runtime;
-use rest::{Error, ErrorKind};
-use util::to_base64;
-
-pub type ClientResponseFuture = Box + Send>;
+pub type ClientResponseFuture = Box + Send>;
/// Helper function to easily issue a HTTP GET request against a given URL that
/// returns a JSON object. Handles request building, JSON deserialization and
@@ -143,7 +141,8 @@ fn build_request<'a>(
.body(match body {
None => Body::empty(),
Some(json) => json.into(),
- }).map_err(|e| {
+ })
+ .map_err(|e| {
ErrorKind::RequestError(format!("Bad request {} {}: {}", method, url, e)).into()
})
}
@@ -185,7 +184,7 @@ where
}))
}
-fn send_request_async(req: Request) -> Box + Send> {
+fn send_request_async(req: Request) -> Box + Send> {
let https = hyper_rustls::HttpsConnector::new(1);
let client = Client::builder().build::<_, Body>(https);
Box::new(
@@ -196,14 +195,16 @@ fn send_request_async(req: Request) -> Box
diff --git a/api/src/handlers/chain_api.rs b/api/src/handlers/chain_api.rs
index 17560cc47..150de6821 100644
--- a/api/src/handlers/chain_api.rs
+++ b/api/src/handlers/chain_api.rs
@@ -13,18 +13,18 @@
// limitations under the License.
use super::utils::{get_output, w};
-use chain;
-use core::core::hash::Hashed;
+use crate::chain;
+use crate::core::core::hash::Hashed;
+use crate::rest::*;
+use crate::router::{Handler, ResponseFuture};
+use crate::types::*;
+use crate::util;
+use crate::util::secp::pedersen::Commitment;
+use crate::web::*;
use hyper::{Body, Request, StatusCode};
-use rest::*;
-use router::{Handler, ResponseFuture};
use std::collections::HashMap;
use std::sync::Weak;
-use types::*;
use url::form_urlencoded;
-use util;
-use util::secp::pedersen::Commitment;
-use web::*;
/// Chain handler. Get the head details.
/// GET /v1/chain
diff --git a/api/src/handlers/peers_api.rs b/api/src/handlers/peers_api.rs
index 5ca27fb8c..c700b54b1 100644
--- a/api/src/handlers/peers_api.rs
+++ b/api/src/handlers/peers_api.rs
@@ -13,12 +13,12 @@
// limitations under the License.
use super::utils::w;
+use crate::p2p;
+use crate::p2p::types::{PeerInfoDisplay, ReasonForBan};
+use crate::router::{Handler, ResponseFuture};
+use crate::web::*;
use hyper::{Body, Request, StatusCode};
-use p2p;
-use p2p::types::{PeerInfoDisplay, ReasonForBan};
-use router::{Handler, ResponseFuture};
use std::sync::Weak;
-use web::*;
pub struct PeersAllHandler {
pub peers: Weak,
diff --git a/api/src/handlers/pool_api.rs b/api/src/handlers/pool_api.rs
index 2628323ee..f96d3685e 100644
--- a/api/src/handlers/pool_api.rs
+++ b/api/src/handlers/pool_api.rs
@@ -13,22 +13,22 @@
// limitations under the License.
use super::utils::w;
-use core::core::hash::Hashed;
-use core::core::Transaction;
-use core::ser;
+use crate::core::core::hash::Hashed;
+use crate::core::core::Transaction;
+use crate::core::ser;
+use crate::pool;
+use crate::rest::*;
+use crate::router::{Handler, ResponseFuture};
+use crate::types::*;
+use crate::util;
+use crate::util::RwLock;
+use crate::web::*;
use futures::future::ok;
use futures::Future;
use hyper::{Body, Request, StatusCode};
-use pool;
-use rest::*;
-use router::{Handler, ResponseFuture};
use std::collections::HashMap;
use std::sync::Weak;
-use types::*;
use url::form_urlencoded;
-use util;
-use util::RwLock;
-use web::*;
/// Get basic information about the transaction pool.
/// GET /v1/pool
@@ -60,7 +60,7 @@ pub struct PoolPushHandler {
}
impl PoolPushHandler {
- fn update_pool(&self, req: Request) -> Box + Send> {
+ fn update_pool(&self, req: Request) -> Box + Send> {
let params = match req.uri().query() {
Some(query_string) => form_urlencoded::parse(query_string.as_bytes())
.into_owned()
diff --git a/api/src/handlers/server_api.rs b/api/src/handlers/server_api.rs
index e7fc5cd6f..42a829a65 100644
--- a/api/src/handlers/server_api.rs
+++ b/api/src/handlers/server_api.rs
@@ -13,14 +13,14 @@
// limitations under the License.
use super::utils::w;
-use chain;
+use crate::chain;
+use crate::p2p;
+use crate::rest::*;
+use crate::router::{Handler, ResponseFuture};
+use crate::types::*;
+use crate::web::*;
use hyper::{Body, Request};
-use p2p;
-use rest::*;
-use router::{Handler, ResponseFuture};
use std::sync::Weak;
-use types::*;
-use web::*;
// RESTful index of available api endpoints
// GET /v1/
diff --git a/api/src/handlers/transactions_api.rs b/api/src/handlers/transactions_api.rs
index bbd01a483..6dc879855 100644
--- a/api/src/handlers/transactions_api.rs
+++ b/api/src/handlers/transactions_api.rs
@@ -13,18 +13,18 @@
// limitations under the License.
use super::utils::w;
-use chain;
+use crate::chain;
+use crate::rest::*;
+use crate::router::{Handler, ResponseFuture};
+use crate::types::*;
+use crate::util;
+use crate::util::secp::pedersen::Commitment;
+use crate::web::*;
use failure::ResultExt;
use hyper::{Body, Request, StatusCode};
-use rest::*;
-use router::{Handler, ResponseFuture};
use std::collections::HashMap;
use std::sync::Weak;
-use types::*;
use url::form_urlencoded;
-use util;
-use util::secp::pedersen::Commitment;
-use web::*;
// Sum tree handler. Retrieve the roots:
// GET /v1/txhashset/roots
diff --git a/api/src/handlers/utils.rs b/api/src/handlers/utils.rs
index 41e864bbf..2e2bc01e3 100644
--- a/api/src/handlers/utils.rs
+++ b/api/src/handlers/utils.rs
@@ -12,14 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-use chain;
-use core::core::{OutputFeatures, OutputIdentifier};
+use crate::chain;
+use crate::core::core::{OutputFeatures, OutputIdentifier};
+use crate::rest::*;
+use crate::types::*;
+use crate::util;
+use crate::util::secp::pedersen::Commitment;
use failure::ResultExt;
-use rest::*;
use std::sync::{Arc, Weak};
-use types::*;
-use util;
-use util::secp::pedersen::Commitment;
// All handlers use `Weak` references instead of `Arc` to avoid cycles that
// can never be destroyed. These 2 functions are simple helpers to reduce the
diff --git a/api/src/lib.rs b/api/src/lib.rs
index cde0399ef..72816796b 100644
--- a/api/src/lib.rs
+++ b/api/src/lib.rs
@@ -12,36 +12,31 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-extern crate grin_chain as chain;
-extern crate grin_core as core;
-extern crate grin_p2p as p2p;
-extern crate grin_pool as pool;
-extern crate grin_store as store;
-extern crate grin_util as util;
-extern crate url;
+use grin_chain as chain;
+use grin_core as core;
+use grin_p2p as p2p;
+use grin_pool as pool;
-extern crate failure;
+use grin_util as util;
+
+use failure;
#[macro_use]
extern crate failure_derive;
-extern crate hyper;
+use hyper;
#[macro_use]
extern crate lazy_static;
-extern crate regex;
-extern crate ring;
-extern crate serde;
+
+use serde;
#[macro_use]
extern crate serde_derive;
-extern crate serde_json;
+use serde_json;
#[macro_use]
extern crate log;
-extern crate futures;
-extern crate http;
-extern crate hyper_rustls;
-extern crate rustls;
-extern crate tokio;
-extern crate tokio_core;
-extern crate tokio_rustls;
-extern crate tokio_tcp;
+
+use hyper_rustls;
+use rustls;
+
+use tokio_tcp;
pub mod auth;
pub mod client;
@@ -51,9 +46,9 @@ mod router;
mod types;
mod web;
-pub use auth::BasicAuthMiddleware;
-pub use handlers::start_rest_apis;
-pub use rest::*;
-pub use router::*;
-pub use types::*;
-pub use web::*;
+pub use crate::auth::BasicAuthMiddleware;
+pub use crate::handlers::start_rest_apis;
+pub use crate::rest::*;
+pub use crate::router::*;
+pub use crate::types::*;
+pub use crate::web::*;
diff --git a/api/src/rest.rs b/api/src/rest.rs
index 0badb975d..fa26ef64a 100644
--- a/api/src/rest.rs
+++ b/api/src/rest.rs
@@ -18,12 +18,12 @@
//! To use it, just have your service(s) implement the ApiEndpoint trait and
//! register them on a ApiServer.
+use crate::router::{Handler, HandlerObj, ResponseFuture, Router};
use failure::{Backtrace, Context, Fail, ResultExt};
use futures::sync::oneshot;
use futures::Stream;
use hyper::rt::Future;
use hyper::{rt, Body, Request, Server};
-use router::{Handler, HandlerObj, ResponseFuture, Router};
use rustls;
use rustls::internal::pemfile;
use std::fmt::{self, Display};
@@ -55,7 +55,7 @@ pub enum ErrorKind {
}
impl Fail for Error {
- fn cause(&self) -> Option<&Fail> {
+ fn cause(&self) -> Option<&dyn Fail> {
self.inner.cause()
}
@@ -65,7 +65,7 @@ impl Fail for Error {
}
impl Display for Error {
- fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Display::fmt(&self.inner, f)
}
}
@@ -196,7 +196,8 @@ impl ApiServer {
.map_err(|e| eprintln!("HTTP API server error: {}", e));
rt::run(server);
- }).map_err(|_| ErrorKind::Internal("failed to spawn API thread".to_string()).into())
+ })
+ .map_err(|_| ErrorKind::Internal("failed to spawn API thread".to_string()).into())
}
/// Starts the TLS ApiServer at the provided address.
@@ -228,13 +229,15 @@ impl ApiServer {
error!("accept_async failed: {}", e);
Ok(None)
}
- }).filter_map(|x| x);
+ })
+ .filter_map(|x| x);
let server = Server::builder(tls)
.serve(router)
.map_err(|e| eprintln!("HTTP API server error: {}", e));
rt::run(server);
- }).map_err(|_| ErrorKind::Internal("failed to spawn API thread".to_string()).into())
+ })
+ .map_err(|_| ErrorKind::Internal("failed to spawn API thread".to_string()).into())
}
/// Stops the API server, it panics in case of error
@@ -258,7 +261,7 @@ impl Handler for LoggingMiddleware {
fn call(
&self,
req: Request,
- mut handlers: Box>,
+ mut handlers: Box>,
) -> ResponseFuture {
debug!("REST call: {} {}", req.method(), req.uri().path());
handlers.next().unwrap().call(req, handlers)
diff --git a/api/src/router.rs b/api/src/router.rs
index 5f24b033b..ad94a726b 100644
--- a/api/src/router.rs
+++ b/api/src/router.rs
@@ -26,7 +26,7 @@ lazy_static! {
static ref WILDCARD_STOP_HASH: u64 = calculate_hash(&"**");
}
-pub type ResponseFuture = Box, Error = hyper::Error> + Send>;
+pub type ResponseFuture = Box, Error = hyper::Error> + Send>;
pub trait Handler {
fn get(&self, _req: Request) -> ResponseFuture {
@@ -68,7 +68,7 @@ pub trait Handler {
fn call(
&self,
req: Request,
- mut _handlers: Box>,
+ mut _handlers: Box>,
) -> ResponseFuture {
match req.method() {
&Method::GET => self.get(req),
@@ -105,7 +105,7 @@ struct NodeId(usize);
const MAX_CHILDREN: usize = 16;
-pub type HandlerObj = Arc;
+pub type HandlerObj = Arc;
#[derive(Clone)]
pub struct Node {
@@ -147,7 +147,8 @@ impl Router {
.find(|&id| {
let node_key = self.node(*id).key;
node_key == key || node_key == *WILDCARD_HASH || node_key == *WILDCARD_STOP_HASH
- }).cloned()
+ })
+ .cloned()
}
fn add_empty_node(&mut self, parent: NodeId, key: u64) -> NodeId {
@@ -225,7 +226,7 @@ impl NewService for Router {
type Error = hyper::Error;
type InitError = hyper::Error;
type Service = Router;
- type Future = Box + Send>;
+ type Future = Box + Send>;
fn new_service(&self) -> Self::Future {
Box::new(future::ok(self.clone()))
}
diff --git a/api/src/types.rs b/api/src/types.rs
index 379cfc923..2024d07fb 100644
--- a/api/src/types.rs
+++ b/api/src/types.rs
@@ -14,17 +14,17 @@
use std::sync::Arc;
-use chain;
-use core::core::hash::Hashed;
-use core::core::merkle_proof::MerkleProof;
-use core::{core, ser};
-use p2p;
+use crate::chain;
+use crate::core::core::hash::Hashed;
+use crate::core::core::merkle_proof::MerkleProof;
+use crate::core::{core, ser};
+use crate::p2p;
+use crate::util;
+use crate::util::secp::pedersen;
use serde;
use serde::de::MapAccess;
use serde::ser::SerializeStruct;
use std::fmt;
-use util;
-use util::secp::pedersen;
macro_rules! no_dup {
($field:ident) => {
@@ -210,7 +210,7 @@ struct PrintableCommitmentVisitor;
impl<'de> serde::de::Visitor<'de> for PrintableCommitmentVisitor {
type Value = PrintableCommitment;
- fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+ fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
formatter.write_str("a Pedersen commitment")
}
@@ -361,7 +361,7 @@ impl<'de> serde::de::Deserialize<'de> for OutputPrintable {
impl<'de> serde::de::Visitor<'de> for OutputPrintableVisitor {
type Value = OutputPrintable;
- fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result {
+ fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
formatter.write_str("a print able Output")
}
@@ -571,7 +571,8 @@ impl BlockPrintable {
Some(&block.header),
include_proof,
)
- }).collect();
+ })
+ .collect();
let kernels = block
.kernels()
.iter()
diff --git a/api/src/web.rs b/api/src/web.rs
index c7f487979..10eebcbb2 100644
--- a/api/src/web.rs
+++ b/api/src/web.rs
@@ -1,14 +1,14 @@
+use crate::rest::*;
+use crate::router::ResponseFuture;
use futures::future::{err, ok};
use futures::{Future, Stream};
use hyper::{Body, Request, Response, StatusCode};
-use rest::*;
-use router::ResponseFuture;
use serde::{Deserialize, Serialize};
use serde_json;
use std::fmt::Debug;
/// Parse request body
-pub fn parse_body(req: Request) -> Box + Send>
+pub fn parse_body(req: Request) -> Box + Send>
where
for<'de> T: Deserialize<'de> + Send + 'static,
{
diff --git a/api/tests/rest.rs b/api/tests/rest.rs
index e6e564819..641ce3d2e 100644
--- a/api/tests/rest.rs
+++ b/api/tests/rest.rs
@@ -1,8 +1,7 @@
-extern crate grin_api as api;
-extern crate grin_util as util;
-extern crate hyper;
+use grin_api as api;
+use grin_util as util;
-use api::*;
+use crate::api::*;
use hyper::{Body, Request};
use std::net::SocketAddr;
use std::sync::atomic::{AtomicUsize, Ordering, ATOMIC_USIZE_INIT};
@@ -41,7 +40,7 @@ impl Handler for CounterMiddleware {
fn call(
&self,
req: Request,
- mut handlers: Box>,
+ mut handlers: Box>,
) -> ResponseFuture {
self.counter.fetch_add(1, Ordering::SeqCst);
handlers.next().unwrap().call(req, handlers)
diff --git a/chain/Cargo.toml b/chain/Cargo.toml
index b1a305961..ebb7b4d9a 100644
--- a/chain/Cargo.toml
+++ b/chain/Cargo.toml
@@ -7,6 +7,7 @@ license = "Apache-2.0"
repository = "https://github.com/mimblewimble/grin"
keywords = [ "crypto", "grin", "mimblewimble" ]
workspace = ".."
+edition = "2018"
[dependencies]
bitflags = "1"
diff --git a/chain/src/chain.rs b/chain/src/chain.rs
index f2563ec07..a9e115924 100644
--- a/chain/src/chain.rs
+++ b/chain/src/chain.rs
@@ -15,32 +15,30 @@
//! Facade and handler for the rest of the blockchain implementation
//! and mostly the chain pipeline.
+use crate::core::core::hash::{Hash, Hashed, ZERO_HASH};
+use crate::core::core::merkle_proof::MerkleProof;
+use crate::core::core::verifier_cache::VerifierCache;
+use crate::core::core::{
+ Block, BlockHeader, BlockSums, Committed, Output, OutputIdentifier, Transaction, TxKernelEntry,
+};
+use crate::core::global;
+use crate::core::pow;
+use crate::error::{Error, ErrorKind};
+use crate::lmdb;
+use crate::pipe;
+use crate::store;
+use crate::txhashset;
+use crate::types::{
+ BlockStatus, ChainAdapter, NoStatus, Options, Tip, TxHashSetRoots, TxHashsetWriteStatus,
+};
+use crate::util::secp::pedersen::{Commitment, RangeProof};
+use crate::util::RwLock;
+use grin_store::Error::NotFoundErr;
use std::collections::HashMap;
use std::fs::File;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
use std::time::{Duration, Instant};
-use util::RwLock;
-
-use lmdb;
-
-use core::core::hash::{Hash, Hashed, ZERO_HASH};
-use core::core::merkle_proof::MerkleProof;
-use core::core::verifier_cache::VerifierCache;
-use core::core::{
- Block, BlockHeader, BlockSums, Committed, Output, OutputIdentifier, Transaction, TxKernelEntry,
-};
-use core::global;
-use core::pow;
-use error::{Error, ErrorKind};
-use grin_store::Error::NotFoundErr;
-use pipe;
-use store;
-use txhashset;
-use types::{
- BlockStatus, ChainAdapter, NoStatus, Options, Tip, TxHashSetRoots, TxHashsetWriteStatus,
-};
-use util::secp::pedersen::{Commitment, RangeProof};
/// Orphan pool size is limited by MAX_ORPHAN_SIZE
pub const MAX_ORPHAN_SIZE: usize = 200;
@@ -144,10 +142,10 @@ impl OrphanBlockPool {
pub struct Chain {
db_root: String,
store: Arc,
- adapter: Arc,
+ adapter: Arc,
orphans: Arc,
txhashset: Arc>,
- verifier_cache: Arc>,
+ verifier_cache: Arc>,
// POW verification function
pow_verifier: fn(&BlockHeader) -> Result<(), pow::Error>,
archive_mode: bool,
@@ -161,10 +159,10 @@ impl Chain {
pub fn init(
db_root: String,
db_env: Arc,
- adapter: Arc,
+ adapter: Arc,
genesis: Block,
pow_verifier: fn(&BlockHeader) -> Result<(), pow::Error>,
- verifier_cache: Arc>,
+ verifier_cache: Arc>,
archive_mode: bool,
) -> Result {
let chain_store = store::ChainStore::new(db_env)?;
@@ -782,7 +780,7 @@ impl Chain {
&self,
h: Hash,
txhashset_data: File,
- status: &TxHashsetWriteStatus,
+ status: &dyn TxHashsetWriteStatus,
) -> Result<(), Error> {
status.on_setup();
@@ -988,7 +986,8 @@ impl Chain {
if outputs.0 != rangeproofs.0 || outputs.1.len() != rangeproofs.1.len() {
return Err(ErrorKind::TxHashSetErr(String::from(
"Output and rangeproof sets don't match",
- )).into());
+ ))
+ .into());
}
let mut output_vec: Vec