mpizenberg / elm-cardano

Elm offchain package for Cardano
https://elm-doc-preview.netlify.app/Cardano?repo=mpizenberg%2Felm-cardano&version=elm-doc-preview
BSD 3-Clause "New" or "Revised" License
11 stars 3 forks source link

Correct cbor encoding of integers 2^53 < N < 2^64 as 64bit #62

Closed mpizenberg closed 2 days ago

mpizenberg commented 5 days ago

Currently, any number that isn’t a "safe integer" in JavaScript definition is encoded as a CBOR big number. The issue is that also includes numbers in the range 2^53 < N < 2^64 that should instead be encoded as 64bit CBOR numbers. This is especially important for hardware wallets that doesn’t support bignums.

The relevant code is here: https://github.com/mpizenberg/elm-cardano/blob/e23413ab78d70ce4168670b0202352f2bead219b/src/Cbor/Encode/Extra.elm#L31

mpizenberg commented 3 days ago

I’m starting to work on a fix for this.

mpizenberg commented 2 days ago

Done in #69