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

Rename esplora into esplora_blocking and do a dedicated resolver module #103

Closed
wants to merge 8 commits into from
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
fail-fast: false
matrix:
feature:
- esplora
- esplora_blocking
- log
- serde
steps:
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ serde_with = { workspace = true, optional = true }
log = { workspace = true, optional = true }

[features]
default = ["esplora"]
all = ["esplora", "serde", "log"]
esplora = ["bp-esplora", "bp-wallet/esplora"]
default = ["esplora_blocking"]
all = ["esplora_blocking", "serde", "log"]
esplora_blocking = ["bp-esplora", "bp-wallet/esplora"]
serde = ["serde_crate", "serde_with", "serde_yaml", "bp-std/serde", "bp-wallet/serde", "descriptors/serde", "rgb-psbt/serde"]

[package.metadata.docs.rs]
Expand Down
2 changes: 1 addition & 1 deletion cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ bp-wallet = { workspace = true }
bp-util = { workspace = true }
psbt = { workspace = true }
rgb-std = { workspace = true, features = ["serde"] }
rgb-runtime = { version = "0.11.0-beta.1", path = "..", features = ["esplora", "log", "serde"] }
rgb-runtime = { version = "0.11.0-beta.1", path = "..", features = ["esplora_blocking", "log", "serde"] }
log = { workspace = true }
env_logger = "0.10.1"
clap = { version = "4.4.8", features = ["derive", "env"] }
Expand Down
3 changes: 2 additions & 1 deletion cli/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@

use bp_util::{Config, DescriptorOpts};
use bpstd::{Wpkh, XpubDerivable};
use rgb_rt::{Resolver, ResolverError, RgbDescr, Runtime, RuntimeError, TapretKey};
use rgb_rt::esplora_blocking::{Resolver, ResolverError};
use rgb_rt::{RgbDescr, Runtime, RuntimeError, TapretKey};

use crate::Command;

Expand Down
6 changes: 2 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@ extern crate serde_with;
mod runtime;
mod descriptor;
mod pay;
#[cfg(feature = "esplora")]
mod resolver;
mod resolvers;

pub use descriptor::{DescriptorRgb, RgbDescr, RgbKeychain, TapTweakAlreadyAssigned, TapretKey};
pub use pay::{CompletionError, CompositionError, PayError, TransferParams};
#[cfg(feature = "esplora")]
pub use resolver::{AnchorResolverError, Resolver, ResolverError};
pub use resolvers::*;
pub use runtime::{ContractOutpointsFilter, Runtime, RuntimeError};
File renamed without changes.
23 changes: 23 additions & 0 deletions src/resolvers/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// RGB smart contracts for Bitcoin & Lightning
//
// SPDX-License-Identifier: Apache-2.0
//
// Written in 2019-2023 by
// Dr Maxim Orlovsky <[email protected]>
//
// Copyright (C) 2019-2023 LNP/BP Standards Association. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#[cfg(feature = "esplora_blocking")]
pub mod esplora_blocking;
2 changes: 1 addition & 1 deletion src/runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pub enum RuntimeError {
#[from(bpwallet::LoadError)]
Bp(bpwallet::RuntimeError),

#[cfg(feature = "esplora")]
#[cfg(feature = "esplora_blocking")]
#[from]
Esplora(esplora::Error),

Expand Down
Loading