V15 Metadata: Support accessing custom types (#1106)

* work in progress

* add custom types access

* nit

* custom values client

* adjust light client

* adjust doc comments

* adjust book for custom values in code gen

* format and check docs

* use ignore in docs in book
This commit is contained in:
Tadeo Hepperle
2023-08-11 14:49:29 +02:00
committed by GitHub
parent 9723a50969
commit 8ba113f368
15 changed files with 310 additions and 6 deletions
+8
View File
@@ -3,6 +3,7 @@
// see LICENSE for license details.
use super::{OfflineClient, OfflineClientT};
use crate::custom_values::CustomValuesClient;
use crate::{
blocks::BlocksClient,
constants::ConstantsClient,
@@ -18,7 +19,9 @@ use crate::{
Config, Metadata,
};
use derivative::Derivative;
use futures::future;
use std::sync::{Arc, RwLock};
/// A trait representing a client that can perform
@@ -292,6 +295,11 @@ impl<T: Config> OnlineClient<T> {
<Self as OfflineClientT<T>>::constants(self)
}
/// Access custom types.
pub fn custom_values(&self) -> CustomValuesClient<T, Self> {
<Self as OfflineClientT<T>>::custom_values(self)
}
/// Work with blocks.
pub fn blocks(&self) -> BlocksClient<T, Self> {
<Self as OfflineClientT<T>>::blocks(self)