Skip to content

Commit

Permalink
cli: happy lint, happy life
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusVanDerWijden committed Apr 3, 2024
1 parent 3dad826 commit 8099445
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,17 @@ func setupLogging() error {
return nil
}

var (
errNegativeBid = errors.New("please specify a non-negative minimum bid")
errLargeMinBid = errors.New("minimum bid is too large, please ensure min-bid is denominated in Ethers")
)

func sanitizeMinBid(minBid float64) (*types.U256Str, error) {
if minBid < 0.0 {
return nil, errors.New("please specify a non-negative minimum bid")
return nil, errNegativeBid
}
if minBid > 1000000.0 {
return nil, errors.New("minimum bid is too large, please ensure min-bid is denominated in Ethers")
return nil, errLargeMinBid
}
return common.FloatEthTo256Wei(minBid)
}

0 comments on commit 8099445

Please sign in to comment.