-
Notifications
You must be signed in to change notification settings - Fork 211
/
oracle.go
29 lines (23 loc) · 899 Bytes
/
oracle.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package main
import (
"context"
"github.com/spacemeshos/go-spacemesh/common/types"
)
type hareOracle struct {
oc *oracleClient
}
func newHareOracleFromClient(oc *oracleClient) *hareOracle {
return &hareOracle{oc: oc}
}
func (bo *hareOracle) IsIdentityActiveOnConsensusView(string, types.LayerID) (bool, error) {
return true, nil
}
// Eligible checks eligibility for an identity in a round
func (bo *hareOracle) Eligible(ctx context.Context, layer types.LayerID, round int32, committeeSize int, id types.NodeID, sig []byte) (bool, error) {
// note: we don't use the proof in the oracle server. we keep it just for the future syntax
// todo: maybe replace k to be uint32 like hare wants, and don't use -1 for blocks
return bo.oc.Eligible(layer, round, committeeSize, id, sig)
}
func (bo *hareOracle) Proof(context.Context, types.LayerID, int32) ([]byte, error) {
return []byte{}, nil
}