Closed monaka closed 1 year ago
I tried to shoot this issue. And it works well auto-magically.
This may be a flaky test.
I'm not sure but I think bdk_wallet
inside may be related to this issue.
I'll re-open this if I cloud find how to reproduce.
Same issue again.
I patched my fork like this.
diff --git a/src/wallet/mod.rs b/src/wallet/mod.rs
index eeb9b22..68a5572 100644
--- a/src/wallet/mod.rs
+++ b/src/wallet/mod.rs
@@ -1085,11 +1085,25 @@ impl Wallet {
let unsigned_psbt = self.create_utxos_begin(online.clone(), up_to, num, size)?;
- let mut psbt =
+ /*
+ * let mut psbt =
PartiallySignedTransaction::from_str(&unsigned_psbt).map_err(InternalError::from)?;
+
self.bdk_wallet
.sign(&mut psbt, SignOptions::default())
.map_err(InternalError::from)?;
+*/
+ let mut psbt =
+ match PartiallySignedTransaction::from_str(&unsigned_psbt) {
+ Ok(psbt) => psbt,
+ Err(err) => panic!("{}", err),
+ };
+
+ match self.bdk_wallet
+ .sign(&mut psbt, SignOptions::default()) {
+ Ok(_) => (),
+ Err(err) => panic!("{}", err),
+ }
self.create_utxos_end(online, psbt.to_string())
}
@@ -1185,10 +1199,17 @@ impl Wallet {
let tx = self._broadcast_psbt(signed_psbt)?;
let mut num_utxos_created = 0;
- let bdk_utxos: Vec<LocalUtxo> = self
+ /*let bdk_utxos: Vec<LocalUtxo> = self
.bdk_wallet
.list_unspent()
.map_err(InternalError::from)?;
+ */
+ let bdk_utxos: Vec<LocalUtxo> = match self
+ .bdk_wallet
+ .list_unspent() {
+ Ok(bdk_utxos) => bdk_utxos,
+ Err(err) => panic!("{}", err),
+ };
for utxo in bdk_utxos.into_iter() {
let db_txo = self
.database
The log was unchanged.
Even though I expected the panic was raised in similar places that call .map_err
.
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Internal(Unexpected)', src/wallet/utxos.rs:29:89
The log from rgb-lib is this:
2022-12-16T09:54:31.318+00 INFO[/home/monaka/.cargo/git/checkouts/rgb-lib-f556c579d2c2f978/e3bdee1/src/wallet/mod.rs:697:9] Creating wallet in '"/tmp/shiro-wallet/60ec7707"'
2022-12-16T09:54:31.424+00 INFO[/home/monaka/.cargo/git/checkouts/rgb-lib-f556c579d2c2f978/e3bdee1/src/wallet/mod.rs:1083:9] Creating UTXOs...
2022-12-16T09:54:31.424+00 INFO[/home/monaka/.cargo/git/checkouts/rgb-lib-f556c579d2c2f978/e3bdee1/src/wallet/mod.rs:1136:9] Creating UTXOs (begin)...
2022-12-16T09:54:31.425+00 DEBG[/home/monaka/.cargo/git/checkouts/rgb-lib-f556c579d2c2f978/e3bdee1/src/wallet/mod.rs:813:9] Syncing TXOs...
An unexpected something happens in create_utxos_begin()
before "Will try to create {} UTXOs"
.
Ah, I see. I'm not using the library as expected. And the Wallet object doesn't provide a feature that I expected now... Hmm...
I close this issue and will submit another feature request with short sample code.
Thanks,
Hello,
I got a
panicked
message in my test. The value ofErr
isInternal(Unexpected)
so it's hard to see the root cause for me. Could you give me any hints to shooting this issue?Best,
The short log is here:
The line 29-31 of
src/wallet/utxos.rs
is:The funtion
_utxos
is:The value of arguments are:
Online { id: 1671158668380951623, electrum_url: "127.0.0.1:50001", proxy_url: "http://proxy.rgbtools.org" }
UtxosParams { up_to: true, num: Some(3), size: None }
Containers for debugging are: