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.

39 lines
950 B

  1. package coordinator
  2. import (
  3. "github.com/hermeznetwork/hermez-node/common"
  4. "github.com/hermeznetwork/hermez-node/log"
  5. )
  6. // ServerProofInfo contains the data related to a ServerProof
  7. type ServerProofInfo struct {
  8. // TODO
  9. Available bool
  10. }
  11. // CalculateProof sends the *common.ZKInputs to the ServerProof to compute the
  12. // Proof
  13. func (p *ServerProofInfo) CalculateProof(zkInputs *common.ZKInputs) error {
  14. return nil
  15. }
  16. // GetProof retreives the Proof from the ServerProof
  17. func (p *ServerProofInfo) GetProof() (*Proof, error) {
  18. return nil, nil
  19. }
  20. // ServerProofPool contains the multiple ServerProofInfo
  21. type ServerProofPool struct {
  22. // pool []ServerProofInfo
  23. }
  24. // GetNextAvailable returns the available ServerProofInfo
  25. func (p *ServerProofPool) GetNextAvailable(stopCh chan bool) (*ServerProofInfo, error) {
  26. select {
  27. case <-stopCh:
  28. log.Info("ServerProofPool.GetNextAvailable stopped")
  29. return nil, ErrStop
  30. default:
  31. }
  32. return nil, nil
  33. }