Add wasm bindings for Pubkey
and Keypair
This commit is contained in:
14
sdk/tests/keypair.mjs
Normal file
14
sdk/tests/keypair.mjs
Normal file
@ -0,0 +1,14 @@
|
||||
import { expect } from "chai";
|
||||
import { init, Keypair } from "crate";
|
||||
init();
|
||||
|
||||
describe("Keypair", function () {
|
||||
it("works", () => {
|
||||
const keypair = new Keypair();
|
||||
let bytes = keypair.toBytes();
|
||||
expect(bytes).to.have.length(64);
|
||||
|
||||
const recoveredKeypair = Keypair.fromBytes(bytes);
|
||||
expect(keypair.pubkey().equals(recoveredKeypair.pubkey()));
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user