Update to follow DB spec

This commit is contained in:
a_bennassar
2020-07-31 15:55:09 +02:00
parent 819b29d9ba
commit 638defd031
16 changed files with 172 additions and 107 deletions

View File

@@ -1,20 +1,27 @@
package common
import (
"math/big"
eth "github.com/ethereum/go-ethereum/common"
)
// Batch is a struct that represents Hermez network batch
type Batch struct {
BatchNum BatchNum
SlotNum SlotNum // Slot in which the batch is forged
EthTxHash eth.Hash
EthBlockNum uint64 // Etherum block in which the batch is forged
Forger eth.Address
ExitRoot Hash
OldRoot Hash
NewRoot Hash
TotalAccounts uint64
BatchNum BatchNum
SlotNum SlotNum // Slot in which the batch is forged
EthTxHash eth.Hash
EthBlockNum uint64 // Ethereum block in which the batch is forged
ExitRoot Hash
OldStateRoot Hash
NewStateRoot Hash
OldNumAccounts int
NewNumAccounts int
ToForgeL1TxsNum uint32 // optional, Only when the batch forges L1 txs. Identifier that corresponds to the group of L1 txs forged in the current batch.
ToForgeL1TxsHash eth.Hash // optional, Only when the batch forges L1 txs. Frozen from pendingL1TxsHash (which are the group of L1UserTxs), to be forged in ToForgeL1TxsNum + 1.
ForgedL1TxsHash eth.Hash // optional, Only when the batch forges L1 txs. This will be the Hash of the group of L1 txs (L1UserTxs + L1CoordinatorTx) forged in the current batch.
CollectedFees map[TokenID]*big.Int
ForgerAddr eth.Address // TODO: Should this be retrieved via slot reference?
}
// BatchNum identifies a batch