Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
aie0 committed Jul 5, 2024
1 parent 934196c commit 1a4c609
Showing 1 changed file with 22 additions and 22 deletions.
44 changes: 22 additions & 22 deletions pallets/ddc-verification/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ use polkadot_ckb_merkle_mountain_range::{
util::{MemMMR, MemStore},
MerkleProof, MMR,
};
use scale_info::prelude::{format, string::String};
use serde::{Deserialize, Serialize};
use sp_application_crypto::RuntimeAppPublic;
use sp_runtime::{
Expand Down Expand Up @@ -1151,8 +1150,8 @@ pub mod pallet {
if let Some((era_id, start, end)) =
Self::get_era_for_payout(cluster_id, EraValidationStatus::PayoutInProgress)
{
if T::PayoutVisitor::get_billing_report_status(cluster_id, era_id) ==
PayoutState::Initialized
if T::PayoutVisitor::get_billing_report_status(cluster_id, era_id)
== PayoutState::Initialized
{
if let Some((_, _, customers_activity_batch_roots, _, _, _)) =
Self::fetch_validation_activities::<CustomerActivity, NodeActivity>(
Expand Down Expand Up @@ -1216,8 +1215,8 @@ pub mod pallet {
if let Some((era_id, _start, _end)) =
Self::get_era_for_payout(cluster_id, EraValidationStatus::PayoutInProgress)
{
if T::PayoutVisitor::get_billing_report_status(cluster_id, era_id) ==
PayoutState::ChargingCustomers
if T::PayoutVisitor::get_billing_report_status(cluster_id, era_id)
== PayoutState::ChargingCustomers
{
if let Some((
customers_activity_in_consensus,
Expand Down Expand Up @@ -1321,9 +1320,9 @@ pub mod pallet {
if let Some((era_id, _start, _end)) =
Self::get_era_for_payout(cluster_id, EraValidationStatus::PayoutInProgress)
{
if T::PayoutVisitor::get_billing_report_status(cluster_id, era_id) ==
PayoutState::ChargingCustomers &&
T::PayoutVisitor::all_customer_batches_processed(cluster_id, era_id)
if T::PayoutVisitor::get_billing_report_status(cluster_id, era_id)
== PayoutState::ChargingCustomers
&& T::PayoutVisitor::all_customer_batches_processed(cluster_id, era_id)
{
return Ok(Some(era_id));
}
Expand All @@ -1337,8 +1336,8 @@ pub mod pallet {
if let Some((era_id, _start, _end)) =
Self::get_era_for_payout(cluster_id, EraValidationStatus::PayoutInProgress)
{
if T::PayoutVisitor::get_billing_report_status(cluster_id, era_id) ==
PayoutState::CustomersChargedWithFees
if T::PayoutVisitor::get_billing_report_status(cluster_id, era_id)
== PayoutState::CustomersChargedWithFees
{
if let Some((
_,
Expand Down Expand Up @@ -1399,9 +1398,9 @@ pub mod pallet {
if let Some((era_id, _start, _end)) =
Self::get_era_for_payout(cluster_id, EraValidationStatus::PayoutInProgress)
{
if T::PayoutVisitor::get_billing_report_status(cluster_id, era_id) ==
PayoutState::RewardingProviders &&
T::PayoutVisitor::all_provider_batches_processed(cluster_id, era_id)
if T::PayoutVisitor::get_billing_report_status(cluster_id, era_id)
== PayoutState::RewardingProviders
&& T::PayoutVisitor::all_provider_batches_processed(cluster_id, era_id)
{
return Ok(Some(era_id));
}
Expand All @@ -1415,8 +1414,8 @@ pub mod pallet {
if let Some((era_id, _start, _end)) =
Self::get_era_for_payout(cluster_id, EraValidationStatus::PayoutInProgress)
{
if T::PayoutVisitor::get_billing_report_status(cluster_id, era_id) ==
PayoutState::ProvidersRewarded
if T::PayoutVisitor::get_billing_report_status(cluster_id, era_id)
== PayoutState::ProvidersRewarded
{
return Ok(Some(era_id));
}
Expand Down Expand Up @@ -1610,11 +1609,12 @@ pub mod pallet {
for &leaf in leaves {
match mmr.push(leaf) {
Ok(pos) => leaves_with_position.push((pos, leaf)),
Err(_) =>
Err(_) => {
return Err(OCWError::FailedToCreateMerkleRoot {
cluster_id: *cluster_id,
era_id,
}),
})
},
}
}

Expand Down Expand Up @@ -1648,9 +1648,9 @@ pub mod pallet {
let mut end_era: i64 = Default::default();

for (stored_cluster_id, era_id, validation) in EraValidations::<T>::iter() {
if stored_cluster_id == *cluster_id &&
validation.status == status &&
(smallest_era_id.is_none() || era_id < smallest_era_id.unwrap())
if stored_cluster_id == *cluster_id
&& validation.status == status
&& (smallest_era_id.is_none() || era_id < smallest_era_id.unwrap())
{
smallest_era_id = Some(era_id);
start_era = validation.start_era;
Expand Down Expand Up @@ -2142,8 +2142,8 @@ pub mod pallet {
era_validation.start_era = era_activity.start;
era_validation.end_era = era_activity.end;

if payers_merkle_root_hash == ActivityHash::default() &&
payees_merkle_root_hash == payers_merkle_root_hash
if payers_merkle_root_hash == ActivityHash::default()
&& payees_merkle_root_hash == payers_merkle_root_hash
{
era_validation.status = EraValidationStatus::PayoutSuccess;
} else {
Expand Down

0 comments on commit 1a4c609

Please sign in to comment.