Skip to content

Commit

Permalink
bumping deps
Browse files Browse the repository at this point in the history
  • Loading branch information
coranos committed Oct 30, 2023
1 parent 8d328e5 commit 4143801
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/bananocoin-bananojs.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//bananocoin-bananojs.js
//version 2.10.3
//version 2.10.4
//license MIT
/* eslint-disable */
const require = (modname) => {
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bananocoin/bananojs",
"version": "2.10.3",
"version": "2.10.4",
"module": "index.js",
"repository": {
"type": "git",
Expand Down
3 changes: 3 additions & 0 deletions test/unit/bananode-api-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ const callResponseError = async (retval, fn, arg1, arg2, arg3, arg4) => {
if (error.message == 'Unexpected token < in JSON at position 0') {
return;
}
if (error.message == `Unexpected token '<', "<html/>" is not valid JSON`) {
return;
}
if (error.message == '{}') {
return;
}
Expand Down
12 changes: 11 additions & 1 deletion test/unit/message-signing-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,24 @@ describe('message-sign', () => {
expect(actualMessageSignature).to.deep.equal(expectedMessageSignature);
});

it('signed message is verified', async () => {
it('signed string message is verified', async () => {
const bananojs = testUtil.getBananojsWithMockApi();
const signature = await bananojs.signMessage(privateKey, 'test');
const publicKey = await bananojs.getPublicKey(privateKey);
const signatureVerify = bananojs.verifyMessage(publicKey, 'test', signature);
expect(signatureVerify).to.deep.equal(true);
});

it('signed Uint8Array message is verified', async () => {
const bananojs = testUtil.getBananojsWithMockApi();
const message = new Uint8Array(1);
message[0] = 1;
const signature = await bananojs.signMessage(privateKey, message);
const publicKey = await bananojs.getPublicKey(privateKey);
const signatureVerify = bananojs.verifyMessage(publicKey, message, signature);
expect(signatureVerify).to.deep.equal(true);
});

it('different signed messages generates different signatures', async () => {
const bananojs = testUtil.getBananojsWithMockApi();
const signature1 = await bananojs.signMessage(privateKey, 'test1');
Expand Down

0 comments on commit 4143801

Please sign in to comment.