From 1b4ba34b4b8e8b9b0643857e7f5d038b68f0e448 Mon Sep 17 00:00:00 2001 From: DJO <790521+Alenar@users.noreply.github.com> Date: Tue, 12 Jul 2022 10:04:50 +0200 Subject: [PATCH] Signer: init protocol initializer earlier So its computed even if an error occur later in the compute signature process. --- mithril-signer/src/single_signer.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mithril-signer/src/single_signer.rs b/mithril-signer/src/single_signer.rs index ce604d7345d..4258f475996 100644 --- a/mithril-signer/src/single_signer.rs +++ b/mithril-signer/src/single_signer.rs @@ -140,6 +140,8 @@ impl SingleSigner for MithrilSingleSigner { stakes: Vec, // TODO : use a hmap to prevent party id duplication protocol_parameters: &entities::ProtocolParameters, ) -> Result, SingleSignerError> { + self.init_protocol_initializer(&stakes, protocol_parameters)?; + let current_signer_with_stake = stakes .iter() .find(|s| s.party_id == self.party_id) @@ -153,8 +155,6 @@ impl SingleSigner for MithrilSingleSigner { } } - self.init_protocol_initializer(&stakes, protocol_parameters)?; - let protocol_signer = self.create_protocol_signer(&stakes)?; trace!(