Skip to content

Commit

Permalink
Merge pull request #167 from RGB-WG/script-refactor
Browse files Browse the repository at this point in the history
Update to refactored standard library
  • Loading branch information
dr-orlovsky authored Apr 18, 2024
2 parents 9340c02 + b1e1122 commit 5592cda
Show file tree
Hide file tree
Showing 9 changed files with 272 additions and 425 deletions.
105 changes: 49 additions & 56 deletions Cargo.lock

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

18 changes: 10 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
members = [
"psbt",
"cli",
"fs",
"."
]
default-members = [
"psbt",
"fs",
"."
]

Expand Down Expand Up @@ -77,7 +75,6 @@ bp-esplora = { workspace = true, optional = true }
descriptors = { workspace = true }
rgb-std = { workspace = true }
rgb-psbt = { workspace = true }
rgb-persist-fs = { version = "0.11.1", path = "fs" }
indexmap = { workspace = true }
chrono = { workspace = true }
serde_crate = { workspace = true, optional = true }
Expand All @@ -96,16 +93,21 @@ serde = ["serde_crate", "serde_with", "serde_yaml", "bp-std/serde", "bp-wallet/s
features = ["all"]

[patch.crates-io]
strict_types = { git = "https://github.com/strict-types/strict-types", branch = "reconstruct" }
strict_encoding_derive = { git = "https://github.com/strict-types/strict-encoding", branch = "rstring" }
strict_encoding = { git = "https://github.com/strict-types/strict-encoding", branch = "rstring" }
strict_types = { git = "https://github.com/strict-types/strict-types", branch = "develop" }
commit_verify = { git = "https://github.com/LNP-BP/client_side_validation", branch = "v0.11" }
single_use_seals = { git = "https://github.com/LNP-BP/client_side_validation", branch = "v0.11" }
bp-consensus = { git = "https://github.com/BP-WG/bp-core", branch = "v0.11" }
bp-dbc = { git = "https://github.com/BP-WG/bp-core", branch = "v0.11" }
bp-seals = { git = "https://github.com/BP-WG/bp-core", branch = "v0.11" }
bp-core = { git = "https://github.com/BP-WG/bp-core", branch = "v0.11" }
bp-invoice = { git = "https://github.com/BP-WG/bp-std", branch = "v0.11" }
bp-std = { git = "https://github.com/BP-WG/bp-std", branch = "v0.11" }
bp-wallet = { git = "https://github.com/BP-WG/bp-wallet", branch = "v0.11" }
psbt = { git = "https://github.com/BP-WG/bp-std", branch = "v0.11" }
descriptors = { git = "https://github.com/BP-WG/bp-std", branch = "v0.11" }
bp-wallet = { git = "https://github.com/BP-WG/bp-wallet", branch = "v0.11" }
rgb-core = { git = "https://github.com/RGB-WG/rgb-core", branch = "v0.11" }
rgb-std = { git = "https://github.com/RGB-WG/rgb-std", branch = "v0.11" }
rgb-invoice = { git = "https://github.com/RGB-WG/rgb-std", branch = "v0.11" }
aluvm = { git = "https://github.com/AluVM/rust-aluvm", branch = "v0.11" }
rgb-core = { git = "https://github.com/RGB-WG/rgb-core", branch = "script-refactor" }
rgb-std = { git = "https://github.com/RGB-WG/rgb-std", branch = "script-refactor" }
rgb-invoice = { git = "https://github.com/RGB-WG/rgb-std", branch = "script-refactor" }
9 changes: 9 additions & 0 deletions cli/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ use rgb_rt::{
electrum, esplora_blocking, AnyResolver, AnyResolverError, RgbDescr, Runtime, RuntimeError,
TapretKey,
};
use rgbstd::persistence::Stock;

use crate::Command;

Expand Down Expand Up @@ -72,6 +73,14 @@ impl Default for RgbArgs {
}

impl RgbArgs {
pub fn rgb_stock(&self) -> Result<Stock, RuntimeError> {
eprint!("Loading stock ... ");
let runtime = Runtime::<RgbDescr>::load_walletless(&self.general.base_dir())?;
eprintln!("success");

Ok(runtime)
}

pub fn rgb_runtime(&self, config: &Config) -> Result<Runtime, RuntimeError> {
let bprt = self.inner.bp_runtime::<RgbDescr>(config)?;
eprint!("Loading stock ... ");
Expand Down
Loading

0 comments on commit 5592cda

Please sign in to comment.