ripple / ripple-binary-codec

Convert between json and hex representations of transactions and ledger entries on the XRP Ledger. Moved to: https://github.com/XRPLF/xrpl.js/tree/develop/packages/ripple-binary-codec
https://github.com/XRPLF/xrpl.js/tree/develop/packages/ripple-binary-codec
ISC License
19 stars 45 forks source link

fix: edge case construcing from string '0' #121

Closed natenichols closed 3 years ago

natenichols commented 3 years ago

High Level Overview of Change

Handles the edge case where UInt64 is constructed from string '0'.

Context of Change

When constructing UInt64 with.from(), this adds an edge case when the parameter is of type string where UInt64.from('0') returnsUInt64.from(0).

Type of Change

Test Plan

Added test coverage for this case.

intelliot commented 3 years ago

Looks good... could we also add a test case that uses some realistic-ish data from rippled?

Since this is covering a case that only occurs as of rippled v1.7.0+