fix(wallet): LoadError::MissingDescriptor
includes the missing KeychainKind
This commit is contained in:
parent
412dee1f5b
commit
8bc3d35f6c
@ -242,7 +242,7 @@ pub enum LoadError {
|
|||||||
/// Data loaded from persistence is missing genesis hash.
|
/// Data loaded from persistence is missing genesis hash.
|
||||||
MissingGenesis,
|
MissingGenesis,
|
||||||
/// Data loaded from persistence is missing descriptor.
|
/// Data loaded from persistence is missing descriptor.
|
||||||
MissingDescriptor,
|
MissingDescriptor(KeychainKind),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl fmt::Display for LoadError {
|
impl fmt::Display for LoadError {
|
||||||
@ -255,7 +255,9 @@ impl fmt::Display for LoadError {
|
|||||||
}
|
}
|
||||||
LoadError::MissingNetwork => write!(f, "loaded data is missing network type"),
|
LoadError::MissingNetwork => write!(f, "loaded data is missing network type"),
|
||||||
LoadError::MissingGenesis => write!(f, "loaded data is missing genesis hash"),
|
LoadError::MissingGenesis => write!(f, "loaded data is missing genesis hash"),
|
||||||
LoadError::MissingDescriptor => write!(f, "loaded data is missing descriptor"),
|
LoadError::MissingDescriptor(k) => {
|
||||||
|
write!(f, "loaded data is missing descriptor for keychain {k:?}")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -517,14 +519,14 @@ impl Wallet {
|
|||||||
.indexer
|
.indexer
|
||||||
.keychains_added
|
.keychains_added
|
||||||
.get(&KeychainKind::External)
|
.get(&KeychainKind::External)
|
||||||
.ok_or(LoadError::MissingDescriptor)?
|
.ok_or(LoadError::MissingDescriptor(KeychainKind::External))?
|
||||||
.clone();
|
.clone();
|
||||||
let change_descriptor = changeset
|
let change_descriptor = changeset
|
||||||
.indexed_tx_graph
|
.indexed_tx_graph
|
||||||
.indexer
|
.indexer
|
||||||
.keychains_added
|
.keychains_added
|
||||||
.get(&KeychainKind::Internal)
|
.get(&KeychainKind::Internal)
|
||||||
.ok_or(LoadError::MissingDescriptor)?
|
.ok_or(LoadError::MissingDescriptor(KeychainKind::Internal))?
|
||||||
.clone();
|
.clone();
|
||||||
|
|
||||||
let (signers, change_signers) =
|
let (signers, change_signers) =
|
||||||
@ -596,10 +598,12 @@ impl Wallet {
|
|||||||
expected: genesis_hash,
|
expected: genesis_hash,
|
||||||
got: None,
|
got: None,
|
||||||
},
|
},
|
||||||
LoadError::MissingDescriptor => NewOrLoadError::LoadedDescriptorDoesNotMatch {
|
LoadError::MissingDescriptor(keychain) => {
|
||||||
got: None,
|
NewOrLoadError::LoadedDescriptorDoesNotMatch {
|
||||||
keychain: KeychainKind::External,
|
got: None,
|
||||||
},
|
keychain,
|
||||||
|
}
|
||||||
|
}
|
||||||
})?;
|
})?;
|
||||||
if wallet.network != network {
|
if wallet.network != network {
|
||||||
return Err(NewOrLoadError::LoadedNetworkDoesNotMatch {
|
return Err(NewOrLoadError::LoadedNetworkDoesNotMatch {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user