polkascan / py-substrate-interface

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

ValueError: query subscription requires at least one change in "chain state" #173

Closed PaTara43 closed 2 years ago

PaTara43 commented 2 years ago

If I have an empty account, never used in the network,

substrate.query("System", "Account", ["<address>"]).value

gives some output:

{'nonce': 0, 'consumers': 0, 'providers': 0, 'sufficients': 0, 'data': {'free': 0, 'reserved': 0, 'misc_frozen': 0, 'fee_frozen': 0}}

But when using subscription:

substrate.query("System", "Account", ["<address>"], subscription_handler=update_handler)

ValueError is raised: ValueError: Provided data is not in supported format: provided '<class 'NoneType'>' This is uncomfortable when we are to subscribe to some storage which is to be altered in future

arjanz commented 2 years ago

Default value of storage function will now also be decoded in case of a subscription. Will be included in next release, thanks for reporting.

PaTara43 commented 2 years ago

Awesome, thank you a lot!