fed-sx-m1: Step 4b-vld — 3 bootstrap validators + manifest update + 5 new parse tests (36 total)
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 37s
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 37s
This commit is contained in:
22
next/genesis/validators/envelope-shape.sx
Normal file
22
next/genesis/validators/envelope-shape.sx
Normal file
@@ -0,0 +1,22 @@
|
||||
;; next/genesis/validators/envelope-shape.sx
|
||||
;;
|
||||
;; Validates required envelope fields per design §3.1. Stage 1 of
|
||||
;; the validation pipeline (Step 6). Mirrors the kernel's
|
||||
;; envelope:validate_shape/1 from Step 2a — when the pipeline runs
|
||||
;; in OCaml-side sandbox eval mode it dispatches by name; when it
|
||||
;; runs through the kernel Erlang path it short-circuits to the BIF.
|
||||
|
||||
(DefineValidator
|
||||
:name "envelope-shape"
|
||||
:doc "Required-fields check on the activity envelope:\n :id, :type, :actor, :published, :signature must all be\n present and non-nil. The :signature sub-field needs\n :key_id, :algorithm, :value."
|
||||
:predicate (fn
|
||||
(act)
|
||||
(and
|
||||
(not (nil? (-> act :id)))
|
||||
(not (nil? (-> act :type)))
|
||||
(not (nil? (-> act :actor)))
|
||||
(not (nil? (-> act :published)))
|
||||
(not (nil? (-> act :signature)))
|
||||
(not (nil? (-> act :signature :key_id)))
|
||||
(not (nil? (-> act :signature :algorithm)))
|
||||
(not (nil? (-> act :signature :value))))))
|
||||
Reference in New Issue
Block a user