Skip to content

Commit

Permalink
fix(inspection): skipping challenging if there is no actitvity records
Browse files Browse the repository at this point in the history
  • Loading branch information
yahortsaryk committed Jan 24, 2025
1 parent f6172d9 commit ffd1028
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
9 changes: 9 additions & 0 deletions pallets/ddc-verification/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1414,9 +1414,18 @@ pub mod pallet {
val.pop_first().expect("Collected activity records to exist.");
let collector_key = phd_id.0.clone();

if node_leaves_count == 0 {
continue;
}

let n = calculate_sample_size_fin(n0, node_leaves_count)
.expect("Sample size to be calculated.");
let n_per_tcaa = n / node_tcaa_count;

if n_per_tcaa == 0 {
continue;
}

let mut remainder = n % node_tcaa_count;

let mut verified_tcaas: BTreeMap<DdcEra, Vec<u64>> = BTreeMap::new();
Expand Down
7 changes: 2 additions & 5 deletions runtime/cere-dev/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// and set impl_version to 0. If only runtime
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
spec_version: 72000,
spec_version: 72001,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 24,
Expand Down Expand Up @@ -1542,10 +1542,7 @@ pub type SignedPayload = generic::SignedPayload<RuntimeCall, SignedExtra>;
pub type CheckedExtrinsic = generic::CheckedExtrinsic<AccountId, RuntimeCall, SignedExtra>;

/// Runtime migrations
type Migrations = (
pallet_ddc_payouts::migrations::v3::MigrateToV3<Runtime>,
pallet_ddc_verification::migrations::v2::MigrateToV2<Runtime>,
);
type Migrations = ();

/// Executive: handles dispatch to the various modules.
pub type Executive = frame_executive::Executive<
Expand Down
2 changes: 1 addition & 1 deletion runtime/cere/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// and set impl_version to 0. If only runtime
// implementation changes and behavior does not, then leave spec_version as
// is and increment impl_version.
spec_version: 72000,
spec_version: 72001,
impl_version: 0,
apis: RUNTIME_API_VERSIONS,
transaction_version: 24,
Expand Down

0 comments on commit ffd1028

Please sign in to comment.