diff --git a/Cargo.toml b/Cargo.toml index df99716..dcbc004 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -83,8 +83,9 @@ log = { workspace = true, optional = true } [features] default = ["esplora_blocking"] -all = ["esplora_blocking", "electrum_blocking", "serde", "log", "fs"] +all = ["esplora_blocking", "electrum_blocking", "serde", "log", "fs", "cli"] fs = ["serde", "bp-wallet/fs"] +cli = ["fs"] esplora_blocking = ["bp-esplora"] electrum_blocking = ["bp-electrum"] serde = ["serde_crate", "serde_yaml", "bp-std/serde", "descriptors/serde", "rgb-psbt/serde"] diff --git a/cli/Cargo.toml b/cli/Cargo.toml index 3bd7520..b1887ff 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -27,7 +27,7 @@ bp-wallet = { workspace = true, features = ["cli"] } psbt = { workspace = true } rgb-std = { workspace = true, features = ["serde"] } rgb-interfaces = { workspace = true } -rgb-runtime = { version = "0.11.0-beta.6", path = "..", features = ["electrum_blocking", "esplora_blocking", "log", "serde", "fs"] } +rgb-runtime = { version = "0.11.0-beta.6", path = "..", features = ["electrum_blocking", "esplora_blocking", "log", "serde", "fs", "cli"] } log = { workspace = true } env_logger = "0.11.3" clap = { version = "4.4.8", features = ["derive", "env"] } diff --git a/cli/src/command.rs b/cli/src/command.rs index ee56197..25dc518 100644 --- a/cli/src/command.rs +++ b/cli/src/command.rs @@ -35,8 +35,9 @@ use rgb::containers::{ BuilderSeal, ContainerVer, ContentId, ContentSigs, Contract, FileContent, Supplement, Terminal, Transfer, UniversalFile, }; -use rgb::interface::{AmountChange, IfaceId}; +use rgb::interface::{AmountChange, IfaceId, OutpointFilter}; use rgb::invoice::{Beneficiary, Pay2Vout, RgbInvoice, RgbInvoiceBuilder, XChainNet}; +use rgb::persistence::StashReadProvider; use rgb::schema::SchemaId; use rgb::validation::Validity; use rgb::vm::RgbIsa; @@ -45,8 +46,6 @@ use rgb::{ RgbKeychain, RgbWallet, StateType, TransferParams, WalletError, WalletProvider, XChain, XOutpoint, XOutputSeal, }; -use rgbstd::interface::OutpointFilter; -use rgbstd::persistence::StashReadProvider; use serde_crate::{Deserialize, Serialize}; use strict_types::encoding::{FieldName, TypeName}; use strict_types::StrictVal; diff --git a/src/errors.rs b/src/errors.rs index 0e17177..bd9aabc 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -50,7 +50,15 @@ pub enum WalletError { Deserialize(DeserializeError), #[from] - Load(LoadError), + StockLoad(LoadError), + + #[cfg(feature = "fs")] + #[from] + WalletLoad(bpwallet::fs::LoadError), + + #[cfg(feature = "cli")] + #[from] + WalletExect(bpwallet::cli::ExecError), #[from] Builder(BuilderError), @@ -82,11 +90,6 @@ pub enum WalletError { #[display(doc_comments)] IncompleteContract(validation::Status), - #[cfg(feature = "fs")] - #[from] - #[from(bpwallet::fs::LoadError)] - Bp(bpwallet::cli::ExecError), - /// resolver error: {0} #[display(doc_comments)] Resolver(String),