diff --git a/bp-core b/bp-core index 704c9b5..12931d1 160000 --- a/bp-core +++ b/bp-core @@ -1 +1 @@ -Subproject commit 704c9b59cb48afbb74223adbd272b96bfe96b808 +Subproject commit 12931d1cc5664825bf9f9ab8bdac20eeced9f1ca diff --git a/bp-std b/bp-std index 8177aab..fa096ba 160000 --- a/bp-std +++ b/bp-std @@ -1 +1 @@ -Subproject commit 8177aab7c0badf5295b6b9664d2f652a94f7093e +Subproject commit fa096ba53318608583b614ad0900f0ea996b3389 diff --git a/bp-wallet b/bp-wallet index 776daa6..418bf29 160000 --- a/bp-wallet +++ b/bp-wallet @@ -1 +1 @@ -Subproject commit 776daa69ca1a50cf2d9de5556f205edeecef2975 +Subproject commit 418bf29b9408f90888c9f234749b6ddc57bed9ed diff --git a/rgb b/rgb index 1c1844c..ffc026d 160000 --- a/rgb +++ b/rgb @@ -1 +1 @@ -Subproject commit 1c1844c4b95f69aeb3f5f4796a4e7852fb1c3719 +Subproject commit ffc026d06f2fe9d4d42e63a455e4edc75e4f1922 diff --git a/rgb-core b/rgb-core index cb6892b..84892fd 160000 --- a/rgb-core +++ b/rgb-core @@ -1 +1 @@ -Subproject commit cb6892b683193b42b28222c094f3a5b448dee3ce +Subproject commit 84892fd826f6f7805b076e70cba467b85c1eb8f7 diff --git a/rgb-std b/rgb-std index 83abb13..7ac337b 160000 --- a/rgb-std +++ b/rgb-std @@ -1 +1 @@ -Subproject commit 83abb1385cf4af6d95e129cc65ac426de493b496 +Subproject commit 7ac337b3d84204e43f3818d298f7fc46b24341c2 diff --git a/tests/docker-compose.yml b/tests/docker-compose.yml index 197c884..6ea1d73 100644 --- a/tests/docker-compose.yml +++ b/tests/docker-compose.yml @@ -13,7 +13,7 @@ services: depends_on: - bitcoind esplora: - image: blockstream/esplora:956c74f42eb6ad803d8aedc272ba83d3aa6dcf5c + image: blockstream/esplora:latest profiles: [esplora] command: /srv/explorer/run.sh bitcoin-regtest explorer environment: diff --git a/tests/utils/chain.rs b/tests/utils/chain.rs index 1d289e2..6940d05 100644 --- a/tests/utils/chain.rs +++ b/tests/utils/chain.rs @@ -195,7 +195,7 @@ fn _wait_indexer_sync() { let t_0 = OffsetDateTime::now_utc(); let blockcount = get_height(); loop { - std::thread::sleep(std::time::Duration::from_millis(100)); + std::thread::sleep(std::time::Duration::from_millis(500)); match INDEXER.get().unwrap() { Indexer::Electrum => { let electrum_client = @@ -211,7 +211,7 @@ fn _wait_indexer_sync() { } } } - if (OffsetDateTime::now_utc() - t_0).as_seconds_f32() > 15.0 { + if (OffsetDateTime::now_utc() - t_0).as_seconds_f32() > 25.0 { panic!("indexer not syncing with bitcoind"); } } diff --git a/tests/utils/helpers.rs b/tests/utils/helpers.rs index dde0a2c..14ce0d4 100644 --- a/tests/utils/helpers.rs +++ b/tests/utils/helpers.rs @@ -1,7 +1,9 @@ +use bpwallet::FsConfig; +use rgb::RgbWallet; use super::*; pub struct Wallet { - stored_wallet: StoredWallet>, + stored_wallet: RgbWallet>, account: MemorySigningAccount, } @@ -344,34 +346,20 @@ pub fn get_wallet(descriptor_type: &DescriptorType) -> Wallet { std::fs::create_dir_all(&rgb_dir).unwrap(); println!("wallet dir: {rgb_dir:?}"); - let mut bp_runtime: BpRuntime = BpRuntime::new_standard(descriptor, Network::Regtest); - - if bp_runtime.warnings().is_empty() { - eprintln!("success"); - } else { - eprintln!("complete with warnings:"); - for warning in bp_runtime.warnings() { - eprintln!("- {warning}"); - } - bp_runtime.reset_warnings(); - } + let mut bp_wallet = BpWallet::new_layer1(descriptor, Network::Regtest); + eprintln!("success"); let name = s!("wallet_name"); let dir = rgb_dir.join(&name); - bp_runtime.set_name(name); - bp_runtime.store(&dir).unwrap(); - - let stock = Stock::default(); - stock.store(&rgb_dir).unwrap(); - let mut stored_stock = StoredStock::attach(rgb_dir.clone(), stock.clone()); + bp_wallet.set_name(name); + bp_wallet.set_fs_config(FsConfig { path: dir, autosave: true }).unwrap(); - let wallet_path = bp_runtime.path().clone(); - let stored_wallet = - StoredWallet::attach(rgb_dir.clone(), wallet_path, stock, bp_runtime.detach()); + let stock = Stock::new(rgb_dir); + let mut stored_wallet = RgbWallet::new(stock, bp_wallet); for asset_schema in AssetSchema::iter() { let valid_kit = asset_schema.get_valid_kit(); - stored_stock.import_kit(valid_kit).unwrap(); + stored_wallet.stock_mut().import_kit(valid_kit).unwrap(); } let mut wallet = Wallet { @@ -490,7 +478,6 @@ impl Wallet { .update(&indexer) .into_result() .unwrap(); - self.stored_wallet.store(); } pub fn close_method(&self) -> CloseMethod { @@ -693,7 +680,7 @@ impl Wallet { if attempts > 3 { panic!("error accepting transfer: {e}"); } - std::thread::sleep(std::time::Duration::from_millis(100)); + std::thread::sleep(std::time::Duration::from_millis(500)); } } diff --git a/tests/utils/mod.rs b/tests/utils/mod.rs index 014aec8..90b579c 100644 --- a/tests/utils/mod.rs +++ b/tests/utils/mod.rs @@ -39,7 +39,7 @@ pub use bpstd::{ DerivationPath as BpDerivationPath, DerivationSeg, HardenedIndex, Keychain, Network, Xpub, XpubDerivable, XpubFp, XpubOrigin, }; -pub use bpwallet::{AnyIndexer, Runtime as BpRuntime, Wallet as BpWallet}; +pub use bpwallet::{AnyIndexer, Wallet as BpWallet}; pub use descriptors::Wpkh; pub use dw_psbt::{ serialize::Deserialize, @@ -58,11 +58,10 @@ pub use once_cell::sync::Lazy; pub use psbt::PsbtVer; pub use rand::RngCore; pub use rgb::{ - invoice::Pay2Vout, stl::ContractTerms, AnyResolver, DescriptorRgb, GenesisSeal, GraphSeal, - Identity, RgbDescr, RgbKeychain, StoredStock, StoredWallet, TapretKey, TransferParams, + invoice::Pay2Vout, stl::ContractTerms, DescriptorRgb, GenesisSeal, GraphSeal, + Identity, RgbDescr, RgbKeychain, TapretKey, TransferParams, WalletProvider, -}; -pub use rgbstd::{ + resolvers::AnyResolver, containers::{BuilderSeal, FileContent, Kit, Transfer, ValidKit}, interface::{ ContractBuilder, ContractIface, DataAllocation, FilterExclude, FungibleAllocation, Iface, @@ -70,7 +69,6 @@ pub use rgbstd::{ }, invoice::{Beneficiary, RgbInvoice, RgbInvoiceBuilder, XChainNet}, persistence::{ - fs::{LoadFs, StoreFs}, PersistedState, SchemaIfaces, StashReadProvider, Stock, }, schema::SchemaId,