Skip to main content

verify_distinct_count_and_sum_proof

Function verify_distinct_count_and_sum_proof 

Source
pub fn verify_distinct_count_and_sum_proof(
    query: &DriveDocumentSumQuery<'_>,
    proof: &Proof,
    mtd: &ResponseMetadata,
    limit: u16,
    left_to_right: bool,
    platform_version: &PlatformVersion,
    provider: &dyn ContextProvider,
) -> Result<Vec<AverageEntry>, Error>
Expand description

Verified average result types. Average-side analog of DocumentSum / DocumentSplitSums; carry the (count, sum) pair the verifier recovers from grovedb PR 670’s AggregateCountAndSumOnRange primitive. Client computes avg = sum / count. Verify a per-distinct-key range-AVG proof against an index that declares BOTH rangeCountable: true AND rangeSummable: true (a rangeAverageable: true index) and return per-(in_key, key) (count, sum) entries. AVG analog of super::document_sum::verify_distinct_sum_proof.

Thin tenderdash-composition wrapper over [DriveDocumentSumQuery::verify_distinct_count_and_sum_proof]. Used by the prove path’s GroupByRange / GroupByCompound + range shape on the AVG surface.