Skip to content

Commit

Permalink
feat: updated issue comments for the new allocation amount behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexMCon committed Apr 1, 2024
1 parent 49ff983 commit 12abd3c
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 15 deletions.
6 changes: 3 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion fplus-database/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "fplus-database"
authors = ["clriesco", "kokal33", "alexmcon"]
version = "1.7.4"
version = "1.7.5"
edition = "2021"
description = "FPlus main database module"
license = "MIT OR Apache-2.0"
Expand Down
8 changes: 4 additions & 4 deletions fplus-database/src/database/allocators.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ pub async fn create_or_update_allocator(
allocator_active_model.multisig_threshold = Set(multisig_threshold);
}

if allocation_amount_type.is_some() {
allocator_active_model.allocation_amount_type = Set(allocation_amount_type);
if let Some(allocation_amount_type) = allocation_amount_type {
allocator_active_model.allocation_amount_type = Set(Some(allocation_amount_type.to_lowercase()));
} else {
allocator_active_model.allocation_amount_type = Set(None);
}
Expand Down Expand Up @@ -164,8 +164,8 @@ pub async fn create_or_update_allocator(
new_allocator.multisig_threshold = Set(multisig_threshold);
}

if allocation_amount_type.is_some() {
new_allocator.allocation_amount_type = Set(allocation_amount_type);
if let Some(allocation_amount_type) = allocation_amount_type {
new_allocator.allocation_amount_type = Set(Some(allocation_amount_type.to_lowercase()));
} else {
new_allocator.allocation_amount_type = Set(None);
}
Expand Down
2 changes: 1 addition & 1 deletion fplus-http-server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "fplus-http-server"
authors = ["jbesraa", "kokal33", "clriesco"]
version = "1.7.4"
version = "1.7.5"
description = "FPlus main http module"
license = "MIT OR Apache-2.0"
edition = "2021"
Expand Down
2 changes: 1 addition & 1 deletion fplus-http-server/src/router/allocator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ pub async fn create_from_json(files: web::Json<ChangedAllocators>) -> actix_web:
break;
}

let amount_type = allocation_amount.amount_type.clone().unwrap(); // Assuming you still want to unwrap here
let amount_type = allocation_amount.amount_type.clone().unwrap().to_lowercase(); // Assuming you still want to unwrap here
let quantity_options = allocation_amount.quantity_options.unwrap(); // Assuming unwrap is desired

match validate_amount_type_and_options(&amount_type, &quantity_options) {
Expand Down
4 changes: 2 additions & 2 deletions fplus-lib/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "fplus-lib"
authors = ["jbesraa", "kokal33", "clriesco"]
version = "1.7.4"
version = "1.7.5"
edition = "2021"
description = "FPlus library/helper files"
license = "MIT OR Apache-2.0"
Expand Down Expand Up @@ -30,6 +30,6 @@ uuidv4 = "1.0.0"
rayon = "1.8.0"
log = "0.4.20"
once_cell = "1.19.0"
fplus-database = { path = "../fplus-database", version = "1.7.4"}
fplus-database = { path = "../fplus-database", version = "1.7.5"}
pem = "1.0"
anyhow = "1.0"
15 changes: 12 additions & 3 deletions fplus-lib/src/core/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ use fplus_database::database::allocation_amounts::get_allocation_quantity_option

use fplus_database::models::applications::Model as ApplicationModel;

use self::application::file::{
use self::application::{allocation, file::{
AllocationRequest, AllocationRequestType, AppState, ApplicationFile, ValidVerifierList,
VerifierInput,
};
}};
use crate::core::application::file::Allocation;
use std::collections::HashSet;

Expand Down Expand Up @@ -1871,6 +1871,12 @@ impl LDNApplication {
let client_address = application_file.lifecycle.client_on_chain_address.clone();
let total_requested = application_file.datacap.total_requested_amount.clone();
let weekly_allocation = application_file.datacap.weekly_allocation.clone();
let allocation_amount = application_file
.allocation
.0
.iter()
.find(|obj| Some(&obj.id) == application_file.lifecycle.active_request.as_ref()).unwrap().amount.clone();


let issue_number = application_file.issue_number.clone();

Expand All @@ -1882,9 +1888,12 @@ impl LDNApplication {
**Expected weekly DataCap usage rate**
> {}
**DataCap Amount - First Tranche**
> {}
**Client address**
> {}",
total_requested, weekly_allocation, client_address
total_requested, weekly_allocation, allocation_amount, client_address
);

gh.add_comment_to_issue(issue_number.parse().unwrap(), &comment)
Expand Down

0 comments on commit 12abd3c

Please sign in to comment.