Skip to content

Commit

Permalink
Update application when threshold 1 (#239)
Browse files Browse the repository at this point in the history
Co-authored-by: Filip Lelek <[email protected]>
  • Loading branch information
Filip-L and filip-neti authored Oct 31, 2024
1 parent 95796ad commit e91a116
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions fplus-lib/src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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(),
Expand All @@ -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 {
Expand Down

0 comments on commit e91a116

Please sign in to comment.