-
Notifications
You must be signed in to change notification settings - Fork 503
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
xdr: Enforce asset ordering in xdr pool #3865
Conversation
b89f700
to
4bb35c8
Compare
a5fd691
to
6d97293
Compare
txnbuild/liquidity_pool_deposit.go
Outdated
if _, ok := max.SetString(maxPrice); !ok { | ||
return LiquidityPoolDeposit{}, errors.Errorf("cannot parse maxPrice: %v", minPrice) | ||
} | ||
maxPrice = max.Inv(max).FloatString(7) |
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.
Given there can be rounding error after the price inversion I wonder if we should simply return an error here.
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.
yeah, was debating that as well...
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.
Per discussion, this opens a can of worms. Let's just go back to throwing an error if the assets are out-of-order. That is the safest option, matches the JS SDK, and shouldn't happen often IRL, as the assets returned from horizon will be in-order.
9306059
to
3d8cb9e
Compare
PR Checklist
PR Structure
otherwise).
services/friendbot
, orall
ordoc
if the changes are broad or impact manypackages.
Thoroughness
.md
files, etc... affected by this change). Take a look in the
docs
folder for a given service,like this one.
Release planning
needed with deprecations, added features, breaking changes, and DB schema changes.
semver, or if it's mainly a patch change. The PR is targeted at the next
release branch if it's not a patch change.
What
Enforce asset ordering in
xdr.NewPoolId
.Why
To try to catch potential bugs early.
Known limitations
[TODO or N/A]