five-bells-condition
five-bells-condition copied to clipboard
Readme has confusing example usage of validateFulfillment
The following snippet found in a few places in the readme makes it look like validateFulfillment
returns a boolean to indicate validation whereas it actually throws an error for invalid fulfillments.
const validationResult = cc.validateFulfillment(fulfillment, condition)
// validationResult === true
Created new issue to request to use return values for validation results, instead of throwing errors.
There is no apparent reason to throw errors, when they could be just handled as normal function return values. If someone needs to wrap a promise around the return values, it would make their life easier to debug when you are trying to validate an array of fulfillments.