bitcore-payment-protocol
bitcore-payment-protocol copied to clipboard
npm test is broken
Running npm test on HEAD of master branch (b086fc6) is currently failing for "PaymentProtocol #x509+sha256Verify should verify a real PaymentRequest without Root Cert" test case.
As per Travis logs at March 15 on that same commit, the test was passing: https://travis-ci.org/bitpay/bitcore-payment-protocol/jobs/211400035#L333
Is it possible that an updated dependency broke the test?
It's because the test will use the Coinbase case. In it you will have these dates :
{ notBefore: { type: 'utcTime', value: 1429564906000 }, notAfter: { type: 'utcTime', value: 1493147460000 } }
As we are >1493147460000, we therefore not comply.
Therefore validateCertTime will return false (as cBefore>now isn't valid anymore. Because validateCertTime is false, validityVerified is false, and we expect validityVerified && issuerVerified && sigVerified; to be return.
Therefore, final value is false. And test is failing.
@Alex-Werner thanks for the explanation!
My pleasure. The one to fix :
https://github.com/bitpay/bitcore-payment-protocol/blob/master/test/samplerequest.js#L347
I'm interested if someone can tell me how I can help with that ^^'