algorand / js-algorand-sdk

The official JavaScript SDK for Algorand.
https://algorand.github.io/js-algorand-sdk/
MIT License
284 stars 206 forks source link

Msgpack maps with object keys support needed for proper `LedgerStateDelta` decoding #885

Open jasonpaulos opened 3 weeks ago

jasonpaulos commented 3 weeks ago

Problem

The LedgerStateDelta object as returned from algod has the field Txleases which is a map with an object key, as show in https://github.com/algorand/go-algorand/blob/8e2e2e4f4f714e40d6156ed77cbd1b4b4763d11a/ledger/ledgercore/statedelta.go#L105

Unfortunately if this object is present, this SDK will be unable to decode any part of the msgpack state delta, since object keys are not supported by our msgpack library, https://github.com/algorand/msgpack-javascript.

Solution

Modify and release a new version of https://github.com/algorand/msgpack-javascript with support for decoding & encoding maps with object keys. Then this SDK can use the new version of that library to properly encode & decode LedgerStateDeltas.

PhearZero commented 3 weeks ago

I noticed getLedgerStateDelta and getTransactionGroupLedgerStateDeltasForRound changed back to number, was this intentional or related to the decoding issue?

jasonpaulos commented 3 weeks ago

Do you mean the arguments to those functions? If so, that was an oversight and I have a fix in #893