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