mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-08-01 22:15:43 +00:00
Add finalized block info (#104)
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { Types } from '@dotstats/common';
|
||||
|
||||
export default class Block {
|
||||
public static readonly ZERO = new Block(0 as Types.BlockNumber, '' as Types.BlockHash);
|
||||
|
||||
public readonly number: Types.BlockNumber;
|
||||
public readonly hash: Types.BlockHash;
|
||||
|
||||
constructor(number: Types.BlockNumber, hash: Types.BlockHash) {
|
||||
this.number = number;
|
||||
this.hash = hash;
|
||||
}
|
||||
|
||||
gt(other: Block): boolean {
|
||||
return this.number > other.number;
|
||||
}
|
||||
|
||||
eq(other: Block): boolean {
|
||||
return this.number === other.number && this.hash === other.hash;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user