Skip to content

Commit

Permalink
build(deps): bump @mattrglobal/bbs-signatures, bs58 and rfc4648 (#96)
Browse files Browse the repository at this point in the history
* build(deps): bump @mattrglobal/bbs-signatures, bs58 and rfc4648
   BREAKING CHANGE: removes support for Node lower than 18

* ci: add node 20.x and 22.x
  • Loading branch information
afonsobarracha authored Oct 15, 2024
1 parent 6d0d0c2 commit 363e527
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 237 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/any-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x, 18.x]
node-version: [18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
node-version: [22.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/push-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
node-version: [22.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
Expand Down
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
],
"private": false,
"engines": {
"node": ">=14.0.0"
"node": ">=18.0.0"
},
"devEngines": {
"node": "16.x || 18.x"
"node": "18.x || 20.x || 22.x"
},
"scripts": {
"test:node": "BBS_SIGNATURES_MODE=\"NODE_JS_MODULE\" jest",
Expand All @@ -52,7 +52,6 @@
"devDependencies": {
"@commitlint/cli": "17.7.1",
"@commitlint/config-conventional": "17.7.0",
"@types/bs58": "4.0.1",
"@types/jest": "29.5.13",
"@types/node": "18.18.0",
"@typescript-eslint/eslint-plugin": "2.28.0",
Expand All @@ -72,9 +71,9 @@
"typescript": "4.9.5"
},
"dependencies": {
"@mattrglobal/bbs-signatures": "1.4.0",
"bs58": "4.0.1",
"rfc4648": "1.5.2"
"@mattrglobal/bbs-signatures": "2.0.0",
"bs58": "6.0.0",
"rfc4648": "1.5.3"
},
"husky": {
"hooks": {
Expand Down
4 changes: 2 additions & 2 deletions src/Bls12381G1KeyPair.ts
Original file line number Diff line number Diff line change
Expand Up @@ -436,11 +436,11 @@ export class Bls12381G1KeyPair {
} catch (e) {
return { error: e, valid: false };
}
const publicKeyBuffer = new Buffer(this.publicKeyBuffer);
const publicKeyBuffer = Buffer.from(this.publicKeyBuffer);

// validate the first two multicodec bytes 0xea01
const valid =
fingerprintBuffer.slice(0, 2).toString("hex") === "ea01" &&
Buffer.from(fingerprintBuffer.slice(0, 2)).toString("hex") === "ea01" &&
publicKeyBuffer.equals(fingerprintBuffer.slice(2));
if (!valid) {
return {
Expand Down
4 changes: 2 additions & 2 deletions src/Bls12381G2KeyPair.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,11 +478,11 @@ export class Bls12381G2KeyPair {
} catch (e) {
return { error: e, valid: false };
}
const publicKeyBuffer = new Buffer(this.publicKeyBuffer);
const publicKeyBuffer = Buffer.from(this.publicKeyBuffer);

// validate the first two multicodec bytes 0xeb01
const valid =
fingerprintBuffer.slice(0, 2).toString("hex") === "eb01" &&
Buffer.from(fingerprintBuffer.slice(0, 2)).toString("hex") === "eb01" &&
publicKeyBuffer.equals(fingerprintBuffer.slice(2));
if (!valid) {
return {
Expand Down
Loading

0 comments on commit 363e527

Please sign in to comment.