Skip to content

Commit 282abdf

Browse files
author
Darioush Jalali
committed
undo change
1 parent d1919a3 commit 282abdf

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

utils/numbers.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package utils
55

66
import (
7+
"math/big"
78
"time"
89
)
910

@@ -19,6 +20,15 @@ func Uint64ToTime(val *uint64) time.Time {
1920
return time.Unix(timestamp, 0)
2021
}
2122

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+
2232
// Uint64PtrEqual returns true if x and y pointers are equivalent ie. both nil or both
2333
// contain the same value.
2434
func Uint64PtrEqual(x, y *uint64) bool {

0 commit comments

Comments
 (0)