feat: generate random keypair with constructor (#17448)

This commit is contained in:
Justin Starry
2021-05-24 21:04:05 -07:00
committed by GitHub
parent fda8cb176a
commit dbd7be5ff1
2 changed files with 27 additions and 7 deletions

View File

@ -4,6 +4,12 @@ import {Buffer} from 'buffer';
import {Keypair} from '../src';
describe('Keypair', () => {
it('new keypair', () => {
const keypair = new Keypair();
expect(keypair.secretKey).to.have.length(64);
expect(keypair.publicKey.toBytes()).to.have.length(32);
});
it('generate new keypair', () => {
const keypair = Keypair.generate();
expect(keypair.secretKey).to.have.length(64);