ChainData
Static Method Summary
Static Public Methods | ||
public static |
fromObj(obj: {_head: Uint8Array, _totalDifficulty: string, _totalWork: string, _superBlockCounts: Array<number>, _onMainChain: boolean, _mainChainSuccessor: ?Uint8Array, _height: number, _pow: Uint8Array}, hashBase64: string): ChainData |
|
public static |
async initial(block: Block, superBlockCounts: SuperBlockCounts): Promise<ChainData> |
Constructor Summary
Public Constructor | ||
public |
constructor(head: Block, totalDifficulty: BigNumber, totalWork: BigNumber, superBlockCounts: SuperBlockCounts, onMainChain: boolean, mainChainSuccessor: Hash) |
Member Summary
Public Members | ||
public get |
|
|
public get |
|
|
public set |
|
|
public get |
onMainChain: boolean |
|
public set |
onMainChain: boolean |
|
public get |
|
|
public get |
|
|
public get |
|
Method Summary
Public Methods | ||
public |
async nextChainData(block: Block): Promise<ChainData> |
|
public |
async previousChainData(block: Block): Promise<ChainData> |
|
public |
|
|
public |
toObj(): {_head: SerialBuffer, _totalDifficulty: string, _totalWork: string, _superBlockCounts: Array<number>, _onMainChain: boolean, _mainChainSuccessor: ?SerialBuffer, _height: number, _pow: SerialBuffer} |
Static Public Methods
public static fromObj(obj: {_head: Uint8Array, _totalDifficulty: string, _totalWork: string, _superBlockCounts: Array<number>, _onMainChain: boolean, _mainChainSuccessor: ?Uint8Array, _height: number, _pow: Uint8Array}, hashBase64: string): ChainData source
Params:
Name | Type | Attribute | Description |
obj | {_head: Uint8Array, _totalDifficulty: string, _totalWork: string, _superBlockCounts: Array<number>, _onMainChain: boolean, _mainChainSuccessor: ?Uint8Array, _height: number, _pow: Uint8Array} | ||
hashBase64 | string |
|
public static async initial(block: Block, superBlockCounts: SuperBlockCounts): Promise<ChainData> source
Params:
Name | Type | Attribute | Description |
block | Block | ||
superBlockCounts | SuperBlockCounts |
|
Public Constructors
public constructor(head: Block, totalDifficulty: BigNumber, totalWork: BigNumber, superBlockCounts: SuperBlockCounts, onMainChain: boolean, mainChainSuccessor: Hash) source
Params:
Name | Type | Attribute | Description |
head | Block | ||
totalDifficulty | BigNumber | ||
totalWork | BigNumber | ||
superBlockCounts | SuperBlockCounts | ||
onMainChain | boolean |
|
|
mainChainSuccessor | Hash |
|
Public Members
public get onMainChain: boolean source
public set onMainChain: boolean source
public get superBlockCounts: SuperBlockCounts source
Public Methods
public async nextChainData(block: Block): Promise<ChainData> source
Params:
Name | Type | Attribute | Description |
block | Block |
public async previousChainData(block: Block): Promise<ChainData> source
Params:
Name | Type | Attribute | Description |
block | Block |
public toObj(): {_head: SerialBuffer, _totalDifficulty: string, _totalWork: string, _superBlockCounts: Array<number>, _onMainChain: boolean, _mainChainSuccessor: ?SerialBuffer, _height: number, _pow: SerialBuffer} source
Return:
{_head: SerialBuffer, _totalDifficulty: string, _totalWork: string, _superBlockCounts: Array<number>, _onMainChain: boolean, _mainChainSuccessor: ?SerialBuffer, _height: number, _pow: SerialBuffer} |