Skip to content

Commit

Permalink
drop nodejs v16
Browse files Browse the repository at this point in the history
  • Loading branch information
rosmcmahon committed Mar 19, 2024
1 parent e2fe1d0 commit efa533a
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 13 deletions.
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": "arweave",
"version": "1.14.4",
"version": "1.15.0",
"description": "Arweave JS client library",
"main": "./node/index.js",
"react-native": "./node/index.js",
Expand Down
10 changes: 5 additions & 5 deletions test/builds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ let globals = <any>global;
if (!globals.crypto) {
globals.crypto = {
subtle: {
generateKey: async () => { },
importKey: async () => { },
exportKey: async () => { },
digest: async () => { },
sign: async () => { },
generateKey: async () => {},
importKey: async () => {},
exportKey: async () => {},
digest: async () => {},
sign: async () => {},
},
};

Expand Down
23 changes: 18 additions & 5 deletions test/wallets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,27 @@ describe("Wallets and keys", function () {
expect(walletA.n).to.match(/^[a-z0-9-_]{683}$/i);

/** extra tests that private matches public */
const sigA = await arweave.crypto.sign(walletA, new Uint8Array([1, 2, 3, 4]));
const verifyA = await arweave.crypto.verify(walletA.n, new Uint8Array([1, 2, 3, 4]), sigA);
const sigA = await arweave.crypto.sign(
walletA,
new Uint8Array([1, 2, 3, 4])
);
const verifyA = await arweave.crypto.verify(
walletA.n,
new Uint8Array([1, 2, 3, 4]),
sigA
);
expect(verifyA).true;
const sigB = await arweave.crypto.sign(walletB, new Uint8Array([1, 2, 3, 4]));
const verifyB = await arweave.crypto.verify(walletB.n, new Uint8Array([1, 2, 3, 4]), sigB);
const sigB = await arweave.crypto.sign(
walletB,
new Uint8Array([1, 2, 3, 4])
);
const verifyB = await arweave.crypto.verify(
walletB.n,
new Uint8Array([1, 2, 3, 4]),
sigB
);
expect(verifyB).true;


expect(walletA.d?.length).to.equal(683);
expect(walletA.d).to.match(/^[a-z0-9-_]{683}$/i);

Expand Down

0 comments on commit efa533a

Please sign in to comment.