update models

This commit is contained in:
i-norden 2023-02-10 10:06:53 -06:00
parent 57b7df4918
commit 73e148f759

View File

@ -31,9 +31,8 @@ type HeaderModel struct {
BlockHash string `db:"block_hash"` BlockHash string `db:"block_hash"`
ParentHash string `db:"parent_hash"` ParentHash string `db:"parent_hash"`
CID string `db:"cid"` CID string `db:"cid"`
MhKey string `db:"mh_key"`
TotalDifficulty string `db:"td"` TotalDifficulty string `db:"td"`
NodeID string `db:"node_id"` NodeIDs []string `db:"node_ids"`
Reward string `db:"reward"` Reward string `db:"reward"`
StateRoot string `db:"state_root"` StateRoot string `db:"state_root"`
UnclesHash string `db:"uncles_hash"` UnclesHash string `db:"uncles_hash"`
@ -41,7 +40,6 @@ type HeaderModel struct {
RctRoot string `db:"receipt_root"` RctRoot string `db:"receipt_root"`
Bloom []byte `db:"bloom"` Bloom []byte `db:"bloom"`
Timestamp uint64 `db:"timestamp"` Timestamp uint64 `db:"timestamp"`
TimesValidated int64 `db:"times_validated"`
Coinbase string `db:"coinbase"` Coinbase string `db:"coinbase"`
} }
@ -52,7 +50,6 @@ type UncleModel struct {
BlockHash string `db:"block_hash"` BlockHash string `db:"block_hash"`
ParentHash string `db:"parent_hash"` ParentHash string `db:"parent_hash"`
CID string `db:"cid"` CID string `db:"cid"`
MhKey string `db:"mh_key"`
Reward string `db:"reward"` Reward string `db:"reward"`
Index int64 `db:"index"` Index int64 `db:"index"`
} }
@ -64,10 +61,8 @@ type TxModel struct {
Index int64 `db:"index"` Index int64 `db:"index"`
TxHash string `db:"tx_hash"` TxHash string `db:"tx_hash"`
CID string `db:"cid"` CID string `db:"cid"`
MhKey string `db:"mh_key"`
Dst string `db:"dst"` Dst string `db:"dst"`
Src string `db:"src"` Src string `db:"src"`
Data []byte `db:"tx_data"`
Type uint8 `db:"tx_type"` Type uint8 `db:"tx_type"`
Value string `db:"value"` Value string `db:"value"`
} }
@ -86,63 +81,39 @@ type ReceiptModel struct {
BlockNumber string `db:"block_number"` BlockNumber string `db:"block_number"`
HeaderID string `db:"header_id"` HeaderID string `db:"header_id"`
TxID string `db:"tx_id"` TxID string `db:"tx_id"`
LeafCID string `db:"leaf_cid"` CID string `db:"cid"`
LeafMhKey string `db:"leaf_mh_key"`
PostStatus uint64 `db:"post_status"` PostStatus uint64 `db:"post_status"`
PostState string `db:"post_state"` PostState string `db:"post_state"`
Contract string `db:"contract"` Contract string `db:"contract"`
ContractHash string `db:"contract_hash"` ContractHash string `db:"contract_hash"`
LogRoot string `db:"log_root"`
} }
// StateNodeModel is the db model for eth.state_cids // StateNodeModel is the db model for eth.state_cids
type StateNodeModel struct { type StateNodeModel struct {
BlockNumber string `db:"block_number"` BlockNumber string `db:"block_number"`
HeaderID string `db:"header_id"` HeaderID string `db:"header_id"`
Path []byte `db:"state_path"` Path []byte `db:"partial_path"`
StateKey string `db:"state_leaf_key"` StateKey string `db:"state_leaf_key"`
NodeType int `db:"node_type"` Removed bool `db:"removed"`
CID string `db:"cid"` CID string `db:"cid"`
MhKey string `db:"mh_key"`
Diff bool `db:"diff"` Diff bool `db:"diff"`
Balance string `db:"balance"`
Nonce uint64 `db:"nonce"`
CodeHash []byte `db:"code_hash"`
StorageRoot string `db:"storage_root"`
} }
// StorageNodeModel is the db model for eth.storage_cids // StorageNodeModel is the db model for eth.storage_cids
type StorageNodeModel struct { type StorageNodeModel struct {
BlockNumber string `db:"block_number"` BlockNumber string `db:"block_number"`
HeaderID string `db:"header_id"` HeaderID string `db:"header_id"`
StatePath []byte `db:"state_path"` StateKey []byte `db:"state_leaf_key"`
Path []byte `db:"storage_path"` Path []byte `db:"partial_path"`
StorageKey string `db:"storage_leaf_key"` StorageKey string `db:"storage_leaf_key"`
NodeType int `db:"node_type"` Removed bool `db:"removed"`
CID string `db:"cid"` CID string `db:"cid"`
MhKey string `db:"mh_key"`
Diff bool `db:"diff"` Diff bool `db:"diff"`
} Value []byte `db:"val"`
// StorageNodeWithStateKeyModel is a db model for eth.storage_cids + eth.state_cids.state_key
type StorageNodeWithStateKeyModel struct {
BlockNumber string `db:"block_number"`
HeaderID string `db:"header_id"`
StatePath []byte `db:"state_path"`
Path []byte `db:"storage_path"`
StateKey string `db:"state_leaf_key"`
StorageKey string `db:"storage_leaf_key"`
NodeType int `db:"node_type"`
CID string `db:"cid"`
MhKey string `db:"mh_key"`
Diff bool `db:"diff"`
}
// StateAccountModel is a db model for an eth state account (decoded value of state leaf node)
type StateAccountModel struct {
BlockNumber string `db:"block_number"`
HeaderID string `db:"header_id"`
StatePath []byte `db:"state_path"`
Balance string `db:"balance"`
Nonce uint64 `db:"nonce"`
CodeHash []byte `db:"code_hash"`
StorageRoot string `db:"storage_root"`
} }
// LogsModel is the db model for eth.logs // LogsModel is the db model for eth.logs
@ -150,21 +121,11 @@ type LogsModel struct {
BlockNumber string `db:"block_number"` BlockNumber string `db:"block_number"`
HeaderID string `db:"header_id"` HeaderID string `db:"header_id"`
ReceiptID string `db:"rct_id"` ReceiptID string `db:"rct_id"`
LeafCID string `db:"leaf_cid"` CID string `db:"cid"`
LeafMhKey string `db:"leaf_mh_key"`
Address string `db:"address"` Address string `db:"address"`
Index int64 `db:"index"` Index int64 `db:"index"`
Data []byte `db:"log_data"`
Topic0 string `db:"topic0"` Topic0 string `db:"topic0"`
Topic1 string `db:"topic1"` Topic1 string `db:"topic1"`
Topic2 string `db:"topic2"` Topic2 string `db:"topic2"`
Topic3 string `db:"topic3"` Topic3 string `db:"topic3"`
} }
// KnownGaps is the data structure for eth_meta.known_gaps
type KnownGapsModel struct {
StartingBlockNumber string `db:"starting_block_number"`
EndingBlockNumber string `db:"ending_block_number"`
CheckedOut bool `db:"checked_out"`
ProcessingKey int64 `db:"processing_key"`
}