Closed arjanz closed 2 years ago
For variant type definitions in the PortableRegistry with named fields, for example:
PortableRegistry
{'name': 'Deposit', 'fields': [{'name': 'who', 'type': 0, 'typeName': 'T::AccountId', 'docs': []}, {'name': 'amount', 'type': 6, 'typeName': 'T::Balance', 'docs': []}], 'index': 7, 'docs': ['Some amount was deposited (e.g. for transaction fees).']}
were until now converted to tuples, discarding the name of the field.
name
Proposal is to use structs in stead of tuples when names are defined.
For example the attributes of the event Balances.Deposit:
Balances.Deposit
was ('F3opxRbN5ZbjJNU511Kj2TLuzFcDq9BGduA9TgiECafpg29', 33599708)
('F3opxRbN5ZbjJNU511Kj2TLuzFcDq9BGduA9TgiECafpg29', 33599708)
and will now be {'who': 'F3opxRbN5ZbjJNU511Kj2TLuzFcDq9BGduA9TgiECafpg29', 'amount': 33599708}
{'who': 'F3opxRbN5ZbjJNU511Kj2TLuzFcDq9BGduA9TgiECafpg29', 'amount': 33599708}
https://github.com/polkascan/py-scale-codec/commit/ad2f86db8a71582ca68126d0adb1892facb3339a
For variant type definitions in the
PortableRegistry
with named fields, for example:{'name': 'Deposit', 'fields': [{'name': 'who', 'type': 0, 'typeName': 'T::AccountId', 'docs': []}, {'name': 'amount', 'type': 6, 'typeName': 'T::Balance', 'docs': []}], 'index': 7, 'docs': ['Some amount was deposited (e.g. for transaction fees).']}
were until now converted to tuples, discarding the
name
of the field.Proposal is to use structs in stead of tuples when names are defined.
For example the attributes of the event
Balances.Deposit
:was
('F3opxRbN5ZbjJNU511Kj2TLuzFcDq9BGduA9TgiECafpg29', 33599708)
and will now be
{'who': 'F3opxRbN5ZbjJNU511Kj2TLuzFcDq9BGduA9TgiECafpg29', 'amount': 33599708}