Skip to content

Commit

Permalink
fix: expose structs
Browse files Browse the repository at this point in the history
  • Loading branch information
crisdut committed Oct 26, 2023
1 parent 083d5f0 commit 5dc0651
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 21 deletions.
31 changes: 15 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,14 @@ serde = "1.0.159"
serde_yaml = "0.9.19"

[features]
default = ["electrum", "log"]
all = ["cli", "log"]
default = ["cli", "electrum", "log"]
electrum = ["electrum-client", "log"]
cli = ["clap", "shellexpand", "log", "electrum"]

[package.metadata.docs.rs]
features = [ "all" ]

[patch.crates-io]
# Remove after merge and release https://github.com/RGB-WG/rgb-wallet/pull/108
rgb-std = { git = "https://github.com/crisdut/rgb-wallet", branch = "feat/improviments" }
1 change: 1 addition & 0 deletions src/descriptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ pub struct TerminalPath {
}

#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
#[derive(Serialize, Deserialize)]

Check warning on line 43 in src/descriptor.rs

View check run for this annotation

Codecov / codecov/patch

src/descriptor.rs#L43

Added line #L43 was not covered by tests
pub struct DeriveInfo {
pub terminal: TerminalPath,
pub tweak: Option<TapretCommitment>,
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ mod runtime;
mod wallet;

pub mod prelude {
pub use descriptor::{RgbDescr, SpkDescriptor, Tapret, TerminalPath};
pub use descriptor::{DeriveInfo, RgbDescr, SpkDescriptor, Tapret, TerminalPath};
pub use rgbfs::StockFs;
pub use rgbstd::*;
pub use rgbwallet::*;
pub use runtime::{Runtime, RuntimeError};
#[cfg(feature = "electrum")]
pub use wallet::BlockchainResolver;
pub use wallet::{DefaultResolver, RgbWallet};
pub use wallet::{DefaultResolver, MiningStatus, Resolver, RgbWallet, Utxo};

pub use super::*;
}
Expand Down
7 changes: 5 additions & 2 deletions src/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use crate::descriptor::DeriveInfo;
use crate::{RgbDescr, SpkDescriptor};

#[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, Display)]
#[derive(Serialize, Deserialize)]

Check warning on line 31 in src/wallet.rs

View check run for this annotation

Codecov / codecov/patch

src/wallet.rs#L31

Added line #L31 was not covered by tests
pub enum MiningStatus {
#[display("~")]
Mempool,
Expand All @@ -36,6 +37,7 @@ pub enum MiningStatus {
}

#[derive(Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug)]
#[derive(Serialize, Deserialize)]

Check warning on line 40 in src/wallet.rs

View check run for this annotation

Codecov / codecov/patch

src/wallet.rs#L40

Added line #L40 was not covered by tests
pub struct Utxo {
pub outpoint: Outpoint,
pub status: MiningStatus,
Expand All @@ -50,7 +52,8 @@ pub trait Resolver {
) -> Result<BTreeSet<Utxo>, String>;
}

#[derive(Clone, Debug)]
#[derive(Clone, Debug, Eq, PartialEq)]
#[derive(Serialize, Deserialize)]

Check warning on line 56 in src/wallet.rs

View check run for this annotation

Codecov / codecov/patch

src/wallet.rs#L55-L56

Added lines #L55 - L56 were not covered by tests
pub struct RgbWallet {
pub descr: RgbDescr,
pub utxos: BTreeSet<Utxo>,
Expand Down Expand Up @@ -226,7 +229,7 @@ mod _electrum {
}

impl Utxo {
fn with(derivation: DeriveInfo, res: ListUnspentRes) -> Self {
pub fn with(derivation: DeriveInfo, res: ListUnspentRes) -> Self {

Check warning on line 232 in src/wallet.rs

View check run for this annotation

Codecov / codecov/patch

src/wallet.rs#L232

Added line #L232 was not covered by tests
Utxo {
status: if res.height == 0 {
MiningStatus::Mempool
Expand Down

0 comments on commit 5dc0651

Please sign in to comment.