Browse Source

Fix address format error and tighten up tests

master
Luke Childs 5 years ago
parent
commit
595d6aed15
  1. 2
      src/index.js
  2. 2
      test/errors.js

2
src/index.js

@ -36,7 +36,7 @@ class Vain extends Emitter {
this.options.prefix.split('').forEach(char => {
if (!this.addressFormat.charset.includes(char)) {
throw new Error(`Invalid characters for address format "${this.options.prefix.addressFormat}"`);
throw new Error(`Invalid characters for address format "${this.options.addressFormat}"`);
}
});

2
test/errors.js

@ -31,7 +31,7 @@ const multisigOptions = {
invalidCharsets.forEach(options => {
test(`Vain throws when \`options.prefix\` doesn't match the charset for ${options.addressFormat} addresses`, t => {
const error = t.throws(() => new Vain(options));
t.true(error.message.includes('Invalid characters for address format'));
t.is(error.message, `Invalid characters for address format "${options.addressFormat}"`);
});
});

Loading…
Cancel
Save