Skip to content
This repository has been archived by the owner on Jun 17, 2021. It is now read-only.

Commit

Permalink
Additional test for isValidPrivate() to throw on unrelated exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
holgerd77 authored and cgewecke committed Apr 23, 2020
1 parent 5bbb94c commit 65a459d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/account.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 65a459d

Please sign in to comment.