parent
ab806cad15
commit
a48552a4fb
@ -56,7 +56,7 @@ export interface TransactionResponse extends Transaction {
|
||||
|
||||
export type BlockTag = string | number;
|
||||
|
||||
interface _Block {
|
||||
export interface _Block {
|
||||
hash: string;
|
||||
parentHash: string;
|
||||
number: number;
|
||||
@ -64,6 +64,7 @@ interface _Block {
|
||||
timestamp: number;
|
||||
nonce: string;
|
||||
difficulty: number;
|
||||
_difficulty: BigNumber;
|
||||
|
||||
gasLimit: BigNumber;
|
||||
gasUsed: BigNumber;
|
||||
|
@ -295,7 +295,11 @@ export class Formatter {
|
||||
if (value.author != null && value.miner == null) {
|
||||
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user