Prep subxt-historic 0.0.7 release: expose ClientAtBlock bits (#2138)

This commit is contained in:
James Wilson
2025-12-03 18:45:16 +00:00
committed by GitHub
parent eee2fd5c6e
commit 24ccd584f1
6 changed files with 22 additions and 13 deletions
Generated
+1 -1
View File
@@ -5739,7 +5739,7 @@ dependencies = [
[[package]]
name = "subxt-historic"
version = "0.0.6"
version = "0.0.7"
dependencies = [
"frame-decode",
"frame-metadata 23.0.0",
+18
View File
@@ -4,6 +4,24 @@ 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.7 (2025-12-03)
Expose `OfflineClientAtBlock`, `OfflineClientAtBlockT`, `OnlinelientAtBlock`, `OnlineClientAtBlockT`.
This is so that you can pass the `ClientAtBlock` into functions like so:
```rust
use subxt_historic::config::Config;
use subxt_historic::client::{ ClientAtBlock, OnlineClientAtBlock, OnlineClientAtBlockT };
fn accepts_client_at_block_concrete<T: Config>(client: &ClientAtBlock<OnlineClientAtBlock<'_, T>, T>) {
// ...
}
fn accepts_client_at_block_generic<'conf, T: Config + 'conf, C: OnlineClientAtBlockT<'conf, T>>(client: &ClientAtBlock<C, T>) {
// ...
}
```
## 0.0.6 (2025-12-01)
- Add `.metadata()` on `ClientAtBlock` to expose the current metadata at some block.
+1 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "subxt-historic"
version = "0.0.6"
version = "0.0.7"
authors.workspace = true
edition.workspace = true
rust-version.workspace = true
+2 -7
View File
@@ -7,13 +7,8 @@ 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,
// and instead only the concrete types are public which wrap these trait impls.
pub(crate) use offline_client::OfflineClientAtBlockT;
pub(crate) use online_client::OnlineClientAtBlockT;
pub use offline_client::OfflineClient;
pub use online_client::OnlineClient;
pub use offline_client::{OfflineClient, OfflineClientAtBlock, OfflineClientAtBlockT};
pub use online_client::{OnlineClient, OnlineClientAtBlock, OnlineClientAtBlockT};
/// This represents a client at a specific block number.
pub struct ClientAtBlock<Client, T> {
-2
View File
@@ -47,7 +47,6 @@ impl<T: Config> OfflineClient<T> {
}
/// This represents an offline-only client at a specific block.
#[doc(hidden)]
pub trait OfflineClientAtBlockT<'client, T: Config + 'client> {
/// Get the configuration for this client.
fn config(&self) -> &'client T;
@@ -60,7 +59,6 @@ pub trait OfflineClientAtBlockT<'client, T: Config + 'client> {
// Dev note: this shouldn't need to be exposed unless there is some
// need to explicitly name the ClientAAtBlock type. Rather keep it
// private to allow changes if possible.
#[doc(hidden)]
pub struct OfflineClientAtBlock<'client, T: Config + 'client> {
/// The configuration for this chain.
config: &'client T,
-2
View File
@@ -151,7 +151,6 @@ impl<T: Config> OnlineClient<T> {
}
/// This represents an online client at a specific block.
#[doc(hidden)]
pub trait OnlineClientAtBlockT<'client, T: Config + 'client>:
OfflineClientAtBlockT<'client, T>
{
@@ -164,7 +163,6 @@ pub trait OnlineClientAtBlockT<'client, T: Config + 'client>:
// Dev note: this shouldn't need to be exposed unless there is some
// need to explicitly name the ClientAAtBlock type. Rather keep it
// private to allow changes if possible.
#[doc(hidden)]
pub struct OnlineClientAtBlock<'client, T: Config + 'client> {
/// The configuration for this chain.
config: &'client T,