MCPcopy Create free account
hub / github.com/evilsocket/sum / ReadOracle

Method ReadOracle

service/oracles.go:48–54  ·  view source on GitHub ↗

ReadOracle returns a raw *pb.Oracle object given its identifier.

(ctx context.Context, query *pb.ById)

Source from the content-addressed store, hash-verified

46
47// ReadOracle returns a raw *pb.Oracle object given its identifier.
48func (s *Service) ReadOracle(ctx context.Context, query *pb.ById) (*pb.OracleResponse, error) {
49 oracle := s.oracles.Find(query.Id)
50 if oracle == nil {
51 return errOracleResponse("oracle %d not found.", query.Id), nil
52 }
53 return &pb.OracleResponse{Success: true, Oracle: oracle}, nil
54}
55
56// FindOracle returns a list of raw *pb.Oracle objects that match
57// the provided name.

Callers

nothing calls this directly

Calls 2

errOracleResponseFunction · 0.85
FindMethod · 0.45

Tested by

no test coverage detected