diff --git a/fplus-http-server/src/router/application.rs b/fplus-http-server/src/router/application.rs index d55f8c5..f8f39e2 100644 --- a/fplus-http-server/src/router/application.rs +++ b/fplus-http-server/src/router/application.rs @@ -1,6 +1,6 @@ use actix_web::{get, post, web, HttpResponse, Responder}; use fplus_lib::core::{ - application::file::{StorageProviderChangeVerifier, VerifierInput}, + application::file::{StorageProviderChangeVerifier, VerifierGrantDataCapCids, VerifierInput}, ApplicationQueryParams, BranchDeleteInfo, CompleteGovernanceReviewInfo, CompleteNewApplicationApprovalInfo, CompleteNewApplicationProposalInfo, CreateApplicationInfo, DcReachedInfo, GithubQueryParams, LDNApplication, MoreInfoNeeded, NotifyRefillInfo, @@ -116,7 +116,10 @@ pub async fn propose( github_username: query.github_username.clone(), // Use the provided `github_username` parameter signing_address: signer.signing_address, created_at: signer.created_at, - message_cid: signer.message_cid, + message_cids: VerifierGrantDataCapCids { + message_cid: signer.message_cids.message_cid, + increase_allowance_cid: signer.message_cids.increase_allowance_cid, + }, }; match ldn_application .complete_new_application_proposal( @@ -227,7 +230,10 @@ pub async fn approve( github_username: query.github_username.clone(), // Use the provided `github_username` parameter signing_address: signer.signing_address, created_at: signer.created_at, - message_cid: signer.message_cid, + message_cids: VerifierGrantDataCapCids { + message_cid: signer.message_cids.message_cid, + increase_allowance_cid: signer.message_cids.increase_allowance_cid, + }, }; match ldn_application .complete_new_application_approval( diff --git a/fplus-lib/src/core/application/file.rs b/fplus-lib/src/core/application/file.rs index c5c08fd..2f262f3 100644 --- a/fplus-lib/src/core/application/file.rs +++ b/fplus-lib/src/core/application/file.rs @@ -406,7 +406,7 @@ pub struct VerifierInput { pub github_username: String, pub signing_address: String, pub created_at: String, - pub message_cid: String, + pub message_cids: VerifierGrantDataCapCids, } impl From for Verifier { @@ -415,7 +415,7 @@ impl From for Verifier { github_username: input.github_username, signing_address: input.signing_address, created_at: input.created_at, - message_cid: input.message_cid, + message_cids: input.message_cids, } } } @@ -428,8 +428,19 @@ pub struct Verifier { pub signing_address: String, #[serde(rename = "Created At")] pub created_at: String, + #[serde(rename = "Message CIDs")] + pub message_cids: VerifierGrantDataCapCids, +} + +#[derive(Serialize, Deserialize, Debug, Clone)] +pub struct VerifierGrantDataCapCids { #[serde(rename = "Message CID")] pub message_cid: String, + #[serde( + rename = "Increase allowance CID", + skip_serializing_if = "Option::is_none" + )] + pub increase_allowance_cid: Option, } #[derive(Serialize, Deserialize, Debug, Clone)] diff --git a/fplus-lib/src/core/mod.rs b/fplus-lib/src/core/mod.rs index d6a136f..6bd30b4 100644 --- a/fplus-lib/src/core/mod.rs +++ b/fplus-lib/src/core/mod.rs @@ -82,7 +82,13 @@ pub struct VerifierList(pub Vec); pub struct ApplicationProposalApprovalSignerInfo { pub signing_address: String, pub created_at: String, + pub message_cids: GrantDataCapCids, +} + +#[derive(Serialize, Deserialize, Debug)] +pub struct GrantDataCapCids { pub message_cid: String, + pub increase_allowance_cid: Option, } #[derive(Deserialize, Serialize, Debug)] @@ -3426,6 +3432,7 @@ _(OLD vs NEW)_ let mut id = String::new(); let mut signing_address = String::new(); let mut message_cid = String::new(); + let mut increase_allowance_cid: Option = None; if let Some(allocation) = active_allocation { datacap_allocation_requested.clone_from(&allocation.amount); @@ -3433,15 +3440,26 @@ _(OLD vs NEW)_ if let Some(first_verifier) = allocation.signers.0.first() { signing_address.clone_from(&first_verifier.signing_address); - message_cid.clone_from(&first_verifier.message_cid); + message_cid.clone_from(&first_verifier.message_cids.message_cid); + increase_allowance_cid = first_verifier.message_cids.increase_allowance_cid.clone(); } } + let additional_status_message = + increase_allowance_cid + .clone() + .map_or("".to_string(), |increase_allowance_cid| { + format!( + ", and here https://filfox.info/en/message/{}", + increase_allowance_cid + ) + }); + let comment = format!( "## Request {} Your Datacap Allocation Request has been {} by the Notary #### Message sent to Filecoin Network -> {} +> {} {} #### Address > {} #### Datacap Allocated @@ -3450,15 +3468,17 @@ Your Datacap Allocation Request has been {} by the Notary > {} #### Id > {} -#### You can check the status of the message here: https://filfox.info/en/message/{}", +#### You can check the status here https://filfox.info/en/message/{}{}", signature_step_capitalized, signature_step, message_cid, + increase_allowance_cid.unwrap_or_default(), application_file.lifecycle.client_on_chain_address.clone(), datacap_allocation_requested, signing_address, id, - message_cid + message_cid, + additional_status_message ); gh.add_comment_to_issue(issue_number.parse().unwrap(), &comment)