Skip to content
This repository was archived by the owner on Nov 23, 2023. It is now read-only.

Commit af80c5c

Browse files
committed
fixup! feat: Support Ethereum EIP-712 Sign Typed Data
Cleanup BigNumber.js usage.
1 parent 36d1201 commit af80c5c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/js/core/methods/helpers/ethereumSignTypedData.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function twosComplement(number: BigNumber, bytes: number): BigNumber {
6464
if (bigNumber.isPositive()) {
6565
return bigNumber;
6666
}
67-
return bigNumber.minus(minValue).plus(minValue.negated());
67+
return bigNumber.minus(minValue).minus(minValue);
6868
}
6969

7070
function intToHex(
@@ -77,7 +77,7 @@ function intToHex(
7777
if (signed) {
7878
bigNumber = twosComplement(bigNumber, bytes);
7979
}
80-
if (bigNumber.isNegative(0)) {
80+
if (bigNumber.isNegative()) {
8181
throw ERRORS.TypedError(
8282
'Method_InvalidParameter',
8383
`Cannot convert negative number to unsigned interger: ${number}`,

0 commit comments

Comments
 (0)