diff --git a/go/clients/nodeengineclient/health.go b/go/clients/nodeengineclient/health.go index b893d43..a5d3b56 100644 --- a/go/clients/nodeengineclient/health.go +++ b/go/clients/nodeengineclient/health.go @@ -13,6 +13,10 @@ import ( // a module declares as the engine placed them (the state data, `.`): their layouts are the seat's contract // (seat.HealthByNodeValue, seat.DataByNodeModuleValue); this file is their codec, shared by the engine and its readers. +// RootContract is the statement contract from which an engine judges an account's root: a report whose contract is lower +// judged nothing about root, and a reader must not read its empty root verdicts as healthy (HealthByNodeValue.Contract). +const RootContract = 3 + // EncodeHealth is h as JSON at the current version; it refuses a report naming no node, and a fall back to the old login // that names another node, no login fallen back from, no reason or no time. func EncodeHealth(h seat.HealthByNodeValue) ([]byte, error) { diff --git a/go/clients/nodeengineclient/health_test.go b/go/clients/nodeengineclient/health_test.go new file mode 100644 index 0000000..7dfdf28 --- /dev/null +++ b/go/clients/nodeengineclient/health_test.go @@ -0,0 +1,11 @@ +package nodeengineclient + +import "testing" + +// A report below RootContract judged nothing about root; the number is the one engines have written since the root +// judgement began, so a change of it is a change of what a reader trusts. +func TestRootContractIsTheOneEnginesJudgeRootFrom(t *testing.T) { + if RootContract != 3 { + t.Fatalf("RootContract = %d, the engines write 3", RootContract) + } +}