Skip to content

Commit b0a312f

Browse files
committed
fixup! feat!: modify Wallet struct to hold KeyRing
1 parent 5585497 commit b0a312f

2 files changed

Lines changed: 0 additions & 25 deletions

File tree

src/wallet/error.rs

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ pub enum LoadError<K> {
2929
MissingGenesis,
3030
/// Data is missing the network.
3131
MissingNetwork,
32-
/// The default keychain is missing.
33-
MissingDefaultKeychain,
3432
/// The keychain is missing,
3533
MissingKeychain(K),
3634
/// There was a problem with the passed-in descriptor(s).
@@ -60,13 +58,6 @@ pub enum LoadError<K> {
6058
/// The expected descriptor
6159
expected: Box<ExtendedDescriptor>,
6260
},
63-
/// The default keychain is not as expected
64-
DefaultKeychainMismatch {
65-
/// The loaded default keychain
66-
loaded: K,
67-
/// The expected default keychain
68-
expected: K,
69-
},
7061
}
7162

7263
impl<K> Display for LoadError<K>
@@ -80,9 +71,6 @@ where
8071
LoadError::MissingKeychain(keychain) => {
8172
write!(f, "loaded data does not contain the keychain {keychain}")
8273
}
83-
LoadError::MissingDefaultKeychain => {
84-
write!(f, "loaded data is missing the default keychain")
85-
}
8674
LoadError::InvalidKeyRing(err) => write!(f, "{err}"),
8775
LoadError::EmptyKeyring => write!(f, "Loaded keyring is empty"),
8876
LoadError::GenesisMismatch { loaded, expected } => write!(
@@ -109,11 +97,6 @@ where
10997
keychain, loaded, expected,
11098
)
11199
}
112-
LoadError::DefaultKeychainMismatch { loaded, expected } => write!(
113-
f,
114-
"Default keychain mismatch: loaded {}, expected {}",
115-
expected, loaded
116-
),
117100
}
118101
}
119102
}

src/wallet/params.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ pub struct LoadParams<K> {
183183
pub(crate) check_genesis_hash: Option<BlockHash>,
184184
pub(crate) check_descs: BTreeMap<K, Option<DescriptorToExtract>>, /* none means just check
185185
* keychain is there */
186-
pub(crate) check_default: Option<K>,
187186
pub(crate) use_spk_cache: bool,
188187
}
189188

@@ -200,7 +199,6 @@ where
200199
check_network: None,
201200
check_genesis_hash: None,
202201
check_descs: BTreeMap::new(),
203-
check_default: None,
204202
use_spk_cache: false,
205203
}
206204
}
@@ -216,12 +214,6 @@ where
216214
self
217215
}
218216

219-
/// Checks that the given keychain is loaded from persistence as the default keychain
220-
pub fn check_default(mut self, default_keychain: K) -> Self {
221-
self.check_default = Some(default_keychain);
222-
self
223-
}
224-
225217
/// Checks that the given network matches the one loaded from persistence.
226218
pub fn check_network(mut self, network: Network) -> Self {
227219
self.check_network = Some(network);

0 commit comments

Comments
 (0)