You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
validate(){// Get info for type ID, throws on errorTypeRegistry.findByTypeId(this.getTypeId())// Bitmask can have at most 32 bits with current implementationif(this.getSubtypes()>Condition.MAX_SAFE_SUBTYPES){thrownewError('Bitmask too large to be safely represented')}// Assert all requested features are supported by this implementationif(this.getSubtypes()&~Condition.SUPPORTED_SUBTYPES){thrownewError('Condition requested unsupported feature suites')}// Assert the requested fulfillment size is supported by this implementationif(this.getCost()>Condition.MAX_COST){thrownewError('Condition requested too large of a max fulfillment size')}returntrue}
Given that subtypes is a set of strings, e.g.: Set {'preimage-sha-256', 'ed25519-sha-256'} what is the purpose of the checks > and & ~?
The text was updated successfully, but these errors were encountered:
sbellem
changed the title
Puzzled by Condition validatation
Puzzled by Condition validation
Jun 2, 2017
The code for validating a condition is :
Given that
subtypes
is a set of strings, e.g.:Set {'preimage-sha-256', 'ed25519-sha-256'}
what is the purpose of the checks>
and& ~
?The text was updated successfully, but these errors were encountered: