mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-08-01 02:25:43 +00:00
22 lines
531 B
TypeScript
22 lines
531 B
TypeScript
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;
|
|
}
|
|
}
|