File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -180,7 +180,7 @@ pub async fn provisioner_init(
180180 // 5) If we have enough shares, finish initialization: combine shares & set config
181181 if current_share_count >= threshold {
182182 let shares_vec: Vec < Share > = received_shares. iter ( ) . cloned ( ) . collect ( ) ;
183- finalize_init ( & shares_vec, & enclave, request. into_state ( ) ) . await ;
183+ finalize_init ( & shares_vec, threshold , & enclave, request. into_state ( ) ) . await ;
184184 // Log to S3 indicating that withdrawals can be expected henceforth
185185 enclave
186186 . log_init ( PIEnclaveFullyInitialized )
@@ -201,14 +201,11 @@ pub async fn provisioner_init(
201201/// Panics upon an error as the enclaves state is irrecoverable at this point.
202202async fn finalize_init (
203203 shares : & [ Share ] ,
204+ threshold : usize ,
204205 enclave : & Arc < Enclave > ,
205206 incoming_state : ProvisionerInitState ,
206207) {
207208 info ! ( "Threshold reached, combining shares." ) ;
208- let threshold = enclave
209- . secret_sharing_config ( )
210- . expect ( "secret sharing config set during operator_init" )
211- . threshold ( ) ;
212209 let enclave_btc_keypair = combine_shares ( shares, threshold) . expect ( "Unable to combine shares" ) ;
213210
214211 info ! ( "Setting enclave keypair." ) ;
Original file line number Diff line number Diff line change @@ -26,9 +26,6 @@ use super::StandardWithdrawalResponse;
2626use super :: WithdrawalConfig ;
2727use super :: WithdrawalID ;
2828
29- // Default secret-sharing params used by mock_for_testing helpers.
30- const TEST_N : usize = 5 ;
31- const TEST_T : usize = 3 ;
3229use super :: bitcoin_utils:: BTC_LIB ;
3330use super :: bitcoin_utils:: InputUTXO ;
3431use super :: bitcoin_utils:: OutputUTXO ;
@@ -56,6 +53,10 @@ use crate::committee::DEFAULT_MPC_MAX_FAULTY_IN_BASIS_POINTS;
5653use crate :: committee:: DEFAULT_MPC_THRESHOLD_IN_BASIS_POINTS ;
5754use crate :: committee:: DEFAULT_MPC_WEIGHT_REDUCTION_ALLOWED_DELTA ;
5855
56+ // Default secret-sharing params used by mock_for_testing helpers.
57+ const TEST_N : usize = 5 ;
58+ const TEST_T : usize = 3 ;
59+
5960// -------------------------------
6061// Shared deterministic test values
6162// -------------------------------
You can’t perform that action at this time.
0 commit comments