hyperledger-archives / education-cryptomoji

https://wiki.hyperledger.org/display/LMDWG
Apache License 2.0
96 stars 370 forks source link

Fix namespace typo in isValidAddress test #113

Closed delventhalz closed 6 years ago

delventhalz commented 6 years ago

Fixes #110

The test that ensured isValidAddress rejected non-hex input used the wrong namespace, which meant it would reject the test address based on namespace before even looking at whether or not it was hex.

To test:

cd code/part-two/processor/
npm install
npm test

All of the tests should pass. Then, if you modify line 121 of code/part-two/processor/services/addressing.js so it reads:

  const pattern = `^${NAMESPACE}[0-9a-z]{64}$`;

The tests should fail correctly. Previously this error would have snuck past the tests.

therobinkim commented 6 years ago

lgtm -- tested & confirmed working on my end!