parent
ab806cad15
commit
a48552a4fb
@ -56,7 +56,7 @@ export interface TransactionResponse extends Transaction {
|
|||||||
|
|
||||||
export type BlockTag = string | number;
|
export type BlockTag = string | number;
|
||||||
|
|
||||||
interface _Block {
|
export interface _Block {
|
||||||
hash: string;
|
hash: string;
|
||||||
parentHash: string;
|
parentHash: string;
|
||||||
number: number;
|
number: number;
|
||||||
@ -64,6 +64,7 @@ interface _Block {
|
|||||||
timestamp: number;
|
timestamp: number;
|
||||||
nonce: string;
|
nonce: string;
|
||||||
difficulty: number;
|
difficulty: number;
|
||||||
|
_difficulty: BigNumber;
|
||||||
|
|
||||||
gasLimit: BigNumber;
|
gasLimit: BigNumber;
|
||||||
gasUsed: BigNumber;
|
gasUsed: BigNumber;
|
||||||
|
@ -295,7 +295,11 @@ export class Formatter {
|
|||||||
if (value.author != null && value.miner == null) {
|
if (value.author != null && value.miner == null) {
|
||||||
value.miner = value.author;
|
value.miner = value.author;
|
||||||
}
|
}
|
||||||
return Formatter.check(format, value);
|
// The difficulty may need to come from _difficulty in recursed blocks
|
||||||
|
const difficulty = (value._difficulty != null) ? value._difficulty: value.difficulty;
|
||||||
|
const result = Formatter.check(format, value);
|
||||||
|
result._difficulty = ((difficulty == null) ? null: BigNumber.from(difficulty));
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
block(value: any): Block {
|
block(value: any): Block {
|
||||||
|
Loading…
Reference in New Issue
Block a user