Portable Morphir invocation and observation contracts
{
profile: "morphir-invocations-v1",
calls: [{
id: "difference",
entry: "calls:main#subtract",
arguments: [9007199254741035, 9007199254740993]
}]
}pub(all) enum ComparisonPolicy {
Exact
Approximate(Double, Double)
}pub(all) struct OutcomeFailure {
stage : OutcomeStage
code : String
message : String
} derive(Eq, Debug)pub(all) struct Outcomes {
calls : Array[CallOutcome]
cleanup : OutcomeFailure?
extensions : Bytes?
} derive(Eq, Debug)pub(all) enum TerminalOutcome {
Returned(Value)
ModelError(String)
Failed(OutcomeFailure)
Cancelled
} derive(Eq, Debug)pub(all) enum Value {
Integer(BigInt)
Boolean(Bool)
Unit
Decimal(BigInt, Int)
Float64(UInt64)
Text(Array[Int])
Character(Array[Int])
Sequence(Array[Value])
Product(Array[Value])
Record(Array[(String, Value)])
Constructor(String, String, Array[Value])
Optional(Value?)
Outcome(Result[Value, Value])
ModelError(String)
} derive(Eq, Debug)pub struct ValueBudget {
// private fields
}fn validate_as(value : Value, expected : ValueType, definitions : Array[CustomType], output? : Bool) -> Unit raisefn validate_invocations(suite : Suite, entries : Array[PublicEntry], definitions : Array[CustomType], rejections? : Array[(String, String)]) -> Unit raisefn validate_outcomes(outcomes : Outcomes, suite : Suite, entries : Array[PublicEntry], definitions : Array[CustomType]) -> Unit raise