Skip to content

Commit

Permalink
undo change
Browse files Browse the repository at this point in the history
  • Loading branch information
darioush committed Jan 22, 2025
1 parent d1919a3 commit 282abdf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions utils/numbers.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package utils

import (
"math/big"
"time"
)

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

// BigNumEqual returns true if x and y are equivalent ie. both nil or both
// contain the same value.
func BigNumEqual(x, y *big.Int) bool {
if x == nil || y == nil {
return x == y
}
return x.Cmp(y) == 0
}

// Uint64PtrEqual returns true if x and y pointers are equivalent ie. both nil or both
// contain the same value.
func Uint64PtrEqual(x, y *uint64) bool {
Expand Down

0 comments on commit 282abdf

Please sign in to comment.