UpdateOracle updates the contents of an oracle with the ones of a raw *pb.Oracle object given its identifier.
(ctx context.Context, oracle *pb.Oracle)
| 34 | // UpdateOracle updates the contents of an oracle with the ones of a raw *pb.Oracle |
| 35 | // object given its identifier. |
| 36 | func (s *Service) UpdateOracle(ctx context.Context, oracle *pb.Oracle) (*pb.OracleResponse, error) { |
| 37 | if compiled, err := compile(oracle); err != nil { |
| 38 | return errOracleResponse("%s", err), nil |
| 39 | } else if err := s.oracles.Update(oracle); err != nil { |
| 40 | return errOracleResponse("%s", err), nil |
| 41 | } else { |
| 42 | s.cache.Add(oracle.Id, compiled) |
| 43 | } |
| 44 | return &pb.OracleResponse{Success: true}, nil |
| 45 | } |
| 46 | |
| 47 | // ReadOracle returns a raw *pb.Oracle object given its identifier. |
| 48 | func (s *Service) ReadOracle(ctx context.Context, query *pb.ById) (*pb.OracleResponse, error) { |
nothing calls this directly
no test coverage detected