polkascan / py-substrate-interface

Python Substrate Interface
https://polkascan.github.io/py-substrate-interface/
Apache License 2.0
240 stars 116 forks source link

Unable to call custom types for storage #81

Closed afeezaziz closed 3 years ago

afeezaziz commented 3 years ago

In the example of

native_pair = substrate.query( module='Exchange', storage_function='PairNative', params=[0])

where 0 is a custom type PairNative which is U128, I am unable to get the result but getting scalecodec.exceptions.RemainingScaleBytesNotEmptyException:. I have passed the custom types as custom_type_registry = load_type_registry_file("api/custom.json") to enable to load the custom types. This only happens in storage but not extrinsics weirdly so.

arjanz commented 3 years ago

I have no context of your runtime, so it's impossible for me to debug, but a wild guess could be is to check if PairNative is not actually a Compact<U128>?