being VERY explicit about loading coconut keys

This commit is contained in:
Jędrzej Stuczyński
2023-12-14 10:09:52 +00:00
parent 556d980c01
commit 2cc99b486e
2 changed files with 16 additions and 8 deletions
+8 -8
View File
@@ -57,14 +57,14 @@ impl<R: RngCore + CryptoRng + Clone> DkgController<R> {
&config.storage_paths.decryption_key_path,
&config.storage_paths.public_key_with_proof_path,
))?;
if let Ok(coconut_keypair_value) =
nym_pemstore::load_keypair(&nym_pemstore::KeyPairPath::new(
&config.storage_paths.secret_key_path,
&config.storage_paths.verification_key_path,
))
{
coconut_keypair.set(Some(coconut_keypair_value)).await;
}
// if let Ok(coconut_keypair_value) =
// nym_pemstore::load_keypair(&nym_pemstore::KeyPairPath::new(
// &config.storage_paths.secret_key_path,
// &config.storage_paths.verification_key_path,
// ))
// {
// coconut_keypair.set(Some(coconut_keypair_value)).await;
// }
let persistent_state =
PersistentState::load_from_file(&config.storage_paths.dkg_persistent_state_path)
.unwrap_or_default();
+8
View File
@@ -80,6 +80,14 @@ async fn start_nym_api_tasks(
let network_details = NetworkDetails::new(connected_nyxd.to_string(), nym_network_details);
let coconut_keypair = coconut::keypair::KeyPair::new();
let keys = nym_pemstore::load_keypair(&nym_pemstore::KeyPairPath::new(
&config.coconut_signer.storage_paths.secret_key_path,
&config.coconut_signer.storage_paths.verification_key_path,
))
.expect("failed to load coconut keys");
coconut_keypair.set(Some(keys)).await;
info!("set coconut keys");
// let's build our rocket!
let rocket = http::setup_rocket(