Skip to content

Commit

Permalink
fix: safe convert nil big.Int to "0" instead of ""
Browse files Browse the repository at this point in the history
  • Loading branch information
NgoKimPhu committed Dec 10, 2024
1 parent 642dd7e commit 7f519d3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion pkg/source/curve/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,5 @@ var weth9 = map[int]string{

var (
zeroBI = big.NewInt(0)
emptyString = ""
zero int64 = 0
)
2 changes: 1 addition & 1 deletion pkg/source/curve/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func convertToEtherAddress(address string, chain int) string {

func safeCastBigIntToString(num *big.Int) string {
if num == nil {
return emptyString
return zeroString
}

return num.String()
Expand Down

0 comments on commit 7f519d3

Please sign in to comment.