This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from substrateinterface import SubstrateInterface | |
substrate = SubstrateInterface( | |
# url="wss://kusama-rpc.polkadot.io", | |
url="wss://kusama-rpc.dwellir.com", | |
) | |
block_number = 16799223 | |
block_hash = substrate.get_block_hash(block_number) | |
# block_hash = substrate.get_block_header()['header']['number'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// Provides a way to prefix both `Ok` and `Err` variants of a `Result`. | |
/// | |
/// This trait allows you to attach a prefix to both the `Ok` and `Err` variants | |
/// of a `Result`, making it easier to track additional contextual information | |
/// alongside the original result. It is especially handy when `P` does not implement | |
/// `Clone` and `Copy`. | |
pub trait PrefixedResult<T, E> { | |
/// Maps this `Result` to a new `Result` with a prefixed value. | |
/// | |
/// Takes a value of any type `P` as a prefix and an `FnOnce` closure `O` |