File tree Expand file tree Collapse file tree 1 file changed +4
-13
lines changed
async_substrate_interface Expand file tree Collapse file tree 1 file changed +4
-13
lines changed Original file line number Diff line number Diff line change @@ -604,19 +604,11 @@ def _get_current_block_hash(
604604
605605 def load_registry (self ):
606606 # This needs to happen before init_runtime
607- metadata_rpc_result = self .rpc_request (
608- "state_call" ,
609- ["Metadata_metadata_at_version" , self .metadata_version_hex ],
610- )
611- metadata_option_hex_str = metadata_rpc_result ["result" ]
612- metadata_option_bytes = bytes .fromhex (metadata_option_hex_str [2 :])
613- self .metadata_v15 = MetadataV15 .decode_from_metadata_option (
614- metadata_option_bytes
615- )
607+ self .metadata_v15 = self ._load_registry_at_block (None )
616608 self .registry = PortableRegistry .from_metadata_v15 (self .metadata_v15 )
617609 self ._load_registry_type_map ()
618610
619- def _load_registry_at_block (self , block_hash : str ) -> MetadataV15 :
611+ def _load_registry_at_block (self , block_hash : Optional [ str ] ) -> MetadataV15 :
620612 # Should be called for any block that fails decoding.
621613 # Possibly the metadata was different.
622614 metadata_rpc_result = self .rpc_request (
@@ -626,9 +618,8 @@ def _load_registry_at_block(self, block_hash: str) -> MetadataV15:
626618 )
627619 metadata_option_hex_str = metadata_rpc_result ["result" ]
628620 metadata_option_bytes = bytes .fromhex (metadata_option_hex_str [2 :])
629- old_metadata = MetadataV15 .decode_from_metadata_option (metadata_option_bytes )
630-
631- return old_metadata
621+ metadata = MetadataV15 .decode_from_metadata_option (metadata_option_bytes )
622+ return metadata
632623
633624 def decode_scale (
634625 self ,
You can’t perform that action at this time.
0 commit comments