shawntabrizi / substrate-js-utilities

A set of useful JavaScript utilities for Substrate using Polkadot.js API
https://www.shawntabrizi.com/substrate-js-utilities/
MIT License
29 stars 20 forks source link

SCALE decoding of Compact<u32> wrong #13

Open brenzi opened 5 months ago

brenzi commented 5 months ago

Along https://docs.substrate.io/reference/scale-codec/#fn-1

Compact encoded as 0x1501

should be decoded as decimal 69

but if I use this https://www.shawntabrizi.com/substrate-js-utilities/codec/ with

[
  {
    "nonce": "Compact<u32>"
  }
]

I get 5377

shawntabrizi commented 5 months ago

@brenzi don't have an answer to this one. If you look at my code, I am just funneling the input to Polkadot JS.

It seems it is not registering the compact stuff correctly.