Add wasm bindings for Pubkey and Keypair

This commit is contained in:
Michael Vines
2021-10-13 16:52:52 -07:00
parent 6919c4863b
commit 488dc37fec
23 changed files with 537 additions and 15 deletions

14
sdk/tests/keypair.mjs Normal file
View 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()));
});
});