Skip to content

Add Runtime API and dynamic examples, and util methods to StorageKeyPart#2161

Merged
jsdw merged 2 commits intomasterfrom
jsdw-add-examples
Feb 2, 2026
Merged

Add Runtime API and dynamic examples, and util methods to StorageKeyPart#2161
jsdw merged 2 commits intomasterfrom
jsdw-add-examples

Conversation

@jsdw
Copy link
Collaborator

@jsdw jsdw commented Jan 30, 2026

The dynamic example shows how to use the subxt::dynamic::* functions to interact with storage, constants, runtime APIs and transacitons. This is the sort of usage that's super common when accessing historic blocks etc.

The runtime_apis example shows how to call a couple of Runtime APIs.

I added a couple of helpers on the StorageKeyPart struct:

  • key_part.hash_bytes(): return the bytes for the hash
  • key_part.value_bytes(): return the bytes for the value.

It was already possible to decode the value, and so it made ense to be able to access the bytes for the value too (for instance if you want to codec::Decode them into some type rather than DecodeAsType them.

@jsdw jsdw requested a review from a team as a code owner January 30, 2026 16:11
@jsdw jsdw merged commit 6852bf5 into master Feb 2, 2026
20 checks passed
@jsdw jsdw deleted the jsdw-add-examples branch February 2, 2026 16:41
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.

1 participant