Skip to content
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

txnbuild: Update all operations with price fields to accept N/D representation #2514

Closed
bartekn opened this issue Apr 27, 2020 · 0 comments · Fixed by #4167
Closed

txnbuild: Update all operations with price fields to accept N/D representation #2514

bartekn opened this issue Apr 27, 2020 · 0 comments · Fixed by #4167
Assignees
Labels
txnbuild 2nd-generation transaction build library for Go SDK

Comments

@bartekn
Copy link
Contributor

bartekn commented Apr 27, 2020

What version are you using?

master

What did you do?

As noticed by @nikhilsaraf in stellar-deprecated/kelp#405 (comment) it's not possible to set a price on operations with price field in n/d form. This makes it impossible to represent prices without finite decimal expansion with a reasonable number of decimal places.

To solve this we should update operations with Price fields (like ManageBuyOffer) with a new struct type that consists of two int32 values: n and d. Users willing to use string representation of the price could still use price.Parse function (note that it returns xdr.Price so we'd need to create an intermediary type).

Alternatively, we can add an extra field as above, but leave the old Price field and allow only one of them to be set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
txnbuild 2nd-generation transaction build library for Go SDK
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants