polkascan / py-substrate-interface

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

Use TransactionFeePaid event for fees #241

Closed arjanz closed 1 year ago

arjanz commented 1 year ago

Currently, the total_fee calculation is the sum of:

https://github.com/polkascan/py-substrate-interface/blob/4dd848fdaa09c42016378932e7b2a70f95084e5e/substrateinterface/base.py#L3351

In recent runtimes, a dedicated event is introduced (https://github.com/paritytech/substrate/issues/11595) making the prior invalid.

Have to use TransactionFeePaid when present, with fallback to current calc.