Skip to content

Commit

Permalink
chore: benchmarking code
Browse files Browse the repository at this point in the history
  • Loading branch information
yahortsaryk committed Jan 23, 2025
1 parent 53c5a6a commit a904e3f
Show file tree
Hide file tree
Showing 7 changed files with 2,858 additions and 3,192 deletions.
10 changes: 5 additions & 5 deletions pallets/ddc-payouts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1112,15 +1112,15 @@ pub mod pallet {
Ok(())
}

fn get_payout_status(cluster_id: &ClusterId, era: PaymentEra) -> PayoutState {
fn get_payout_state(cluster_id: &ClusterId, era: PaymentEra) -> PayoutState {
let payout_receipt = PayoutReceipts::<T>::get(cluster_id, era);
match payout_receipt {
Some(report) => report.state,
None => PayoutState::NotInitialized,
}
}

fn all_customer_batches_processed(cluster_id: &ClusterId, era_id: PaymentEra) -> bool {
fn is_customers_charging_finished(cluster_id: &ClusterId, era_id: PaymentEra) -> bool {
let payout_receipt = match PayoutReceipts::<T>::try_get(cluster_id, era_id) {
Ok(report) => report,
Err(_) => return false,
Expand All @@ -1133,7 +1133,7 @@ pub mod pallet {
.is_ok()
}

fn all_provider_batches_processed(cluster_id: &ClusterId, era_id: PaymentEra) -> bool {
fn is_providers_rewarding_finished(cluster_id: &ClusterId, era_id: PaymentEra) -> bool {
let payout_receipt = match PayoutReceipts::<T>::try_get(cluster_id, era_id) {
Ok(report) => report,
Err(_) => return false,
Expand All @@ -1146,7 +1146,7 @@ pub mod pallet {
.is_ok()
}

fn get_next_customer_batch_for_payment(
fn get_next_customers_batch(
cluster_id: &ClusterId,
era_id: PaymentEra,
) -> Result<Option<BatchIndex>, PayoutError> {
Expand All @@ -1162,7 +1162,7 @@ pub mod pallet {
Ok(None)
}

fn get_next_provider_batch_for_payment(
fn get_next_providers_batch(
cluster_id: &ClusterId,
era_id: PaymentEra,
) -> Result<Option<BatchIndex>, PayoutError> {
Expand Down
Loading

0 comments on commit a904e3f

Please sign in to comment.