-
Notifications
You must be signed in to change notification settings - Fork 108
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
asset/btc/electrum: make floatString work for float
and string float
#2770
base: master
Are you sure you want to change the base?
Conversation
float
s and `stringsfloat
s and strings
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.
Could you add a test that confirms it does what it should? I don't know exactly what we want to parse, like "1.31"
and 0
?
Yes, |
Please provide some reasoning for why this change is needed. |
I intend to use this in #2769, as a shared code since we deal with |
Signed-off-by: Philemon Ukane <[email protected]>
- remove unused type ntfn in btc/electrum/jsonrpcs.go Signed-off-by: Philemon Ukane <[email protected]>
16dc6a3
to
9977d4b
Compare
float
s and strings
float
and string float
Signed-off-by: Philemon Ukane <[email protected]>
Sorry to keep pushing on this, but can you provide an example of a response from #2769 where the type varies depending on the asset. I have never run into an api response where a single field might be different types. type A struct {
AA float64 `json:"aa,string"`
} |
Wait. This is for electrum? What does #2769 have to do with electrum? |
At one point I intended to use The fields circled in red are not the same for other assets, I think only eth uses strings (because of the large number) and ![]()
I won't be using changes in this PR for #2769 anymore as I have moved on with other options available ( In that note, you can proceed to close this PR if the changes are entirely not desirable or to remove |
This PR improves the
UnmarshalJSON
method of typefloatString
.