hermez-node/coordinator/batch.go
coordinator/batch.goRaw
1package coordinator
2
3import (
4 "github.com/hermeznetwork/hermez-node/common"
5)
6
7// Proof TBD this type will be received from the proof server
8type Proof struct {
9}
10
11// BatchInfo contans the Batch information
12type BatchInfo struct {
13 batchNum common.BatchNum
14 serverProof ServerProofInterface
15 zkInputs *common.ZKInputs
16 proof *Proof
17 L1UserTxsExtra []*common.L1Tx
18 L1OperatorTxs []*common.L1Tx
19 L2Txs []*common.PoolL2Tx
20 // FeesInfo
21}
22
23// NewBatchInfo creates a new BatchInfo with the given batchNum &
24// ServerProof
25func NewBatchInfo(batchNum common.BatchNum, serverProof ServerProofInterface) BatchInfo {
26 return BatchInfo{
27 batchNum: batchNum,
28 serverProof: serverProof,
29 }
30}
31
32// SetTxsInfo sets the l1UserTxs, l1OperatorTxs and l2Txs to the BatchInfo data
33// structure
34func (bi *BatchInfo) SetTxsInfo(l1UserTxsExtra, l1OperatorTxs []*common.L1Tx, l2Txs []*common.PoolL2Tx) {
35 // TBD parameter: feesInfo
36 bi.L1UserTxsExtra = l1UserTxsExtra
37 bi.L1OperatorTxs = l1OperatorTxs
38 bi.L2Txs = l2Txs
39}
40
41// SetZKInputs sets the ZKInputs to the BatchInfo data structure
42func (bi *BatchInfo) SetZKInputs(zkInputs *common.ZKInputs) {
43 bi.zkInputs = zkInputs
44}
45
46// SetServerProof sets the ServerProof to the BatchInfo data structure
47func (bi *BatchInfo) SetServerProof(serverProof ServerProofInterface) {
48 bi.serverProof = serverProof
49}
50
51// SetProof sets the Proof to the BatchInfo data structure
52func (bi *BatchInfo) SetProof(proof *Proof) {
53 bi.proof = proof
54}