def destination_validated
import mylsm-lsm-store@0.6.0.1/src/transfer/Migrate.bend as Migrateimport Base
252# Marks the staged database verified only when count, digest, and order agree.
253def destination_validated(
254 state: Publication,
255 counts: Nat & Nat,
256 checks: Bool & Bool
257) -> PublicationDecision:
258 match state:
259 case RecordsCopied{}:
260 match counts:
261 case (source_entries, destination_entries):
262 match checks:
263 case (digest_equal, canonical_order):
264 Bool.pick(PublicationDecision,
265 Nat.is_eq(source_entries, destination_entries) && digest_equal && canonical_order,
266 PublicationAdvanced{DestinationValidated{}},
267 PublicationRejected{})
268 case _: PublicationRejected{}
Uses (9)
Used by (0)
No other definition uses this definition.