rippled
rippled copied to clipboard
noripple_check's proposed transactions use JSON number type for fee
Issue Description
The noripple_check method response contains suggested transactions to fix No Ripple Flag settings, but these transactions inappropriately use "Fee": 10
rather than "Fee": "10"
.
Steps to Reproduce
Call noripple_check on an account that has at least one suggested change. On Mainnet, you can try rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn or r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59.
Expected Result
The proposed transactions should be validly formatted. XRP amounts such as the Fee
field should be written as a string.
Actual Result
The Fee
field is specified as an integer.
Environment
The example responses going back to the introduction of this method are like this, but it's also true as recently as v1.8.4 in Ripple's s1 cluster.
On Making a Breaking Change
Technically, fixing this bug should be considered a breaking change because it's changing the data type of a response field in an existing API. The previous behavior is apparent in examples from the documentation.
However, the definition from the docs is that the transactions
array is supposed to contain "JSON objects that you can sign and submit as transactions." The fact that several client libraries won't actually sign these transactions because they're invalidly formatted is a strong argument that this is a bug, and should not work that way. (The docs also don't explicitly call out the data type of the Fee
field, even though they do show it as an integer in the example response.)
Given that this API method is probably little-used and anyone who is using it would have difficulty, I think it would be fine to make the breaking change to fix the Fee field type. Anyone who is using it correctly already is probably casting the field to a string or replacing it entirely—both of those could easily be unaffected by this change. So I am comfortable just fixing the data type without putting it on an APIv2 switch or anything of that sort.