five-bells-condition icon indicating copy to clipboard operation
five-bells-condition copied to clipboard

Readme has confusing example usage of validateFulfillment

Open clark800 opened this issue 8 years ago • 1 comments

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

clark800 avatar Nov 03 '16 23:11 clark800

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.

KrishnaPG avatar Apr 24 '18 12:04 KrishnaPG