mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-21 12:45:50 +00:00
fix: edge case constructing from string '0' (#121)
* fix: edge case constructing from string '0'
This commit is contained in:
@@ -54,6 +54,10 @@ class UInt64 extends UInt {
|
||||
}
|
||||
|
||||
if (typeof val === "string") {
|
||||
if (val === "0") {
|
||||
return UInt64.from(0);
|
||||
}
|
||||
|
||||
if (!HEX_REGEX.test(val)) {
|
||||
throw new Error(`${val} is not a valid hex-string`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user