-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd: allow min_chan_amt > amt
for outbound liquidity orders
#406
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just one nit 🎉
cmd/pool/order.go
Outdated
// parseMinChanAmount parses and validates the value for the `min_chan_amt` | ||
// parameter. | ||
func parseMinChanAmount(ctx *cli.Context, amt uint64) (btcutil.Amount, error) { | ||
minChanAmt := btcutil.Amount(ctx.Uint64("min_chan_amt")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this function does much parsing of min_chan_amt
. It might be a good idea if this function was
validateMinChanAmount(minChanAmount btcutil.Amount, amt btcutil.Amount, auctionType) error
and move the getMinChanAmount
functionality into a separate function. I think it would make more sense that a validator accepts amt
as an argument. And testing might be simpler.
bdf41e5
to
a26a812
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Nice refactoring.
I've only read the code. Let me know if I should do more.
Skip the extra check in the cli validation flow for the markets where this option is a valid. This bug only applied to the validation logic in the cli package, poold and the backend services validate the orders correctly.
Skip the extra check in the cli validation flow for the markets where this option is a valid.
This bug only applied to the validation logic in the cli package, poold and the backend services validate the orders correctly.