fix: prevent getFee from returning NaN from Reporting Mode (#1401)

When using a rippled server in Reporting Mode, the server_info response does not have a load_factor property.

https://xrpl.org/rippled-server-modes.html#reporting-mode

https://github.com/ripple/rippled/issues/3812

Now, when load_factor is missing, we default to a load_factor of 1.

Fix #1398
This commit is contained in:
Elliot Lee
2021-05-10 13:56:31 -07:00
committed by GitHub
parent 67d1b5278d
commit c8b0035897
5 changed files with 99 additions and 1 deletions

View File

@@ -51,5 +51,14 @@ export default <TestSuite>{
api._feeCushion = 0.9
const fee = await api.getFee()
assert.strictEqual(fee, '0.000009')
},
'getFee reporting': async (api, address) => {
api.connection.request({
command: 'config',
data: {reporting: true}
})
const fee = await api.getFee()
assert.strictEqual(fee, '0.000012')
}
}