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

Remove unused cfg attributes #361

Merged
1 change: 1 addition & 0 deletions crates/floresta-chain/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
//! All data is stored in a `ChainStore` implementation, which is generic over the
//! underlying database. See the ChainStore trait for more information. For a
//! ready-to-use implementation, see the [KvChainStore] struct.
#![allow(unexpected_cfgs)]
Davidson-Souza marked this conversation as resolved.
Show resolved Hide resolved
#![cfg_attr(any(feature = "no-std", not(test)), no_std)]

pub mod pruned_utreexo;
Expand Down
5 changes: 0 additions & 5 deletions crates/floresta-chain/src/pruned_utreexo/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,13 @@ use core::fmt::Debug;
use bitcoin::blockdata::script;
use bitcoin::OutPoint;
use bitcoin::Txid;
#[cfg(feature = "cli-blockchain")]
use btcd_rpc::error::UtreexodError;
use floresta_common::impl_error_from;

use crate::prelude::*;
pub trait DatabaseError: Debug + Send + Sync + 'static {}
#[derive(Debug)]
pub enum BlockchainError {
BlockNotPresent,
#[cfg(feature = "cli-blockchain")]
#[error("Json-Rpc error")]
JsonRpcError(#[from] UtreexodError),
Parsing(String),
BlockValidation(BlockValidationErrors),
TransactionError(TransactionError),
Expand Down
5 changes: 0 additions & 5 deletions crates/floresta-electrum/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
#[cfg(feature = "cli-blockchain")]
use btcd_rpc::error::UtreexodError;
use thiserror::Error;

#[derive(Error, Debug)]
pub enum Error {
#[error("Utreexod error")]
#[cfg(feature = "cli-blockchain")]
BackendError(#[from] UtreexodError),
#[error("Invalid params passed in")]
InvalidParams,
#[error("Invalid json string {0}")]
Expand Down
2 changes: 1 addition & 1 deletion crates/floresta-watch-only/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT

#![allow(unexpected_cfgs)]
Davidson-Souza marked this conversation as resolved.
Show resolved Hide resolved
#![cfg_attr(feature = "no-std", no_std)]
use core::cmp::Ordering;
use core::fmt::Debug;
Expand Down
9 changes: 1 addition & 8 deletions florestad/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
use bitcoin::consensus::encode;
#[cfg(feature = "cli-blockchain")]
use btcd_rpc::error::UtreexodError;
use floresta_chain::BlockValidationErrors;
use floresta_chain::BlockchainError;

use crate::slip132;
#[derive(Debug)]
pub enum Error {
#[cfg(feature = "cli-blockchain")]
UtreexodError(UtreexodError),
Encode(encode::Error),
Db(kv::Error),
ParseNum(std::num::ParseIntError),
Expand All @@ -28,8 +24,6 @@ impl std::fmt::Display for Error {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
Error::Encode(err) => write!(f, "Encode error: {err}"),
#[cfg(feature = "cli-blockchain")]
Error::UtreexodError(_) => write!(f, "UtreexodError"),
Error::Db(err) => write!(f, "Database error {err}"),
Error::ParseNum(err) => write!(f, "int parse error: {err}"),
Error::Rustreexo(err) => write!(f, "Rustreexo error: {err}"),
Expand Down Expand Up @@ -57,8 +51,7 @@ macro_rules! impl_from_error {
};
}
// impl_from_error!(Parsing, bitcoin::hashes::hex::Error);
Davidson-Souza marked this conversation as resolved.
Show resolved Hide resolved
#[cfg(feature = "cli-blockchain")]
impl_from_error!(UtreexodError, UtreexodError);

impl_from_error!(Encode, encode::Error);
impl_from_error!(Db, kv::Error);
impl_from_error!(ParseNum, std::num::ParseIntError);
Expand Down