Throw Error if no private key found when calling toWIF()
This commit is contained in:
parent
62bb17b045
commit
bc9b5abb7c
1 changed files with 7 additions and 0 deletions
|
@ -146,6 +146,13 @@ describe('ECPair', () => {
|
||||||
assert.strictEqual(result, f.WIF);
|
assert.strictEqual(result, f.WIF);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
it('throws if no private key is found', () => {
|
||||||
|
assert.throws(() => {
|
||||||
|
const keyPair = ECPair.makeRandom();
|
||||||
|
delete (keyPair as any).__D;
|
||||||
|
keyPair.toWIF();
|
||||||
|
}, /Missing private key/);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('makeRandom', () => {
|
describe('makeRandom', () => {
|
||||||
|
|
Loading…
Reference in a new issue