Add negative hexstring support to getNumber.
This commit is contained in:
parent
f4d2721baf
commit
0fd2a450af
@ -76,6 +76,9 @@ export function getBigInt(value: BigNumberish, name?: string): bigint {
|
||||
return BigInt(value);
|
||||
case "string":
|
||||
try {
|
||||
if (value[0] === "-" && value[1] !== "-") {
|
||||
return -BigInt(value.substring(1));
|
||||
}
|
||||
return BigInt(value);
|
||||
} catch(e: any) {
|
||||
throwArgumentError(`invalid BigNumberish string: ${ e.message }`, name || "value", value);
|
||||
|
Loading…
Reference in New Issue
Block a user