Skip to content

Commit 79e7d4c

Browse files
authored
Allow triggering refill even if less than 75% of the DataCap was used (#277)
1 parent fe8ca67 commit 79e7d4c

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

fplus-http-server/src/main.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,6 @@ async fn main() -> std::io::Result<()> {
107107
.service(router::application::delete_branch)
108108
.service(router::application::cache_renewal)
109109
.service(router::application::update_from_issue)
110-
.service(router::application::trigger_ssa)
111110
.service(router::application::submit_kyc)
112111
.service(router::blockchain::address_allowance)
113112
.service(router::blockchain::verified_clients)

fplus-lib/src/core/mod.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ pub struct CreateApplicationInfo {
7878
pub struct TriggerSSAInfo {
7979
pub amount: String,
8080
pub amount_type: String,
81+
pub early_refill_comment: Option<String>,
8182
}
8283

8384
#[derive(Deserialize)]
@@ -158,6 +159,7 @@ pub struct RefillInfo {
158159
pub amount_type: String,
159160
pub owner: String,
160161
pub repo: String,
162+
pub early_refill_comment: Option<String>,
161163
}
162164

163165
#[derive(Deserialize)]
@@ -1900,6 +1902,7 @@ impl LDNApplication {
19001902
app.file.issue_number.clone(),
19011903
refill_info.owner.clone(),
19021904
refill_info.repo.clone(),
1905+
refill_info.early_refill_comment,
19031906
)
19041907
.await?;
19051908

@@ -3631,6 +3634,7 @@ Your Datacap Allocation Request has been {} by the Notary
36313634
issue_number: String,
36323635
owner: String,
36333636
repo: String,
3637+
early_refill_comment: Option<String>,
36343638
) -> Result<bool, LDNError> {
36353639
Self::add_comment_to_issue(
36363640
issue_number.clone(),
@@ -3639,6 +3643,15 @@ Your Datacap Allocation Request has been {} by the Notary
36393643
"Application is in Refill".to_string(),
36403644
)
36413645
.await?;
3646+
if let Some(early_refill_comment) = early_refill_comment {
3647+
Self::add_comment_to_issue(
3648+
issue_number.clone(),
3649+
owner.clone(),
3650+
repo.clone(),
3651+
format!("## Reason for triggering a new allocation despite 75% of the previous one not being utilized\n {}", early_refill_comment),
3652+
)
3653+
.await?;
3654+
}
36423655
Self::update_issue_labels(issue_number, &["Refill"], owner, repo).await?;
36433656
Ok(true)
36443657
}
@@ -4431,6 +4444,7 @@ _The initial issue can be edited in order to solve the request of the verifier.
44314444
amount_type: info.amount_type,
44324445
owner: app_model.owner,
44334446
repo: app_model.repo,
4447+
early_refill_comment: info.early_refill_comment,
44344448
};
44354449
Self::refill(verifier, refill_info).await?;
44364450
Ok(())

0 commit comments

Comments
 (0)