We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d1919a3 commit 282abdfCopy full SHA for 282abdf
utils/numbers.go
@@ -4,6 +4,7 @@
4
package utils
5
6
import (
7
+ "math/big"
8
"time"
9
)
10
@@ -19,6 +20,15 @@ func Uint64ToTime(val *uint64) time.Time {
19
20
return time.Unix(timestamp, 0)
21
}
22
23
+// BigNumEqual returns true if x and y are equivalent ie. both nil or both
24
+// contain the same value.
25
+func BigNumEqual(x, y *big.Int) bool {
26
+ if x == nil || y == nil {
27
+ return x == y
28
+ }
29
+ return x.Cmp(y) == 0
30
+}
31
+
32
// Uint64PtrEqual returns true if x and y pointers are equivalent ie. both nil or both
33
// contain the same value.
34
func Uint64PtrEqual(x, y *uint64) bool {
0 commit comments