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.

61 lines
1.7 KiB

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