polkascan / py-substrate-interface

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

Add support for runtime calls at other blocks than the most recent. #346

Closed DamianStraszak closed 1 year ago

DamianStraszak commented 1 year ago

It's often useful to read contracts at old blocks. For this it's necessary to be able to make runtime calls at old blocks. The appropriate RPC call in substrate supports this option -- this PR is adding the support here.

I'm sorry if I missed something, like bumping version, running linter or things like that, but I wasn't sure how to do these things.

arjanz commented 1 year ago

Thanks for the PR, this is a great addition. Looks good to me, I'll merge this and schedule for next release.

There are some other contract interface changes upcoming, to keep it up to date with latest Substrate contract pallet changes (like inclusion of events in the ContractExecResult and wrapping of the read() result in a Result<Ok, Err> type, which is currently live on Rococo Contracts parachain).

arjanz commented 1 year ago

Released in https://github.com/polkascan/py-substrate-interface/releases/tag/v1.7.3