mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-11-07 19:31:07 +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:
1 parent
523534464f
commit
1c9aabf0f5
4 files changed
+68
-11
No files matched your search
@@ -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