Merge branch 'master' into jsdw-subxt-new

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