Skip to content

Conversation

@jsdw
Copy link
Collaborator

@jsdw jsdw commented Mar 17, 2023

This builds off #842, which in itself doesn't make any significant API changes, but starts relying on EncodeAsType and DecodeAsType, and applying thesein codegen.

Here, we now start consolidating some API's and making use of this; specifically:

  • StaticTxPayload and DynamicTxPayload are now one struct, tx::Payload.
  • StaticStorageAddress and DynamicStorageAddress are now on struct, storage::Address.
  • StaticConstantAddress and DynamicConstantAddress are now on struct, constant::Address.

For storage, we needed to tweak the API around obtaining bytes from a storage entry (to allow metadata to be used). We also were able to simplify the storage codegen (no more need for Hashers in the codegen; we will work out the hashing based on metadata at the point of calling).

Finally I did a little tidyup in the codegen around substitute types, and no longer generate a top level event type, instead pointing to the one that's provided. This paves the way to swap out the RuntimeCall type with a tx::BoxedPayload to make nested calls (batch, multisig, sudo etc) as ergonomic as top level ones, but actually doing that work has some implicaitions so I want to look into it separately.

@jsdw jsdw marked this pull request as draft March 17, 2023 09:35
@jsdw jsdw merged commit c377ff7 into jsdw-scale-encode-decode Mar 17, 2023
@jsdw jsdw deleted the jsdw-encode-decode-improvements branch March 17, 2023 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants