Skip to content

Commit af26215

Browse files
committed
Added logs to proposal and approval
1 parent 5354bfb commit af26215

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

fplus-lib/src/core/mod.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1574,9 +1574,9 @@ impl LDNApplication {
15741574
}
15751575
let app_state: AppState = application_file.lifecycle.get_state();
15761576

1577-
log::info!("- App state is {:?}", app_state.as_str());
1577+
log::info!("Val Approval - App state is {:?}", app_state.as_str());
15781578
if app_state < AppState::Granted {
1579-
log::warn!("- State is less than Granted");
1579+
log::warn!("Val Approval < (G)- State is less than Granted");
15801580
return Ok(false);
15811581
} else if app_state == AppState::Granted {
15821582
let active_request_id = match application_file
@@ -1586,29 +1586,29 @@ impl LDNApplication {
15861586
{
15871587
Some(id) => id,
15881588
None => {
1589-
log::warn!("- No active request");
1589+
log::warn!("Val Approval (G) - No active request");
15901590
return Ok(false);
15911591
}
15921592
};
15931593
let active_request =
15941594
match application_file.allocation.find_one(active_request_id) {
15951595
Some(request) => request,
15961596
None => {
1597-
log::warn!("- No active request");
1597+
log::warn!("Val Approval (G) - No active request");
15981598
return Ok(false);
15991599
}
16001600
};
16011601
let signers: application::file::Verifiers = active_request.signers.clone();
16021602
if signers.0.len() != 2 {
1603-
log::warn!("- Not enough signers");
1603+
log::warn!("Val Approval (G) - Not enough signers");
16041604
return Ok(false);
16051605
}
16061606
let signer = signers.0.get(1).unwrap();
16071607
let signer_gh_handle = signer.github_username.clone();
16081608
let valid_verifiers =
16091609
Self::fetch_verifiers(owner.clone(), repo.clone()).await?;
16101610
if valid_verifiers.is_valid(&signer_gh_handle) {
1611-
log::info!("- Validated!");
1611+
log::info!("Val Approval (G)- Validated!");
16121612
Self::issue_datacap_request_signature(
16131613
application_file.clone(),
16141614
"approved".to_string(),
@@ -1632,10 +1632,10 @@ impl LDNApplication {
16321632
return Ok(true);
16331633
}
16341634

1635-
log::warn!("- Not validated!");
1635+
log::warn!("Val Approval (G) - Not validated!");
16361636
Ok(false)
16371637
} else {
1638-
log::info!("- State is greater than Granted");
1638+
log::info!("Val Approval > (G) - State is greater than Granted");
16391639
Ok(true)
16401640
}
16411641
}
@@ -1660,20 +1660,20 @@ impl LDNApplication {
16601660
return Ok(true);
16611661
}
16621662
let app_state: AppState = application_file.lifecycle.get_state();
1663-
log::info!("- App state is {:?}", app_state.as_str());
1663+
log::info!("Val Proposal - App state is {:?}", app_state.as_str());
16641664
if app_state < AppState::StartSignDatacap {
1665-
log::warn!("- State is less than StartSignDatacap");
1665+
log::warn!("Val Proposal (< SSD) - State is less than StartSignDatacap");
16661666
return Ok(false);
16671667
} else if app_state == AppState::StartSignDatacap {
16681668
let active_request = application_file.allocation.active();
16691669
if active_request.is_none() {
1670-
log::warn!("- No active request");
1670+
log::warn!("Val Proposal (SSD)- No active request");
16711671
return Ok(false);
16721672
}
16731673
let active_request = active_request.unwrap();
16741674
let signers = active_request.signers.clone();
16751675
if signers.0.len() != 1 {
1676-
log::warn!("- Not enough signers");
1676+
log::warn!("Val Proposal (SSD) - Not enough signers");
16771677
return Ok(false);
16781678
}
16791679
let signer = signers.0.get(0).unwrap();
@@ -1702,13 +1702,13 @@ impl LDNApplication {
17021702
)
17031703
.await?;
17041704

1705-
log::info!("- Validated!");
1705+
log::info!("Val Proposal (SSD) - Validated!");
17061706
return Ok(true);
17071707
}
1708-
log::warn!("- Not validated!");
1708+
log::warn!("Val Proposal (SSD) - Not validated!");
17091709
Ok(false)
17101710
} else {
1711-
log::info!("- State is greater than StartSignDatacap");
1711+
log::info!("Val Proposal (> SSD) - State is greater than StartSignDatacap");
17121712
Ok(true)
17131713
}
17141714
}

0 commit comments

Comments
 (0)