diff --git a/Cargo.lock b/Cargo.lock index f9fd600..34ca9ca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1366,7 +1366,7 @@ checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "rgb-core" version = "0.11.0-beta.6" -source = "git+https://github.com/RGB-WG/rgb-core?branch=master#84892fd826f6f7805b076e70cba467b85c1eb8f7" +source = "git+https://github.com/RGB-WG/rgb-core?branch=mining#0f94cc05643b93769466cdd8e74a7a85d4b30a9c" dependencies = [ "aluvm", "amplify", @@ -1403,7 +1403,7 @@ dependencies = [ [[package]] name = "rgb-invoice" version = "0.11.0-beta.6" -source = "git+https://github.com/RGB-WG/rgb-std?branch=txid#f584d104a2672f546135ede6ddea15607b33e479" +source = "git+https://github.com/RGB-WG/rgb-std?branch=mining#8e398941253fc5426492d97add74ed9fbfcd9223" dependencies = [ "amplify", "baid64", @@ -1465,7 +1465,7 @@ dependencies = [ [[package]] name = "rgb-std" version = "0.11.0-beta.6" -source = "git+https://github.com/RGB-WG/rgb-std?branch=txid#f584d104a2672f546135ede6ddea15607b33e479" +source = "git+https://github.com/RGB-WG/rgb-std?branch=mining#8e398941253fc5426492d97add74ed9fbfcd9223" dependencies = [ "aluvm", "amplify", diff --git a/Cargo.toml b/Cargo.toml index 2764c4a..1a39bd0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -102,7 +102,7 @@ descriptors = { git = "https://github.com/BP-WG/bp-std", branch = "master" } psbt = { git = "https://github.com/BP-WG/bp-std", branch = "master" } bp-std = { git = "https://github.com/BP-WG/bp-std", branch = "master" } bp-wallet = { git = "https://github.com/BP-WG/bp-wallet", branch = "master" } -rgb-core = { git = "https://github.com/RGB-WG/rgb-core", branch = "master" } -rgb-invoice = { git = "https://github.com/RGB-WG/rgb-std", branch = "txid" } -rgb-std = { git = "https://github.com/RGB-WG/rgb-std", branch = "txid" } +rgb-core = { git = "https://github.com/RGB-WG/rgb-core", branch = "mining" } +rgb-invoice = { git = "https://github.com/RGB-WG/rgb-std", branch = "mining" } +rgb-std = { git = "https://github.com/RGB-WG/rgb-std", branch = "mining" } rgb-interfaces = { git = "https://github.com/RGB-WG/rgb-interfaces.git", branch = "master" } diff --git a/src/indexers/any.rs b/src/indexers/any.rs index f20a6bf..b298c2c 100644 --- a/src/indexers/any.rs +++ b/src/indexers/any.rs @@ -96,7 +96,7 @@ impl AnyResolver { consignment .bundles .iter() - .filter_map(|bw| bw.pub_witness.maybe_map_ref(|w| w.tx().cloned())) + .filter_map(|bw| bw.pub_witness.maybe_map_ref(|w| w.tx.clone())) .filter_map(|tx| match tx { XChain::Bitcoin(tx) => Some(tx), XChain::Liquid(_) | XChain::Other(_) => None, @@ -114,7 +114,7 @@ impl ResolveHeight for AnyResolver { if self.terminal_txes.contains_key(&txid) { return Ok(WitnessAnchor { - witness_ord: WitnessOrd::OffChain, + witness_ord: WitnessOrd::offchain(0), witness_id, }); } diff --git a/src/indexers/electrum_blocking.rs b/src/indexers/electrum_blocking.rs index 9049821..c4e8aa9 100644 --- a/src/indexers/electrum_blocking.rs +++ b/src/indexers/electrum_blocking.rs @@ -70,7 +70,7 @@ impl RgbResolver for Client { fn resolve_height(&mut self, txid: Txid) -> Result { let mut witness_anchor = WitnessAnchor { - witness_ord: WitnessOrd::OffChain, + witness_ord: WitnessOrd::offchain(1), witness_id: XWitnessId::Bitcoin(txid), }; diff --git a/src/indexers/esplora_blocking.rs b/src/indexers/esplora_blocking.rs index 374c3dd..57d1fb0 100644 --- a/src/indexers/esplora_blocking.rs +++ b/src/indexers/esplora_blocking.rs @@ -46,7 +46,7 @@ impl RgbResolver for BlockingClient { Some((h, t)) => { WitnessOrd::OnChain(WitnessPos::new(h, t as i64).ok_or(Error::InvalidServerData)?) } - None => WitnessOrd::OffChain, + None => WitnessOrd::offchain(1), }; Ok(WitnessAnchor { witness_ord: ord, diff --git a/src/pay.rs b/src/pay.rs index c6d2af2..0d1b136 100644 --- a/src/pay.rs +++ b/src/pay.rs @@ -111,7 +111,7 @@ where Self::Descr: DescriptorRgb ) -> Result<(Psbt, PsbtMeta, Transfer), PayError> { let (mut psbt, meta) = self.construct_psbt_rgb(stock, invoice, params)?; // ... here we pass PSBT around signers, if necessary - let transfer = self.transfer(stock, invoice, &mut psbt)?; + let transfer = self.transfer(stock, invoice, &mut psbt, 2)?; Ok((psbt, meta, transfer)) } @@ -278,6 +278,7 @@ where Self::Descr: DescriptorRgb stock: &mut Stock, invoice: &RgbInvoice, psbt: &mut Psbt, + priority: u32, ) -> Result { let contract_id = invoice.contract.ok_or(CompletionError::NoContract)?; @@ -311,7 +312,9 @@ where Self::Descr: DescriptorRgb Beneficiary::BlindedSeal(seal) => (vec![XChain::Bitcoin(seal)], vec![]), }; - stock.consume_fascia(fascia).map_err(|e| e.to_string())?; + stock + .consume_fascia(fascia, priority) + .map_err(|e| e.to_string())?; let transfer = stock .transfer(contract_id, beneficiary2, beneficiary1) .map_err(|e| e.to_string())?; diff --git a/src/wallet.rs b/src/wallet.rs index aa8a7bc..35ae6e6 100644 --- a/src/wallet.rs +++ b/src/wallet.rs @@ -159,6 +159,6 @@ where W::Descr: DescriptorRgb invoice: &RgbInvoice, psbt: &mut Psbt, ) -> Result { - self.wallet.transfer(&mut self.stock, invoice, psbt) + self.wallet.transfer(&mut self.stock, invoice, psbt, 2) } }