You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.5 KiB

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