add timestamp in v2 block response (#290)

This commit is contained in:
Banana-J 2023-07-15 11:33:36 +10:00 committed by GitHub
parent 96f28b8bc6
commit 2c1aba814e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -41,6 +41,7 @@ type V2BlockInfo struct {
ParentHash common.Hash ParentHash common.Hash
Committed bool Committed bool
Miner common.Hash Miner common.Hash
Timestamp *big.Int
EncodedRLP string EncodedRLP string
Error string Error string
} }
@ -209,6 +210,7 @@ func (api *API) GetV2BlockByHeader(header *types.Header, uncle bool) *V2BlockInf
Round: round, Round: round,
Committed: committed, Committed: committed,
Miner: header.Coinbase.Hash(), Miner: header.Coinbase.Hash(),
Timestamp: header.Time,
EncodedRLP: base64.StdEncoding.EncodeToString(encodeBytes), EncodedRLP: base64.StdEncoding.EncodeToString(encodeBytes),
} }
return block return block