Skip to content

Commit

Permalink
feat: bitcoinjs-lib remove MAX_SAFE_INTEGER limitations (#8130)
Browse files Browse the repository at this point in the history
  • Loading branch information
gomesalexandre authored Nov 15, 2024
1 parent de246ca commit aaf6695
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
diff --git a/src/bufferutils.js b/src/bufferutils.js
index a68fd31ceae3e9c465b09efd7b486fe60f88a965..14ac893566b9a87a3a2d3bd98aa5faacc4306850 100644
--- a/src/bufferutils.js
+++ b/src/bufferutils.js
@@ -4,12 +4,11 @@ const types = require('./types');
const typeforce = require('typeforce');
const varuint = require('varuint-bitcoin');
// https://github.com/feross/buffer/blob/master/index.js#L1127
-function verifuint(value, max) {
+function verifuint(value, _max) {
if (typeof value !== 'number')
throw new Error('cannot write a non-number as a number');
if (value < 0)
throw new Error('specified a negative value for writing an unsigned value');
- if (value > max) throw new Error('RangeError: value out of range');
if (Math.floor(value) !== value)
throw new Error('value has a fractional component');
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@
"react-scripts/workbox-webpack-plugin": "^7.1.0",
"p-queue": "^6.6.2",
"web3": "4.2.1-dev.a0d6730.0",
"react-scripts@^5.0.1": "patch:react-scripts@npm%3A5.0.1#./.yarn/patches/react-scripts-npm-5.0.1-d06bd2d5ad.patch"
"react-scripts@^5.0.1": "patch:react-scripts@npm%3A5.0.1#./.yarn/patches/react-scripts-npm-5.0.1-d06bd2d5ad.patch",
"@shapeshiftoss/bitcoinjs-lib@5.2.0-shapeshift.2": "patch:@shapeshiftoss/bitcoinjs-lib@npm%3A5.2.0-shapeshift.2#./.yarn/patches/@shapeshiftoss-bitcoinjs-lib-npm-5.2.0-shapeshift.2-e59ff81828.patch"
}
}
24 changes: 24 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11110,6 +11110,30 @@ __metadata:
languageName: node
linkType: hard

"@shapeshiftoss/bitcoinjs-lib@patch:@shapeshiftoss/bitcoinjs-lib@npm%3A5.2.0-shapeshift.2#./.yarn/patches/@shapeshiftoss-bitcoinjs-lib-npm-5.2.0-shapeshift.2-e59ff81828.patch::locator=%40shapeshiftoss%2Fweb%40workspace%3A.":
version: 5.2.0-shapeshift.2
resolution: "@shapeshiftoss/bitcoinjs-lib@patch:@shapeshiftoss/bitcoinjs-lib@npm%3A5.2.0-shapeshift.2#./.yarn/patches/@shapeshiftoss-bitcoinjs-lib-npm-5.2.0-shapeshift.2-e59ff81828.patch::version=5.2.0-shapeshift.2&hash=6df42b&locator=%40shapeshiftoss%2Fweb%40workspace%3A."
dependencies:
bech32: ^1.1.2
big-integer: ^1.6.44
bip174: ^2.0.1
bip32: ^2.0.4
bip66: ^1.1.0
bitcoin-ops: ^1.4.0
bs58check: ^2.0.0
create-hash: ^1.1.0
create-hmac: ^1.1.3
merkle-lib: ^2.0.10
pushdata-bitcoin: ^1.0.1
randombytes: ^2.0.1
tiny-secp256k1: ^1.1.6
typeforce: ^1.11.3
varuint-bitcoin: ^1.0.4
wif: ^2.0.1
checksum: 8011bee8ea7970cc43ad62d27b34d210a62963cad8373c72c4310058c0dcdbe3c937a8da1b16762a03b78037bf3cbb4123f42a6fe293dfaa967d88b37492353c
languageName: node
linkType: hard

"@shapeshiftoss/blockbook@npm:^9.3.0":
version: 9.3.0
resolution: "@shapeshiftoss/blockbook@npm:9.3.0"
Expand Down

0 comments on commit aaf6695

Please sign in to comment.