state account support and add roots and additional metadata to header

index
This commit is contained in:
Ian Norden
2020-03-21 20:57:02 -05:00
parent 57bdcca43c
commit ba5d6f9b9f
7 changed files with 242 additions and 16 deletions
+16
View File
@@ -28,6 +28,12 @@ type HeaderModel struct {
TotalDifficulty string `db:"td"`
NodeID int64 `db:"node_id"`
Reward string `db:"reward"`
StateRoot string `db:"state_root"`
UncleRoot string `db:"uncle_root"`
TxRoot string `db:"tx_root"`
RctRoot string `db:"receipt_root"`
Bloom []byte `db:"bloom"`
Timestamp uint64 `db:"timestamp"`
}
// UncleModel is the db model for eth.uncle_cids
@@ -93,3 +99,13 @@ type StorageNodeWithStateKeyModel struct {
NodeType int `db:"node_type"`
CID string `db:"cid"`
}
// StateAccountModel is a db model for an eth state account (decoded value of state leaf node)
type StateAccountModel struct {
ID int64 `db:"id"`
StateID int64 `db:"state_id"`
Balance string `db:"balance"`
Nonce uint64 `db:"nonce"`
CodeHash []byte `db:"code_hash"`
StorageRoot string `db:"storage_root"`
}