add prevrandao to result

This commit is contained in:
Sina Mahmoodi 2023-09-05 13:37:36 +02:00
parent 7e17e4cf3a
commit fe3bb832bf

View file

@ -1193,6 +1193,7 @@ type blockResult struct {
GasUsed hexutil.Uint64 `json:"gasUsed"` GasUsed hexutil.Uint64 `json:"gasUsed"`
FeeRecipient common.Address `json:"feeRecipient"` FeeRecipient common.Address `json:"feeRecipient"`
BaseFee *hexutil.Big `json:"baseFeePerGas"` BaseFee *hexutil.Big `json:"baseFeePerGas"`
PrevRandao common.Hash `json:"prevRandao"`
Calls []callResult `json:"calls"` Calls []callResult `json:"calls"`
} }
@ -1275,6 +1276,9 @@ func (s *BlockChainAPI) MulticallV1(ctx context.Context, opts multicallOpts, blo
BaseFee: (*hexutil.Big)(blockContext.BaseFee), BaseFee: (*hexutil.Big)(blockContext.BaseFee),
Calls: make([]callResult, len(block.Calls)), Calls: make([]callResult, len(block.Calls)),
} }
if blockContext.Random != nil {
results[bi].PrevRandao = *blockContext.Random
}
gasUsed := uint64(0) gasUsed := uint64(0)
for i, call := range block.Calls { for i, call := range block.Calls {
vmConfig := &vm.Config{ vmConfig := &vm.Config{