Added prevRandao to block (#3372).
This commit is contained in:
parent
501de23450
commit
ec6a754f0c
@ -129,9 +129,12 @@ const _formatBlock = object({
|
|||||||
excessBlobGas: allowNull(getBigInt, null),
|
excessBlobGas: allowNull(getBigInt, null),
|
||||||
|
|
||||||
miner: allowNull(getAddress),
|
miner: allowNull(getAddress),
|
||||||
|
prevRandao: allowNull(formatHash, null),
|
||||||
extraData: formatData,
|
extraData: formatData,
|
||||||
|
|
||||||
baseFeePerGas: allowNull(getBigInt)
|
baseFeePerGas: allowNull(getBigInt)
|
||||||
|
}, {
|
||||||
|
prevRandao: [ "mixHash" ]
|
||||||
});
|
});
|
||||||
|
|
||||||
export function formatBlock(value: any): BlockParams {
|
export function formatBlock(value: any): BlockParams {
|
||||||
|
@ -83,6 +83,12 @@ export interface BlockParams {
|
|||||||
*/
|
*/
|
||||||
miner: string;
|
miner: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The latest RANDAO mix of the post beacon state of
|
||||||
|
* the previous block.
|
||||||
|
*/
|
||||||
|
prevRandao?: null | string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Additional data the miner choose to include.
|
* Additional data the miner choose to include.
|
||||||
*/
|
*/
|
||||||
|
@ -542,6 +542,12 @@ export class Block implements BlockParams, Iterable<string> {
|
|||||||
*/
|
*/
|
||||||
readonly miner!: string;
|
readonly miner!: string;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The latest RANDAO mix of the post beacon state of
|
||||||
|
* the previous block.
|
||||||
|
*/
|
||||||
|
readonly prevRandao!: null | string;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Any extra data the validator wished to include.
|
* Any extra data the validator wished to include.
|
||||||
*/
|
*/
|
||||||
@ -592,6 +598,7 @@ export class Block implements BlockParams, Iterable<string> {
|
|||||||
blobGasUsed: block.blobGasUsed,
|
blobGasUsed: block.blobGasUsed,
|
||||||
excessBlobGas: block.excessBlobGas,
|
excessBlobGas: block.excessBlobGas,
|
||||||
miner: block.miner,
|
miner: block.miner,
|
||||||
|
prevRandao: getValue(block.prevRandao),
|
||||||
extraData: block.extraData,
|
extraData: block.extraData,
|
||||||
|
|
||||||
baseFeePerGas: getValue(block.baseFeePerGas),
|
baseFeePerGas: getValue(block.baseFeePerGas),
|
||||||
@ -640,7 +647,7 @@ export class Block implements BlockParams, Iterable<string> {
|
|||||||
toJSON(): any {
|
toJSON(): any {
|
||||||
const {
|
const {
|
||||||
baseFeePerGas, difficulty, extraData, gasLimit, gasUsed, hash,
|
baseFeePerGas, difficulty, extraData, gasLimit, gasUsed, hash,
|
||||||
miner, nonce, number, parentHash, parentBeaconBlockRoot,
|
miner, prevRandao, nonce, number, parentHash, parentBeaconBlockRoot,
|
||||||
stateRoot, receiptsRoot, timestamp, transactions
|
stateRoot, receiptsRoot, timestamp, transactions
|
||||||
} = this;
|
} = this;
|
||||||
|
|
||||||
@ -653,7 +660,7 @@ export class Block implements BlockParams, Iterable<string> {
|
|||||||
gasUsed: toJson(gasUsed),
|
gasUsed: toJson(gasUsed),
|
||||||
blobGasUsed: toJson(this.blobGasUsed),
|
blobGasUsed: toJson(this.blobGasUsed),
|
||||||
excessBlobGas: toJson(this.excessBlobGas),
|
excessBlobGas: toJson(this.excessBlobGas),
|
||||||
hash, miner, nonce, number, parentHash, timestamp,
|
hash, miner, prevRandao, nonce, number, parentHash, timestamp,
|
||||||
parentBeaconBlockRoot, stateRoot, receiptsRoot,
|
parentBeaconBlockRoot, stateRoot, receiptsRoot,
|
||||||
transactions,
|
transactions,
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user