Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Upgrades minors and patches #665

Merged
merged 2 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 21 additions & 16 deletions package-lock.json

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

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
"/lib"
],
"dependencies": {
"axios": "1.6.8",
"axios": "1.7.2",
"bitcore-lib": "8.25.10",
"bitcore-mnemonic": "8.25.10",
"buffer": "6.0.3",
"crypto-js": "4.2.0",
"isomorphic-ws": "5.0.0",
"level": "8.0.0",
"level": "8.0.1",
"lodash": "4.17.21",
"long": "4.0.0",
"long": "5.2.3",
"ws": "8.17.0"
},
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions src/utils/buffer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import buffer from 'buffer';
import Long from 'long';
import { ParseError } from '../errors';
import {ParseError} from '../errors';

const isHexa = (value: string): boolean => {
// test if value is string?
Expand Down Expand Up @@ -54,8 +54,8 @@ export function signedIntToBytes(value: number, bytes: number): Buffer {
view.setInt32(0, value, false);
} else if (bytes === 8) {
// In case of 8 bytes I need to handle the int with a Long lib
let long = Long.fromNumber(value, false);
arr = long.toBytesBE();
const long = Long.fromNumber(value, false);
arr = new Uint8Array(long.toBytesBE()).buffer;
Comment on lines +57 to +58
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implicit conversion from number[] to ArrayBuffer was being rejected by the build phase ( failed action )

An explicit conversion was implemented through Uint8Array, and according to the unit tests is working correctly.

}
return buffer.Buffer.from(arr);
}
Expand Down
Loading