py-substrate-interface icon indicating copy to clipboard operation
py-substrate-interface copied to clipboard

Allow raw hex-bytes as input for `struct` types

Open arjanz opened this issue 4 years ago • 0 comments

Now to encode a struct type it requires a dict with elements according to its specification. For example the session key struct:

{'grandpa': '0x...', 'babe': '0x...', 'im_online': '0x...', 'authority_discovery': '0x...', 'parachains': '0x...'}

following its definition https://github.com/polkascan/py-scale-codec/blob/v0.10.77/scalecodec/type_registry/default.json#L2340

It should also be possible to allow raw hex-bytes as input, so it would be possible to enter the output of a author_rotateKeys RPC call.

arjanz avatar Apr 15 '21 10:04 arjanz