From dea36255bf62b893ad9acf8f42b2e1aad94fe5f1 Mon Sep 17 00:00:00 2001 From: cylewitruk Date: Wed, 5 Feb 2025 23:55:57 +0100 Subject: [PATCH] confused merge tool --- signer/src/transaction_signer.rs | 40 ++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/signer/src/transaction_signer.rs b/signer/src/transaction_signer.rs index 5a9e1dcf4..c140b4101 100644 --- a/signer/src/transaction_signer.rs +++ b/signer/src/transaction_signer.rs @@ -992,6 +992,46 @@ where Ok(()) } + // Backported from the feat/mock-signing due to confused merge tool + #[allow(dead_code)] + async fn create_frost_coordinator( + storage: &S, + aggregate_key: PublicKeyXOnly, + signer_private_key: PrivateKey, + ) -> Result + where + S: DbRead + Send + Sync, + { + let dkg_shares = storage + .get_encrypted_dkg_shares(aggregate_key) + .await? + .ok_or_else(|| { + tracing::warn!("🔐 no DKG shares found for requested aggregate key"); + Error::MissingDkgShares(aggregate_key) + })?; + + let signing_set: BTreeSet = dkg_shares + .signer_set_public_keys + .into_iter() + .collect::>(); + + tracing::debug!( + num_signers = signing_set.len(), + %aggregate_key, + threshold = %dkg_shares.signature_share_threshold, + "🔐 creating now frost coordinator to track pre-rotate-key validation signing round" + ); + + FrostCoordinator::load( + storage, + aggregate_key, + signing_set, + dkg_shares.signature_share_threshold, + signer_private_key, + ) + .await + } + /// Ensures that a DKG verification state machine exists for the given /// aggregate key and bitcoin chain tip block hash. If the state machine /// exists already then the id is simply returned back; otherwise, a new