subxt-historic: expose metadata at a given block (#2135)

This commit is contained in:
James Wilson
2025-12-01 17:10:42 +00:00
committed by GitHub
parent 291af82a75
commit eee2fd5c6e
4 changed files with 12 additions and 2 deletions
Generated
+1 -1
View File
@@ -5739,7 +5739,7 @@ dependencies = [
[[package]] [[package]]
name = "subxt-historic" name = "subxt-historic"
version = "0.0.5" version = "0.0.6"
dependencies = [ dependencies = [
"frame-decode", "frame-decode",
"frame-metadata 23.0.0", "frame-metadata 23.0.0",
+4
View File
@@ -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. 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) ## 0.0.5 (2025-11-21)
- Rename some fields for consistency. - Rename some fields for consistency.
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "subxt-historic" name = "subxt-historic"
version = "0.0.5" version = "0.0.6"
authors.workspace = true authors.workspace = true
edition.workspace = true edition.workspace = true
rust-version.workspace = true rust-version.workspace = true
+6
View File
@@ -4,6 +4,7 @@ mod online_client;
use crate::config::Config; use crate::config::Config;
use crate::extrinsics::ExtrinsicsClient; use crate::extrinsics::ExtrinsicsClient;
use crate::storage::StorageClient; use crate::storage::StorageClient;
use frame_metadata::RuntimeMetadata;
use std::marker::PhantomData; use std::marker::PhantomData;
// We keep these traits internal, so that we can mess with them later if needed, // 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> { pub fn storage(&'_ self) -> StorageClient<'_, Client, T> {
StorageClient::new(&self.client) StorageClient::new(&self.client)
} }
/// Return the metadata in use at this block.
pub fn metadata(&self) -> &RuntimeMetadata {
self.client.metadata()
}
} }