From 4d404758aff519890808dc5013712687c5eaaf88 Mon Sep 17 00:00:00 2001 From: holgerd77 Date: Mon, 3 Feb 2020 13:44:53 +0100 Subject: [PATCH] Additional test for isValidPrivate() to throw on unrelated exceptions --- test/account.spec.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/account.spec.ts b/test/account.spec.ts index 66af5173..b872f695 100644 --- a/test/account.spec.ts +++ b/test/account.spec.ts @@ -28,6 +28,11 @@ describe('isValidPrivate', function() { '3a443d8381a6798a70c6ff9304bdc8cb0163c23211d11628fae52ef9e0dca11a001cf066d56a8156fc201cd5df8a36ef694eecd258903fca7086c1fae7441e1d' assert.equal(isValidPrivate(Buffer.from(tmp, 'hex')), false) }) + it('should fail on wrong input type', function() { + assert.throws(function() { + isValidPrivate('WRONG_INPUT_TYPE') + }) + }) it('should fail on invalid curve (zero)', function() { const tmp = '0000000000000000000000000000000000000000000000000000000000000000' assert.equal(isValidPrivate(Buffer.from(tmp, 'hex')), false)