2018-11-07 21:50:43 +00:00
|
|
|
// VulcanizeDB
|
2019-03-12 15:46:42 +00:00
|
|
|
// Copyright © 2019 Vulcanize
|
2018-11-07 21:50:43 +00:00
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU Affero General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
// You should have received a copy of the GNU Affero General Public License
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2018-07-17 21:23:07 +00:00
|
|
|
package core
|
|
|
|
|
2018-11-15 18:53:08 +00:00
|
|
|
import (
|
|
|
|
"github.com/ethereum/go-ethereum/common"
|
|
|
|
"github.com/ethereum/go-ethereum/common/hexutil"
|
|
|
|
"github.com/ethereum/go-ethereum/core/types"
|
|
|
|
)
|
|
|
|
|
2018-07-17 21:23:07 +00:00
|
|
|
type Header struct {
|
2019-10-18 16:16:19 +00:00
|
|
|
ID int64
|
2018-07-17 21:23:07 +00:00
|
|
|
BlockNumber int64 `db:"block_number"`
|
|
|
|
Hash string
|
|
|
|
Raw []byte
|
2018-11-15 18:53:08 +00:00
|
|
|
Timestamp string `db:"block_timestamp"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type POAHeader struct {
|
|
|
|
ParentHash common.Hash `json:"parentHash" gencodec:"required"`
|
|
|
|
UncleHash common.Hash `json:"sha3Uncles" gencodec:"required"`
|
|
|
|
Coinbase common.Address `json:"miner" gencodec:"required"`
|
|
|
|
Root common.Hash `json:"stateRoot" gencodec:"required"`
|
|
|
|
TxHash common.Hash `json:"transactionsRoot" gencodec:"required"`
|
|
|
|
ReceiptHash common.Hash `json:"receiptsRoot" gencodec:"required"`
|
|
|
|
Bloom types.Bloom `json:"logsBloom" gencodec:"required"`
|
|
|
|
Difficulty *hexutil.Big `json:"difficulty" gencodec:"required"`
|
|
|
|
Number *hexutil.Big `json:"number" gencodec:"required"`
|
|
|
|
GasLimit hexutil.Uint64 `json:"gasLimit" gencodec:"required"`
|
|
|
|
GasUsed hexutil.Uint64 `json:"gasUsed" gencodec:"required"`
|
2019-07-15 22:08:40 +00:00
|
|
|
Time hexutil.Uint64 `json:"timestamp" gencodec:"required"`
|
2018-11-15 18:53:08 +00:00
|
|
|
Extra hexutil.Bytes `json:"extraData" gencodec:"required"`
|
|
|
|
Hash common.Hash `json:"hash"`
|
2018-07-17 21:23:07 +00:00
|
|
|
}
|