From e91a116ea409834968978bf0dc78f620edd5fca5 Mon Sep 17 00:00:00 2001 From: Filip-L <67787091+Filip-L@users.noreply.github.com> Date: Thu, 31 Oct 2024 11:36:36 +0100 Subject: [PATCH] Update application when threshold 1 (#239) Co-authored-by: Filip Lelek --- fplus-lib/src/core/mod.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/fplus-lib/src/core/mod.rs b/fplus-lib/src/core/mod.rs index 6bd30b4..9775241 100644 --- a/fplus-lib/src/core/mod.rs +++ b/fplus-lib/src/core/mod.rs @@ -1219,7 +1219,7 @@ impl LDNApplication { SpsChangeRequest::new(&request_id, allowed_sps, max_deviation, &signer, false); if let Some(active_allocation) = app_file.allocation.active() { app_state = AppState::ReadyToSign; - app_file.handle_changing_sps_request( + app_file = app_file.handle_changing_sps_request( &signer.github_username, &sps_change_request, &app_state, @@ -1228,7 +1228,7 @@ impl LDNApplication { } else { app_state = AppState::Granted; let request_id = uuidv4::uuid::v4(); - app_file.handle_changing_sps_request( + app_file = app_file.handle_changing_sps_request( &signer.github_username, &sps_change_request, &app_state, @@ -1250,6 +1250,12 @@ impl LDNApplication { "Application is in the Changing Storage Providers state. Waiting for approval."; } + let commit_message = if threshold_to_use < 2 { + "Update Storage Providers".to_string() + } else { + "Start signing allowed storage providers".to_string() + }; + if app_state_before_change == AppState::ReadyToSign { self.update_and_commit_application_state( app_file.clone(), @@ -1258,7 +1264,7 @@ impl LDNApplication { self.file_sha.clone(), self.branch_name.clone(), self.file_name.clone(), - "Start signing allowed storage providers".to_string(), + commit_message, ) .await?; } else {