mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 21:41:12 +00:00
events: Fetch metadata at arbitrary blocks (#727)
* subxt/rpc: Fetch metadata at arbitrary blocks Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * subxt/events: Fetch metadata for events at arbitrary blocks Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Revert "subxt/events: Fetch metadata for events at arbitrary blocks" This reverts commit 381409b7a8916611d7c44dc6ad58a90993b6c297. * subxt/events: Custom constructor with metadata for events Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> * Update subxt/src/events/events_type.rs Co-authored-by: James Wilson <james@jsdw.me> Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io> Co-authored-by: James Wilson <james@jsdw.me>
This commit is contained in:
@@ -443,10 +443,10 @@ impl<T: Config> Rpc<T> {
|
||||
}
|
||||
|
||||
/// Fetch the metadata
|
||||
pub async fn metadata(&self) -> Result<Metadata, Error> {
|
||||
pub async fn metadata(&self, at: Option<T::Hash>) -> Result<Metadata, Error> {
|
||||
let bytes: Bytes = self
|
||||
.client
|
||||
.request("state_getMetadata", rpc_params![])
|
||||
.request("state_getMetadata", rpc_params![at])
|
||||
.await?;
|
||||
let meta: RuntimeMetadataPrefixed = Decode::decode(&mut &bytes[..])?;
|
||||
let metadata: Metadata = meta.try_into()?;
|
||||
|
||||
Reference in New Issue
Block a user