Skip to content

Commit 3249885

Browse files
committed
update rgb-lib to 0.3.0-beta.5
1 parent d42a92c commit 3249885

3 files changed

Lines changed: 25 additions & 38 deletions

File tree

lightning-invoice/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ serde = { version = "1.0", optional = true, default-features = false, features =
2424
bitcoin = { version = "0.32.2", default-features = false, features = ["secp-recovery"] }
2525

2626
# RGB and related
27-
rgb-lib = { version = "0.3.0-beta.4", features = [
27+
rgb-lib = { version = "0.3.0-beta.5", features = [
2828
"electrum",
2929
"esplora",
3030
] }

lightning/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ inventory = { version = "0.3", optional = true }
5252

5353
# RGB and related
5454
futures = "0.3"
55-
rgb-lib = { version = "0.3.0-beta.4", features = [
55+
rgb-lib = { version = "0.3.0-beta.5", features = [
5656
"electrum",
5757
"esplora",
5858
] }

lightning/src/rgb_utils/mod.rs

Lines changed: 23 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ use rgb_lib::{
2121
bitcoin::psbt::Psbt as RgbLibPsbt,
2222
wallet::{
2323
rust_only::{AssetColoringInfo, ColoringInfo},
24-
DatabaseType, WalletData,
24+
DatabaseType, SinglesigKeys, Wallet, WalletData,
2525
},
2626
AssetSchema, Assignment, BitcoinNetwork, ConsignmentExt, ContractId, Error as RgbLibError,
27-
FileContent, RgbTransfer, RgbTransport, RgbTxid, Wallet, WitnessOrd,
27+
FileContent, RgbTransfer, RgbTransport, WitnessOrd,
2828
};
2929
use serde::{Deserialize, Serialize};
3030
use tokio::runtime::Handle;
@@ -153,23 +153,28 @@ fn _new_rgb_wallet(
153153
data_dir: String, bitcoin_network: BitcoinNetwork, account_xpub_vanilla: String,
154154
account_xpub_colored: String, master_fingerprint: String,
155155
) -> Wallet {
156-
Wallet::new(WalletData {
157-
data_dir,
158-
bitcoin_network,
159-
database_type: DatabaseType::Sqlite,
160-
max_allocations_per_utxo: 1,
156+
let keys = SinglesigKeys {
161157
account_xpub_vanilla,
162158
account_xpub_colored,
159+
vanilla_keychain: None,
163160
master_fingerprint,
164161
mnemonic: None,
165-
vanilla_keychain: None,
166-
supported_schemas: vec![
167-
AssetSchema::Nia,
168-
AssetSchema::Cfa,
169-
AssetSchema::Uda,
170-
AssetSchema::Ifa,
171-
],
172-
})
162+
};
163+
Wallet::new(
164+
WalletData {
165+
data_dir,
166+
bitcoin_network,
167+
database_type: DatabaseType::Sqlite,
168+
max_allocations_per_utxo: 1,
169+
supported_schemas: vec![
170+
AssetSchema::Nia,
171+
AssetSchema::Cfa,
172+
AssetSchema::Uda,
173+
AssetSchema::Ifa,
174+
],
175+
},
176+
keys,
177+
)
173178
.expect("valid rgb-lib wallet")
174179
}
175180

@@ -399,13 +404,7 @@ where
399404
let txid = modified_tx.compute_txid();
400405
commitment_transaction.built = BuiltCommitmentTransaction { transaction: modified_tx, txid };
401406

402-
wallet
403-
.consume_fascia(
404-
fascia.clone(),
405-
RgbTxid::from_str(&txid.to_string()).unwrap(),
406-
Some(WitnessOrd::Ignored),
407-
)
408-
.unwrap();
407+
wallet.consume_fascia(fascia.clone(), Some(WitnessOrd::Ignored)).unwrap();
409408

410409
// save RGB transfer data to disk
411410
let rgb_amount = if counterparty {
@@ -459,13 +458,7 @@ pub(crate) fn color_htlc(
459458
};
460459
let txid = &modified_tx.compute_txid();
461460

462-
wallet
463-
.consume_fascia(
464-
fascia.clone(),
465-
RgbTxid::from_str(&txid.to_string()).unwrap(),
466-
Some(WitnessOrd::Ignored),
467-
)
468-
.unwrap();
461+
wallet.consume_fascia(fascia.clone(), Some(WitnessOrd::Ignored)).unwrap();
469462

470463
// save RGB transfer data to disk
471464
let transfer_info = TransferInfo { contract_id, rgb_amount: htlc_amount_rgb };
@@ -530,13 +523,7 @@ pub(crate) fn color_closing(
530523
let txid = &modified_tx.compute_txid();
531524
closing_transaction.built = modified_tx;
532525

533-
wallet
534-
.consume_fascia(
535-
fascia.clone(),
536-
RgbTxid::from_str(&txid.to_string()).unwrap(),
537-
Some(WitnessOrd::Ignored),
538-
)
539-
.unwrap();
526+
wallet.consume_fascia(fascia.clone(), Some(WitnessOrd::Ignored)).unwrap();
540527

541528
// save RGB transfer data to disk
542529
let transfer_info = TransferInfo { contract_id, rgb_amount: holder_vout_amount };

0 commit comments

Comments
 (0)