diff --git a/src/index.js b/src/index.js index 876056c..c9d4765 100644 --- a/src/index.js +++ b/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}"`); } }); diff --git a/test/errors.js b/test/errors.js index 8e142ee..81a8267 100644 --- a/test/errors.js +++ b/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}"`); }); });