Skip to content

Commit f271794

Browse files
authored
Merge branch 'develop' into feat/naka-miner-heuristics
2 parents 91d6473 + 9c90c5c commit f271794

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

stacks-signer/src/config.rs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -288,21 +288,11 @@ impl TryFrom<RawConfigFile> for GlobalConfig {
288288
ConfigError::BadField("endpoint".to_string(), raw_data.endpoint.clone())
289289
})?;
290290

291-
let stacks_private_key =
292-
StacksPrivateKey::from_hex(&raw_data.stacks_private_key).map_err(|_| {
293-
ConfigError::BadField(
294-
"stacks_private_key".to_string(),
295-
raw_data.stacks_private_key.clone(),
296-
)
297-
})?;
291+
let stacks_private_key = StacksPrivateKey::from_hex(&raw_data.stacks_private_key)
292+
.map_err(|e| ConfigError::BadField("stacks_private_key".to_string(), e.into()))?;
298293

299-
let ecdsa_private_key =
300-
Scalar::try_from(&stacks_private_key.to_bytes()[..32]).map_err(|_| {
301-
ConfigError::BadField(
302-
"stacks_private_key".to_string(),
303-
raw_data.stacks_private_key.clone(),
304-
)
305-
})?;
294+
let ecdsa_private_key = Scalar::try_from(&stacks_private_key.to_bytes()[..32])
295+
.map_err(|e| ConfigError::BadField("stacks_private_key".to_string(), e.to_string()))?;
306296
let stacks_public_key = StacksPublicKey::from_private(&stacks_private_key);
307297
let signer_hash = Hash160::from_data(stacks_public_key.to_bytes_compressed().as_slice());
308298
let stacks_address =

0 commit comments

Comments
 (0)