From 4a242d69e435b4faf0f05767967ad77b24d03f03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zoe=20Faltib=C3=A0?= Date: Wed, 11 Sep 2024 11:57:39 +0200 Subject: [PATCH 1/5] tapret_wlt_receiving_opret: de-ignore and improve to show bug --- tests/transfers.rs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/tests/transfers.rs b/tests/transfers.rs index 4a0efa4..08187f1 100644 --- a/tests/transfers.rs +++ b/tests/transfers.rs @@ -736,7 +736,6 @@ fn mainnet_wlt_receiving_test_asset() { } #[test] -#[ignore = "this was working, fix needed"] fn tapret_wlt_receiving_opret() { initialize(); @@ -776,4 +775,26 @@ fn tapret_wlt_receiving_opret() { 1000, None, ); + + println!("4th transfer"); + wlt_2.send( + &mut wlt_1, + TransferType::Blinded, + contract_id, + &iface_type_name, + 560, + 1000, + None, + ); + + println!("5th transfer"); + wlt_1.send( + &mut wlt_2, + TransferType::Blinded, + contract_id, + &iface_type_name, + 600, + 1000, + None, + ); } From 305e50cf70e89bd494634886330d9efba00ce828 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Tue, 8 Oct 2024 04:27:31 +0000 Subject: [PATCH 2/5] update branches to the most recent versions --- Cargo.lock | 72 ++++++++++++++++++++--------------------------- amplify-nonasync | 2 +- bp-esplora-client | 2 +- bp-wallet | 2 +- rgb | 2 +- rgb-core | 2 +- rgb-interfaces | 2 +- rgb-std | 2 +- 8 files changed, 37 insertions(+), 49 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0c075b6..a9d58ce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -30,7 +30,7 @@ dependencies = [ name = "aluvm" version = "0.11.0-beta.8" dependencies = [ - "amplify 4.7.0", + "amplify", "ascii-armor", "baid64", "blake3", @@ -60,18 +60,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "amplify" -version = "5.0.0-beta.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d41888768802fc62c27b46427127b119e8a16e1f1f59495aced93a340f55eb25" -dependencies = [ - "amplify_derive", - "amplify_num", - "ascii", - "wasm-bindgen", -] - [[package]] name = "amplify_apfloat" version = "0.3.1" @@ -148,7 +136,7 @@ dependencies = [ name = "ascii-armor" version = "0.7.2" dependencies = [ - "amplify 4.7.0", + "amplify", "baid64", "base85", "sha2", @@ -207,7 +195,7 @@ dependencies = [ name = "baid64" version = "0.2.2" dependencies = [ - "amplify 4.7.0", + "amplify", "base64", "mnemonic", "sha2", @@ -317,7 +305,7 @@ dependencies = [ name = "bp-consensus" version = "0.11.0-beta.8" dependencies = [ - "amplify 4.7.0", + "amplify", "chrono", "commit_verify", "secp256k1", @@ -330,7 +318,7 @@ dependencies = [ name = "bp-core" version = "0.11.0-beta.8" dependencies = [ - "amplify 4.7.0", + "amplify", "bp-consensus", "bp-dbc", "bp-seals", @@ -347,7 +335,7 @@ dependencies = [ name = "bp-dbc" version = "0.11.0-beta.8" dependencies = [ - "amplify 4.7.0", + "amplify", "base85", "bp-consensus", "commit_verify", @@ -360,7 +348,7 @@ dependencies = [ name = "bp-derive" version = "0.11.0-beta.8" dependencies = [ - "amplify 4.7.0", + "amplify", "bp-consensus", "bp-invoice", "commit_verify", @@ -374,7 +362,7 @@ dependencies = [ name = "bp-electrum" version = "0.11.0-beta.8.1" dependencies = [ - "amplify 4.7.0", + "amplify", "bp-std", "byteorder", "libc", @@ -391,7 +379,7 @@ dependencies = [ name = "bp-esplora" version = "0.11.0-beta.8" dependencies = [ - "amplify 4.7.0", + "amplify", "bp-std", "log", "reqwest", @@ -405,7 +393,7 @@ dependencies = [ name = "bp-invoice" version = "0.11.0-beta.8" dependencies = [ - "amplify 4.7.0", + "amplify", "bech32", "bp-consensus", "commit_verify", @@ -416,7 +404,7 @@ dependencies = [ name = "bp-seals" version = "0.11.0-beta.8" dependencies = [ - "amplify 4.7.0", + "amplify", "baid64", "bp-consensus", "bp-dbc", @@ -431,7 +419,7 @@ dependencies = [ name = "bp-std" version = "0.11.0-beta.8" dependencies = [ - "amplify 4.7.0", + "amplify", "bp-consensus", "bp-derive", "bp-invoice", @@ -447,7 +435,7 @@ dependencies = [ name = "bp-wallet" version = "0.11.0-beta.8" dependencies = [ - "amplify 4.7.0", + "amplify", "bp-electrum", "bp-esplora", "bp-std", @@ -546,7 +534,7 @@ dependencies = [ name = "commit_encoding_derive" version = "0.11.0-beta.8" dependencies = [ - "amplify 4.7.0", + "amplify", "amplify_syn", "proc-macro2", "quote", @@ -557,7 +545,7 @@ dependencies = [ name = "commit_verify" version = "0.11.0-beta.8" dependencies = [ - "amplify 4.7.0", + "amplify", "commit_encoding_derive", "rand", "ripemd", @@ -673,7 +661,7 @@ dependencies = [ name = "descriptors" version = "0.11.0-beta.8" dependencies = [ - "amplify 4.7.0", + "amplify", "bp-derive", "indexmap 2.4.0", "serde", @@ -1303,9 +1291,9 @@ dependencies = [ [[package]] name = "nonasync" -version = "0.1.0" +version = "0.1.2" dependencies = [ - "amplify 5.0.0-beta.1", + "amplify", "log", ] @@ -1468,7 +1456,7 @@ dependencies = [ name = "psbt" version = "0.11.0-beta.8" dependencies = [ - "amplify 4.7.0", + "amplify", "base64", "bp-core", "bp-derive", @@ -1599,7 +1587,7 @@ name = "rgb-core" version = "0.11.0-beta.8" dependencies = [ "aluvm", - "amplify 4.7.0", + "amplify", "baid64", "bp-core", "chrono", @@ -1619,7 +1607,7 @@ name = "rgb-interfaces" version = "0.11.0-beta.8" dependencies = [ "aluvm", - "amplify 4.7.0", + "amplify", "bp-core", "chrono", "getrandom", @@ -1635,7 +1623,7 @@ dependencies = [ name = "rgb-invoice" version = "0.11.0-beta.8" dependencies = [ - "amplify 4.7.0", + "amplify", "baid64", "bp-core", "bp-invoice", @@ -1654,7 +1642,7 @@ dependencies = [ name = "rgb-psbt" version = "0.11.0-beta.8" dependencies = [ - "amplify 4.7.0", + "amplify", "baid64", "bp-core", "bp-std", @@ -1670,7 +1658,7 @@ dependencies = [ name = "rgb-runtime" version = "0.11.0-beta.8" dependencies = [ - "amplify 4.7.0", + "amplify", "baid64", "bp-core", "bp-electrum", @@ -1696,7 +1684,7 @@ name = "rgb-schemata" version = "0.11.0-beta.8" dependencies = [ "aluvm", - "amplify 4.7.0", + "amplify", "bp-core", "chrono", "rgb-interfaces", @@ -1713,7 +1701,7 @@ name = "rgb-std" version = "0.11.0-beta.8" dependencies = [ "aluvm", - "amplify 4.7.0", + "amplify", "ascii-armor", "baid64", "base85", @@ -1736,7 +1724,7 @@ dependencies = [ name = "rgb-tests" version = "0.1.0" dependencies = [ - "amplify 4.7.0", + "amplify", "bitcoin_hashes", "bp-core", "bp-electrum", @@ -2175,7 +2163,7 @@ checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" name = "strict_encoding" version = "2.7.0" dependencies = [ - "amplify 4.7.0", + "amplify", "half", "serde", "strict_encoding_derive", @@ -2197,7 +2185,7 @@ dependencies = [ name = "strict_types" version = "2.7.0" dependencies = [ - "amplify 4.7.0", + "amplify", "ascii-armor", "baid64", "half", @@ -2573,7 +2561,7 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" name = "vesper-lang" version = "0.1.0" dependencies = [ - "amplify 4.7.0", + "amplify", "strict_encoding", ] diff --git a/amplify-nonasync b/amplify-nonasync index b1bf354..1a5ecbf 160000 --- a/amplify-nonasync +++ b/amplify-nonasync @@ -1 +1 @@ -Subproject commit b1bf3542060beabe3dcdf66517be6ee3eb2ac302 +Subproject commit 1a5ecbf8d9eb8616cf0c091ceee6ff2fcc941780 diff --git a/bp-esplora-client b/bp-esplora-client index d930558..4cdad88 160000 --- a/bp-esplora-client +++ b/bp-esplora-client @@ -1 +1 @@ -Subproject commit d930558ab30ecc2cf6d76f268fbc94aea35c7a26 +Subproject commit 4cdad88d83e660a06aae5457cd2c7eeed369baa5 diff --git a/bp-wallet b/bp-wallet index 7487a1c..f850c3b 160000 --- a/bp-wallet +++ b/bp-wallet @@ -1 +1 @@ -Subproject commit 7487a1c10c07ec313f1b8d77ce5acf41a8389cea +Subproject commit f850c3b3f98e1ade4b720c3c0c6e4799bb3ccb7f diff --git a/rgb b/rgb index 56f8d4c..07c55b3 160000 --- a/rgb +++ b/rgb @@ -1 +1 @@ -Subproject commit 56f8d4cdedf85c728505d07d8452a3916cb70565 +Subproject commit 07c55b3aff4ba3d0763807ffb92e8e8af72c2ea6 diff --git a/rgb-core b/rgb-core index 8be4962..e2a451f 160000 --- a/rgb-core +++ b/rgb-core @@ -1 +1 @@ -Subproject commit 8be49626a968a45fc868db1e1454095b75349c17 +Subproject commit e2a451fa793fe5403b4114b5ed5e9e47c69674cd diff --git a/rgb-interfaces b/rgb-interfaces index 5acc09c..673e970 160000 --- a/rgb-interfaces +++ b/rgb-interfaces @@ -1 +1 @@ -Subproject commit 5acc09c2387f8d1f7eb0393983415d2d523225b4 +Subproject commit 673e970f5655ac5f7bd577a410ef4ad02bf3f62e diff --git a/rgb-std b/rgb-std index 94aeb57..94b5ebc 160000 --- a/rgb-std +++ b/rgb-std @@ -1 +1 @@ -Subproject commit 94aeb57a3db7dfe89b8c03bd4a90a8eabae09ff3 +Subproject commit 94b5ebc6b998b4aa2321513c08b4ff2aebfd2a56 From 828756cff74ac5427da7d514bd918ee3b713f08f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zoe=20Faltib=C3=A0?= Date: Tue, 8 Oct 2024 12:02:46 +0200 Subject: [PATCH 3/5] fixes to use develop branches --- tests/transfers.rs | 12 ++--- tests/utils/helpers.rs | 109 +++++++++++++++++++++++++++++++++++------ tests/utils/mod.rs | 5 +- 3 files changed, 103 insertions(+), 23 deletions(-) diff --git a/tests/transfers.rs b/tests/transfers.rs index 08187f1..ca9a0aa 100644 --- a/tests/transfers.rs +++ b/tests/transfers.rs @@ -551,7 +551,7 @@ fn ln_transfers() { }; let (fascia, _asset_beneficiaries) = wlt_1.color_psbt(&mut psbt, coloring_info.clone()); wlt_1.consume_fascia(fascia.clone(), psbt.txid()); - wlt_1.debug_logs(contract_id, &iface_type_name); + wlt_1.debug_logs(contract_id, &iface_type_name, AllocationFilter::WalletAll); let htlc_vout = 2; let htlc_rgb_amt = 200; @@ -580,7 +580,7 @@ fn ln_transfers() { }; let (fascia, _asset_beneficiaries) = wlt_1.color_psbt(&mut psbt, coloring_info.clone()); wlt_1.consume_fascia(fascia.clone(), psbt.txid()); - wlt_1.debug_logs(contract_id, &iface_type_name); + wlt_1.debug_logs(contract_id, &iface_type_name, AllocationFilter::WalletAll); println!("\n3. fake HTLC TX"); let witness_id = fascia.witness_id(); @@ -607,7 +607,7 @@ fn ln_transfers() { }; let (fascia, _asset_beneficiaries) = wlt_1.color_psbt(&mut psbt, coloring_info); wlt_1.consume_fascia(fascia.clone(), psbt.txid()); - wlt_1.debug_logs(contract_id, &iface_type_name); + wlt_1.debug_logs(contract_id, &iface_type_name, AllocationFilter::WalletAll); println!("\n4. fake commitment TX (no HTLCs)"); let beneficiaries = vec![ @@ -630,7 +630,7 @@ fn ln_transfers() { }; let (fascia, _asset_beneficiaries) = wlt_1.color_psbt(&mut psbt, coloring_info); wlt_1.consume_fascia(fascia.clone(), psbt.txid()); - wlt_1.debug_logs(contract_id, &iface_type_name); + wlt_1.debug_logs(contract_id, &iface_type_name, AllocationFilter::WalletAll); let mut old_psbt = psbt.clone(); println!("\n5. fake commitment TX (1 HTLC)"); @@ -656,7 +656,7 @@ fn ln_transfers() { }; let (fascia, _asset_beneficiaries) = wlt_1.color_psbt(&mut psbt, coloring_info.clone()); wlt_1.consume_fascia(fascia.clone(), psbt.txid()); - wlt_1.debug_logs(contract_id, &iface_type_name); + wlt_1.debug_logs(contract_id, &iface_type_name, AllocationFilter::WalletAll); println!("\n6. fake HTLC TX"); let witness_id = fascia.witness_id(); @@ -683,7 +683,7 @@ fn ln_transfers() { }; let (fascia, _asset_beneficiaries) = wlt_1.color_psbt(&mut psbt, coloring_info); wlt_1.consume_fascia(fascia.clone(), psbt.txid()); - wlt_1.debug_logs(contract_id, &iface_type_name); + wlt_1.debug_logs(contract_id, &iface_type_name, AllocationFilter::WalletAll); println!("\n7. broadcast old PSBT"); let tx = wlt_1.sign_finalize(&mut old_psbt); diff --git a/tests/utils/helpers.rs b/tests/utils/helpers.rs index 0c0d58e..45b004b 100644 --- a/tests/utils/helpers.rs +++ b/tests/utils/helpers.rs @@ -12,6 +12,44 @@ enum WalletAccount { Public(XpubAccount), } +pub enum AllocationFilter { + Stock, + Wallet, + WalletAll, +} + +enum Filter<'w> { + NoWallet, + Wallet(&'w RgbWallet>), + WalletAll(&'w RgbWallet>), +} + +impl<'w> AssignmentsFilter for Filter<'w> { + fn should_include(&self, outpoint: impl Into, id: Option) -> bool { + match self { + Filter::Wallet(wallet) => wallet + .wallet() + .filter_unspent() + .should_include(outpoint, id), + _ => true, + } + } +} +impl<'w> Filter<'w> { + fn comment(&self, outpoint: XOutpoint) -> &'static str { + let outpoint = outpoint + .into_bp() + .into_bitcoin() + .expect("liquid is not yet supported"); + match self { + Filter::Wallet(rgb) if rgb.wallet().is_unspent(outpoint) => "", + Filter::WalletAll(rgb) if rgb.wallet().is_unspent(outpoint) => "-- unspent", + Filter::WalletAll(rgb) if rgb.wallet().has_outpoint(outpoint) => "-- spent", + _ => "-- third-party", + } + } +} + #[derive(Debug, Copy, Clone, PartialEq, Eq)] pub enum DescriptorType { Wpkh, @@ -905,7 +943,7 @@ impl TestWallet { contract_iface: &ContractIface, ) -> Vec { contract_iface - .fungible(fname!("assetOwner"), &self.wallet.wallet().filter()) + .fungible(fname!("assetOwner"), Filter::Wallet(&self.wallet)) .unwrap() .collect() } @@ -915,12 +953,23 @@ impl TestWallet { contract_iface: &ContractIface, ) -> Vec { contract_iface - .data(fname!("assetOwner"), &self.wallet.wallet().filter()) + .data(fname!("assetOwner"), Filter::Wallet(&self.wallet)) .unwrap() .collect() } - pub fn debug_logs(&self, contract_id: ContractId, iface_type_name: &TypeName) { + pub fn debug_logs( + &self, + contract_id: ContractId, + iface_type_name: &TypeName, + filter: AllocationFilter, + ) { + let filter = match filter { + AllocationFilter::WalletAll => Filter::WalletAll(&self.wallet), + AllocationFilter::Wallet => Filter::Wallet(&self.wallet), + AllocationFilter::Stock => Filter::NoWallet, + }; + let contract = self.contract_iface(contract_id, iface_type_name); println!("Global:"); @@ -933,30 +982,60 @@ impl TestWallet { } println!("\nOwned:"); + fn witness( + allocation: &OutputAssignment, + contract: &ContractIface>, + ) -> String { + allocation + .witness + .and_then(|w| contract.witness_info(w)) + .map(|info| format!("{} ({})", info.id, info.ord)) + .unwrap_or_else(|| s!("~")) + } for owned in &contract.iface.assignments { + println!(" State \t{:78}\tWitness", "Seal"); println!(" {}:", owned.name); - if let Ok(allocations) = - contract.fungible(owned.name.clone(), &self.wallet.wallet().filter()) - { + if let Ok(allocations) = contract.fungible(owned.name.clone(), &filter) { for allocation in allocations { println!( - " amount={}, utxo={}, witness={:?} # owned by the wallet", + " {: >9}\t{}\t{} {}", allocation.state.value(), allocation.seal, - allocation.witness + witness(&allocation, &contract), + filter.comment(allocation.seal.to_outpoint()) ); } } - if let Ok(allocations) = contract.fungible( - owned.name.clone(), - &FilterExclude(&self.wallet.wallet().filter()), - ) { + if let Ok(allocations) = contract.data(owned.name.clone(), &filter) { for allocation in allocations { println!( - " amount={}, utxo={}, witness={:?} # owner unknown", - allocation.state.value(), + " {: >9}\t{}\t{} {}", + allocation.state, + allocation.seal, + witness(&allocation, &contract), + filter.comment(allocation.seal.to_outpoint()) + ); + } + } + if let Ok(allocations) = contract.attachments(owned.name.clone(), &filter) { + for allocation in allocations { + println!( + " {: >9}\t{}\t{} {}", + allocation.state, + allocation.seal, + witness(&allocation, &contract), + filter.comment(allocation.seal.to_outpoint()) + ); + } + } + if let Ok(allocations) = contract.rights(owned.name.clone(), &filter) { + for allocation in allocations { + println!( + " {: >9}\t{}\t{} {}", + "right", allocation.seal, - allocation.witness + witness(&allocation, &contract), + filter.comment(allocation.seal.to_outpoint()) ); } } diff --git a/tests/utils/mod.rs b/tests/utils/mod.rs index 136a0f4..7f9aa9b 100644 --- a/tests/utils/mod.rs +++ b/tests/utils/mod.rs @@ -62,6 +62,7 @@ pub use psbt::{ pub use psrgbt::{RgbExt, RgbInExt, RgbPsbt, TxParams}; pub use rand::RngCore; pub use rgb::{ + interface::AssignmentsFilter, invoice::Pay2Vout, persistence::{ContractStateRead, MemContract, MemContractState, Stock}, resolvers::AnyResolver, @@ -83,8 +84,8 @@ pub use rgbstd::{ stl::{ AssetSpec, Attachment, Details, MediaType, Name, ProofOfReserves, RicardianContract, Ticker, }, - Allocation, Amount, ContractId, GlobalStateType, Layer1, Operation, OwnedFraction, Precision, - Schema, TokenIndex, TxoSeal, XChain, + Allocation, Amount, ContractId, GlobalStateType, KnownState, Layer1, Operation, + OutputAssignment, OwnedFraction, Precision, Schema, TokenIndex, TxoSeal, XChain, }; pub use rstest::rstest; pub use schemata::{CollectibleFungibleAsset, NonInflatableAsset, UniqueDigitalAsset}; From 2f8a1e9fab4ca705ae9336eefab053b1b35fd62a Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Tue, 8 Oct 2024 04:27:31 +0000 Subject: [PATCH 4/5] Update to new develop branches with rgb-std/275 fix --- bp-core | 2 +- bp-std | 2 +- bp-wallet | 2 +- rgb | 2 +- rgb-core | 2 +- rgb-interfaces | 2 +- rgb-schemata | 2 +- rgb-std | 2 +- tests/transfers.rs | 2 +- tests/utils/helpers.rs | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/bp-core b/bp-core index 923f728..8f23033 160000 --- a/bp-core +++ b/bp-core @@ -1 +1 @@ -Subproject commit 923f728cefd2682462387e7f16b2967e22860237 +Subproject commit 8f230338300174f2d77c11c2879572a42115b53f diff --git a/bp-std b/bp-std index 6dd564c..eb393cd 160000 --- a/bp-std +++ b/bp-std @@ -1 +1 @@ -Subproject commit 6dd564c90452ad8b358a6f9f3262114227a88d58 +Subproject commit eb393cdb1c234cb76c100cea67b87c0cbc85fab8 diff --git a/bp-wallet b/bp-wallet index f850c3b..a6862d0 160000 --- a/bp-wallet +++ b/bp-wallet @@ -1 +1 @@ -Subproject commit f850c3b3f98e1ade4b720c3c0c6e4799bb3ccb7f +Subproject commit a6862d09db91dc7269111a1269380ce9b91bbe9e diff --git a/rgb b/rgb index 07c55b3..3111cd0 160000 --- a/rgb +++ b/rgb @@ -1 +1 @@ -Subproject commit 07c55b3aff4ba3d0763807ffb92e8e8af72c2ea6 +Subproject commit 3111cd0b3f98ff8b802325ee0739aa32b84b91ec diff --git a/rgb-core b/rgb-core index e2a451f..0450760 160000 --- a/rgb-core +++ b/rgb-core @@ -1 +1 @@ -Subproject commit e2a451fa793fe5403b4114b5ed5e9e47c69674cd +Subproject commit 0450760dbae554de0d7623691aed7630f1b60a60 diff --git a/rgb-interfaces b/rgb-interfaces index 673e970..a2ec738 160000 --- a/rgb-interfaces +++ b/rgb-interfaces @@ -1 +1 @@ -Subproject commit 673e970f5655ac5f7bd577a410ef4ad02bf3f62e +Subproject commit a2ec73876ee02180d04c86e88665f63cc52ab3da diff --git a/rgb-schemata b/rgb-schemata index 954cfd8..a42b9f8 160000 --- a/rgb-schemata +++ b/rgb-schemata @@ -1 +1 @@ -Subproject commit 954cfd867e963f1f4c39eea3067fd2183d26f896 +Subproject commit a42b9f8364e5c7723db72f4ab94525ad02c90a06 diff --git a/rgb-std b/rgb-std index 94b5ebc..08a8c95 160000 --- a/rgb-std +++ b/rgb-std @@ -1 +1 @@ -Subproject commit 94b5ebc6b998b4aa2321513c08b4ff2aebfd2a56 +Subproject commit 08a8c95e675186fb1e99283293c15554f2ff8882 diff --git a/tests/transfers.rs b/tests/transfers.rs index ca9a0aa..e4ba0e5 100644 --- a/tests/transfers.rs +++ b/tests/transfers.rs @@ -771,7 +771,7 @@ fn tapret_wlt_receiving_opret() { TransferType::Blinded, contract_id, &iface_type_name, - 300, + 290, 1000, None, ); diff --git a/tests/utils/helpers.rs b/tests/utils/helpers.rs index 45b004b..e4ef79e 100644 --- a/tests/utils/helpers.rs +++ b/tests/utils/helpers.rs @@ -897,7 +897,7 @@ impl TestWallet { self.sync(); let resolver = self.get_resolver(); let validate_start = Instant::now(); - let validated_consignment = consignment.validate(&resolver, self.testnet()).unwrap(); + let validated_consignment = consignment.validate(&resolver, self.testnet()).map_err(|(status, _)| status).unwrap(); let validate_duration = validate_start.elapsed(); if let Some(report) = report { report.write_duration(validate_duration); From 511e2e08e2c6ae4c76e2524e74824d5a2ee44399 Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sat, 12 Oct 2024 18:25:34 +0000 Subject: [PATCH 5/5] Update to new develop branches with rgb-std/275 fix --- tests/transfers.rs | 2 +- tests/utils/mod.rs | 1 + tests/validation.rs | 12 ++++++------ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/transfers.rs b/tests/transfers.rs index e4ba0e5..bb33278 100644 --- a/tests/transfers.rs +++ b/tests/transfers.rs @@ -793,7 +793,7 @@ fn tapret_wlt_receiving_opret() { TransferType::Blinded, contract_id, &iface_type_name, - 600, + 570, 1000, None, ); diff --git a/tests/utils/mod.rs b/tests/utils/mod.rs index 7f9aa9b..8203483 100644 --- a/tests/utils/mod.rs +++ b/tests/utils/mod.rs @@ -21,6 +21,7 @@ pub use std::{ fmt::{self, Display}, fs::OpenOptions, io::Write, + num::NonZeroU32, path::{PathBuf, MAIN_SEPARATOR}, process::{Command, Stdio}, str::FromStr, diff --git a/tests/validation.rs b/tests/validation.rs index c43df13..4fb7f19 100644 --- a/tests/validation.rs +++ b/tests/validation.rs @@ -76,9 +76,9 @@ impl Scenario { witness_id_3 => MockResolvePubWitness::Success(tx_3), ], pub_witness_ords: map![ - witness_id_1 => MockResolvePubWitnessOrd::Success(WitnessOrd::Mined(WitnessPos::new(106, 1726062111).unwrap())), - witness_id_2 => MockResolvePubWitnessOrd::Success(WitnessOrd::Mined(WitnessPos::new(108, 1726062111).unwrap())), - witness_id_3 => MockResolvePubWitnessOrd::Success(WitnessOrd::Mined(WitnessPos::new(110, 1726062112).unwrap())), + witness_id_1 => MockResolvePubWitnessOrd::Success(WitnessOrd::Mined(WitnessPos::bitcoin(NonZeroU32::new(106).unwrap(), 1726062111).unwrap())), + witness_id_2 => MockResolvePubWitnessOrd::Success(WitnessOrd::Mined(WitnessPos::bitcoin(NonZeroU32::new(108).unwrap(), 1726062111).unwrap())), + witness_id_3 => MockResolvePubWitnessOrd::Success(WitnessOrd::Mined(WitnessPos::bitcoin(NonZeroU32::new(110).unwrap(), 1726062112).unwrap())), ], } } @@ -96,9 +96,9 @@ impl Scenario { witness_id_3 => MockResolvePubWitness::Success(tx_3), ], pub_witness_ords: map![ - witness_id_1 => MockResolvePubWitnessOrd::Success(WitnessOrd::Mined(WitnessPos::new(105, 1726062423).unwrap())), - witness_id_2 => MockResolvePubWitnessOrd::Success(WitnessOrd::Mined(WitnessPos::new(106, 1726062423).unwrap())), - witness_id_3 => MockResolvePubWitnessOrd::Success(WitnessOrd::Mined(WitnessPos::new(106, 1726062423).unwrap())), + witness_id_1 => MockResolvePubWitnessOrd::Success(WitnessOrd::Mined(WitnessPos::bitcoin(NonZeroU32::new(105).unwrap(), 1726062423).unwrap())), + witness_id_2 => MockResolvePubWitnessOrd::Success(WitnessOrd::Mined(WitnessPos::bitcoin(NonZeroU32::new(106).unwrap(), 1726062423).unwrap())), + witness_id_3 => MockResolvePubWitnessOrd::Success(WitnessOrd::Mined(WitnessPos::bitcoin(NonZeroU32::new(106).unwrap(), 1726062423).unwrap())), ], } }