ContractEvaluationEngine

Pluggable contract condition evaluation engine.

Each engine implements domain-specific evaluation logic for contract conditions. The engine ID must match the evaluationEngine string in the contract's ExecutionModel.

Example Usage:

class MyEngine : BaseEvaluationEngine() {
override val engineId = "my-engine"
override val version = "1.0.0"
override val supportedConditionTypes = setOf(ConditionType.THRESHOLD)

override suspend fun evaluateCondition(
condition: ContractCondition,
inputData: JsonElement,
context: EvaluationContext
): Boolean {
// Implementation...
}
}

Inheritors

Properties

Link copied to clipboard
abstract val engineId: String

Unique identifier for this evaluation engine. Must match the evaluationEngine value in ExecutionModel. Examples: "parametric-insurance", "rule-engine", "smart-contract-vm"

Link copied to clipboard

Hash/digest of the engine implementation. Used to verify the engine hasn't been tampered with.

Link copied to clipboard

Supported condition types for this engine.

Link copied to clipboard
abstract val version: String

Version of the engine implementation. Used for tamper detection and compatibility checks.

Functions

Link copied to clipboard
abstract suspend fun evaluateCondition(condition: ContractCondition, inputData: JsonElement, context: EvaluationContext): Boolean

Evaluate a single contract condition.

Link copied to clipboard
abstract suspend fun evaluateConditions(conditions: List<ContractCondition>, inputData: JsonElement, context: EvaluationContext): Map<String, Boolean>

Evaluate multiple conditions (for composite conditions).