From eee2fd5c6e59297488da853ff03e5b13fd3812f7 Mon Sep 17 00:00:00 2001 From: James Wilson Date: Mon, 1 Dec 2025 17:10:42 +0000 Subject: [PATCH] subxt-historic: expose metadata at a given block (#2135) --- Cargo.lock | 2 +- historic/CHANGELOG.md | 4 ++++ historic/Cargo.toml | 2 +- historic/src/client.rs | 6 ++++++ 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 354b785305..0adf1d877b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5739,7 +5739,7 @@ dependencies = [ [[package]] name = "subxt-historic" -version = "0.0.5" +version = "0.0.6" dependencies = [ "frame-decode", "frame-metadata 23.0.0", diff --git a/historic/CHANGELOG.md b/historic/CHANGELOG.md index 5e878f5946..7ad06bc68a 100644 --- a/historic/CHANGELOG.md +++ b/historic/CHANGELOG.md @@ -4,6 +4,10 @@ This is separate from the Subxt changelog as subxt-historic is currently releasa Eventually this project will merge with Subxt and no longer exist, but until then it's being maintained and updated where needed. +## 0.0.6 (2025-12-01) + +- Add `.metadata()` on `ClientAtBlock` to expose the current metadata at some block. + ## 0.0.5 (2025-11-21) - Rename some fields for consistency. diff --git a/historic/Cargo.toml b/historic/Cargo.toml index d0a93ca487..0785b18a41 100644 --- a/historic/Cargo.toml +++ b/historic/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "subxt-historic" -version = "0.0.5" +version = "0.0.6" authors.workspace = true edition.workspace = true rust-version.workspace = true diff --git a/historic/src/client.rs b/historic/src/client.rs index 7555381605..b2fe9fb7d2 100644 --- a/historic/src/client.rs +++ b/historic/src/client.rs @@ -4,6 +4,7 @@ mod online_client; use crate::config::Config; use crate::extrinsics::ExtrinsicsClient; use crate::storage::StorageClient; +use frame_metadata::RuntimeMetadata; use std::marker::PhantomData; // We keep these traits internal, so that we can mess with them later if needed, @@ -44,4 +45,9 @@ where pub fn storage(&'_ self) -> StorageClient<'_, Client, T> { StorageClient::new(&self.client) } + + /// Return the metadata in use at this block. + pub fn metadata(&self) -> &RuntimeMetadata { + self.client.metadata() + } }