bitcore-payment-protocol icon indicating copy to clipboard operation
bitcore-payment-protocol copied to clipboard

npm test is broken

Open gabmontes opened this issue 8 years ago • 3 comments

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?

gabmontes avatar Jun 08 '17 20:06 gabmontes

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 avatar Jul 04 '17 05:07 Alex-Werner

@Alex-Werner thanks for the explanation!

gabmontes avatar Jul 05 '17 02:07 gabmontes

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 ^^'

Alex-Werner avatar Jul 05 '17 02:07 Alex-Werner