Skip to main content

Module validate_onchain

Module validate_onchain 

Source
Expand description

Full on-chain validation pipeline for polygon decompositions.

Replicates the exact sequence of checks that polygon.move::prepare_geometry and index.move::register perform. If validate_decomposition returns Ok, the decomposition WILL pass on-chain registration (modulo spatial overlap with existing parcels, which requires on-chain state).

Check order matches on-chain:

  1. Part count within limits
  2. Per-part validation (vertex count, convexity, edge lengths)
  3. Area > 0
  4. Area conservation (sum of parts == original)
  5. Internal overlap check (no parts overlap each other)
  6. Multipart topology (connectivity, boundary graph, boundary compactness)

Compactness is a boundary-level invariant (step 6), not a per-part one — see the validation module docs for the rationale that mirrors polygon.move.

Structs§

ValidationCheck
A single validation check result.
ValidationReport
Full validation report for a polygon decomposition.

Functions§

validate_decomposition
Run the full on-chain validation pipeline on a polygon and its decomposition.