Эх сурвалжийг харах

split btc from the default feature

ghassmo 4 жил өмнө
parent
commit
64ec12e30c
3 өөрчлөгдсөн 6 нэмэгдсэн , 6 устгасан
  1. 1 1
      Cargo.toml
  2. 3 3
      src/error.rs
  3. 2 2
      src/service/mod.rs

+ 1 - 1
Cargo.toml

@@ -101,7 +101,7 @@ version = "0.25.1"
 features = ["bundled", "sqlcipher"]
 
 [features]
-default = ["bitcoin", "secp256k1", "electrum-client"]
+btc = ["bitcoin", "secp256k1", "electrum-client"]
 sol = ["solana-sdk", "solana-client", "spl-token", "tokio-tungstenite"]
 
 [[bin]]

+ 3 - 3
src/error.rs

@@ -43,7 +43,7 @@ pub enum Error {
     ZmqError(String),
     VerifyFailed,
     ClientFailed(String),
-    #[cfg(feature = "default")]
+    #[cfg(feature = "btc")]
     BtcFailed(String),
     #[cfg(feature = "sol")]
     SolFailed(String),
@@ -100,7 +100,7 @@ impl fmt::Display for Error {
             Error::ZmqError(ref err) => write!(f, "ZmqError: {}", err),
             Error::VerifyFailed => f.write_str("Verify failed"),
             Error::ClientFailed(ref err) => write!(f, "Client failed: {}", err),
-            #[cfg(feature = "default")]
+            #[cfg(feature = "btc")]
             Error::BtcFailed(ref err) => write!(f, "Btc client failed: {}", err),
             #[cfg(feature = "sol")]
             Error::SolFailed(ref err) => write!(f, "Sol client failed: {}", err),
@@ -233,7 +233,7 @@ impl From<client::ClientFailed> for Error {
     }
 }
 
-#[cfg(feature = "default")]
+#[cfg(feature = "btc")]
 impl From<crate::service::BtcFailed> for Error {
     fn from(err: crate::service::BtcFailed) -> Error {
         Error::BtcFailed(err.to_string())

+ 2 - 2
src/service/mod.rs

@@ -3,9 +3,9 @@ pub mod gateway;
 pub mod reqrep;
 pub mod bridge;
 
-#[cfg(feature = "default")]
+#[cfg(feature = "btc")]
 pub mod btc;
-#[cfg(feature = "default")]
+#[cfg(feature = "btc")]
 pub use btc::{BitcoinKeys, PubAddress, BtcFailed, BtcResult};
 
 #[cfg(feature = "sol")]