EndlessVanguard / bitcoin-remunerate-api

A scheme for trustless, decentralized, anonymous, remuneration for content creators.
1 stars 0 forks source link

Simplification of predicates for records #19

Closed fromheten closed 8 years ago

fromheten commented 8 years ago

Eeeeh, so this is a pull request to a pull request...

Sorry for rambling on before. A diff says more than a thousand words, so here is what I meant. Couldn't push this before as I was only on mobile.

There was also one problem, maybe only on my machine. The tests would fail if the redis DB was not running. That is because the const redisDb = require('../config/redis') was on the top of the files, which threw errors when the db was not up.

major updates

mattgstevens commented 8 years ago

So to summarize after our talk this morning, I'd still like to have validateRecord behaviour since the purpose was to have a halting behaviour when validation fails and to give some insight as to why it failed (via the messages that are returned in each Predicate function).

fromheten commented 8 years ago

Sure, then I close this one. For the record I'm worried by it not returning values, therefore being harder to test. We therefore miss things like if (address[0] !== 1) { return 'must begin with a "1"' } (address is string, and this if will therefore never be true)