For CheckCostFuncOperation we use 1-511 range op codes.
For CheckCostFuncOperation we use 1-511 range op codes. Thus
ChangedRule.newValue
should be parsed as a sequence of getUShort
values and then the exOpCode should be checked against that parsed
sequence.
Note, we don't need to store a number of items in a sequence,
because at the time of parsing we may assume that ChangedRule.newValue
has correct length, so we just parse it until end of bytes (of cause
checking consistency).
This rule doesn't have it's own validation logic, however it is used in creation of
ValidationExceptions, which in turn can be checked for soft-fork condition using this.isSoftFork
.
The id of the first validation rule.
The id of the first validation rule. Can be used as the beginning of the rules id range.
Validation settings that correspond to the current version of the ErgoScript implementation.
Validation settings that correspond to the current version of the ErgoScript implementation. Different version of the code will have a different set of rules here. This variable is globally available and can be use wherever checking of the rules is necessary. This is immutable data structure, it can be augmented with RuleStates from block extension sections of the blockchain, but that augmentation is only available in stateful context.
Executes the given block
catching ValidationException and checking possible
soft-fork condition in the context of the given SigmaValidationSettings.
Executes the given block
catching ValidationException and checking possible
soft-fork condition in the context of the given SigmaValidationSettings.
If soft-fork condition is recognized the whenSoftFork
is executed and its result
is returned.
executed when soft-fork condition is detected
block of code, which may throw ValidationException
set of SigmaValidationSettings which can be used to recognize soft-fork conditions.
result of block
if no ValidationException was thrown, or the result of
whenSoftFork
if soft-fork condition is detected.
ValidationException
if soft-fork condition is not recognized by the given vs
All validation rules which are used to check soft-forkable conditions. Each validation rule throws a org.ergoplatform.validation.ValidationException. Each ValidationException can be caught and handled with respect to SigmaValidationSettings, which can be changed by miners via voting. Thus, the behavior of the rules can be overridden without breaking consensus.