Skip to main content

verify_primary_key_count_sum_tree_proof

Function verify_primary_key_count_sum_tree_proof 

Source
pub fn verify_primary_key_count_sum_tree_proof(
    contract_id: [u8; 32],
    document_type_name: &str,
    proof: &Proof,
    mtd: &ResponseMetadata,
    platform_version: &PlatformVersion,
    provider: &dyn ContextProvider,
) -> Result<(u64, i64), 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 grovedb proof of the document type’s primary-key count-sum-bearing element (CountSumTree / ProvableCountSumTree / ProvableCountProvableSumTree) and return the unfiltered (count, sum) pair.

Thin tenderdash-composition wrapper over [DriveDocumentSumQuery::verify_primary_key_count_sum_tree_proof]. Used by the prove path’s AVG fast path on a doctype that has both documentsCountable: true and documentsSummable: "<prop>" set, with empty where clauses — the server proves the primary-key element directly and the SDK extracts both metrics from one verified element.