mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 16:51:03 +00:00
Check the genesis hash in transactions regardless of era. (#3286)
* Check the genesis hash in transactions regardless of era. * Fix check-fees, too. * Undo. * Subkey supports new signing. * Remove unneeded type param. * Bump tx version * Build. * Another build fix * Build again * Cleanup * Another fix. * Fix * Fixes * 6 second blocks. * Fixes * Build fix * Fix * Fix.
This commit is contained in:
@@ -122,32 +122,6 @@ impl<T> Lookup for IdentityLookup<T> {
|
||||
fn lookup(&self, x: T) -> result::Result<T, &'static str> { Ok(x) }
|
||||
}
|
||||
|
||||
/// Get the "current" block number.
|
||||
pub trait CurrentHeight {
|
||||
/// The type of the block number.
|
||||
type BlockNumber;
|
||||
|
||||
/// Return the current block number. Not allowed to fail.
|
||||
fn current_height(&self) -> Self::BlockNumber;
|
||||
}
|
||||
|
||||
/// Translate a block number into a hash.
|
||||
pub trait BlockNumberToHash {
|
||||
/// The type of the block number.
|
||||
type BlockNumber: Zero;
|
||||
|
||||
/// The type of the hash.
|
||||
type Hash: Encode;
|
||||
|
||||
/// Get the hash for a given block number, or `None` if unknown.
|
||||
fn block_number_to_hash(&self, n: Self::BlockNumber) -> Option<Self::Hash>;
|
||||
|
||||
/// Get the genesis block hash; this should always be known.
|
||||
fn genesis_hash(&self) -> Self::Hash {
|
||||
self.block_number_to_hash(Zero::zero()).expect("All blockchains must know their genesis block hash; qed")
|
||||
}
|
||||
}
|
||||
|
||||
/// Extensible conversion trait. Generic over both source and destination types.
|
||||
pub trait Convert<A, B> {
|
||||
/// Make conversion.
|
||||
|
||||
Reference in New Issue
Block a user