31 lines
1021 B
Go
31 lines
1021 B
Go
package epistemics
|
|
|
|
type WorldOutcomeState string
|
|
|
|
const (
|
|
OutcomeVerifiedSuccess WorldOutcomeState = "VERIFIED_SUCCESS"
|
|
OutcomeVerifiedPartial WorldOutcomeState = "VERIFIED_PARTIAL"
|
|
OutcomeVerifiedFailure WorldOutcomeState = "VERIFIED_FAILURE"
|
|
OutcomeUnverified WorldOutcomeState = "UNVERIFIED"
|
|
OutcomeUnknownState WorldOutcomeState = "UNKNOWN"
|
|
OutcomeConflicted WorldOutcomeState = "CONFLICTED"
|
|
)
|
|
|
|
type WorldOutcomeAssessment struct {
|
|
ID string
|
|
PrincipalID string
|
|
ActionAttemptRef string
|
|
ExecutionReceiptRefs []string
|
|
ExpectedEffectRef string
|
|
ObservationRefs []ObservationID
|
|
ClaimRefs []ClaimID
|
|
State WorldOutcomeState
|
|
ConfidenceMillis int64
|
|
EvidenceRefs []EvidenceRef
|
|
AssessedAt int64
|
|
}
|
|
|
|
func (a WorldOutcomeAssessment) Valid() bool {
|
|
return a.ID != "" && a.PrincipalID != "" && a.ActionAttemptRef != "" && a.State != "" && a.ConfidenceMillis >= 0 && a.ConfidenceMillis <= 1000 && a.AssessedAt > 0
|
|
}
|