From bf362d3dd312f82031bbf3ac42b9268d4c4aaaef Mon Sep 17 00:00:00 2001 From: Cedric Date: Thu, 17 Oct 2024 10:36:06 +0100 Subject: [PATCH 1/3] Add a non-wasip1 version of NewRunner (#838) --- .../wasm/host/test/runnerapi/cmd/main.go | 28 +++++++++++++++++++ .../wasm/host/test/runnerapi/cmd/main_test.go | 11 ++++++++ pkg/workflows/wasm/runner_notwasip1.go | 7 +++++ 3 files changed, 46 insertions(+) create mode 100644 pkg/workflows/wasm/host/test/runnerapi/cmd/main.go create mode 100644 pkg/workflows/wasm/host/test/runnerapi/cmd/main_test.go create mode 100644 pkg/workflows/wasm/runner_notwasip1.go diff --git a/pkg/workflows/wasm/host/test/runnerapi/cmd/main.go b/pkg/workflows/wasm/host/test/runnerapi/cmd/main.go new file mode 100644 index 000000000..2f0461bb4 --- /dev/null +++ b/pkg/workflows/wasm/host/test/runnerapi/cmd/main.go @@ -0,0 +1,28 @@ +package main + +import ( + "github.com/smartcontractkit/chainlink-common/pkg/workflows/wasm" + + "github.com/smartcontractkit/chainlink-common/pkg/capabilities/cli/cmd/testdata/fixtures/capabilities/basictrigger" + "github.com/smartcontractkit/chainlink-common/pkg/workflows/sdk" +) + +func BuildWorkflow(config []byte) *sdk.WorkflowSpecFactory { + workflow := sdk.NewWorkflowSpecFactory( + sdk.NewWorkflowParams{ + Name: "tester", + Owner: "ryan", + }, + ) + + triggerCfg := basictrigger.TriggerConfig{Name: "trigger", Number: 100} + _ = triggerCfg.New(workflow) + + return workflow +} + +func main() { + runner := wasm.NewRunner() + workflow := BuildWorkflow(runner.Config()) + runner.Run(workflow) +} diff --git a/pkg/workflows/wasm/host/test/runnerapi/cmd/main_test.go b/pkg/workflows/wasm/host/test/runnerapi/cmd/main_test.go new file mode 100644 index 000000000..ab6a1ac09 --- /dev/null +++ b/pkg/workflows/wasm/host/test/runnerapi/cmd/main_test.go @@ -0,0 +1,11 @@ +package main + +import ( + "testing" +) + +func TestSingleFileCanTestBuildWorkflow(t *testing.T) { + // No assertions, we're just checking that we don't get + // `BuildWorkflow` not found. + _ = BuildWorkflow([]byte("")) +} diff --git a/pkg/workflows/wasm/runner_notwasip1.go b/pkg/workflows/wasm/runner_notwasip1.go new file mode 100644 index 000000000..e751b353a --- /dev/null +++ b/pkg/workflows/wasm/runner_notwasip1.go @@ -0,0 +1,7 @@ +//go:build !wasip1 + +package wasm + +func NewRunner() *Runner { + panic("error: NewRunner() is only intended for use with `GOOS=wasip1 GOARCH=wasm`. For testing, use testutils.NewRunner() instead.") +} From 80c6a3362575898e16c120ac9e24ece63816d909 Mon Sep 17 00:00:00 2001 From: Matthew Pendrey Date: Thu, 17 Oct 2024 10:55:39 +0100 Subject: [PATCH 2/3] contract reader api change for block meta data (#855) * contract reader api change for meta data * add to unimplemented contract reader * update to use Head struct for meta data * typo * another typo --- pkg/types/contract_reader.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkg/types/contract_reader.go b/pkg/types/contract_reader.go index caf97925b..4ba2ec9a7 100644 --- a/pkg/types/contract_reader.go +++ b/pkg/types/contract_reader.go @@ -46,6 +46,9 @@ type ContractReader interface { // Passing in a *values.Value as the returnVal will encode the return value as an appropriate value.Value instance. GetLatestValue(ctx context.Context, readIdentifier string, confidenceLevel primitives.ConfidenceLevel, params, returnVal any) error + // GetLatestValueWithHeadData should be used in the same way as GetLatestValue, but also returns the head data. + GetLatestValueWithHeadData(ctx context.Context, readIdentifier string, confidenceLevel primitives.ConfidenceLevel, params, returnVal any) (Head, error) + // BatchGetLatestValues batches get latest value calls based on request, which is grouped by contract names that each have a slice of BatchRead. // BatchGetLatestValuesRequest params and returnVal follow same rules as GetLatestValue params and returnVal arguments, with difference in how response is returned. // BatchGetLatestValuesResult response is grouped by contract names, which contain read results that maintain the order from the request. @@ -130,6 +133,10 @@ func (UnimplementedContractReader) GetLatestValue(ctx context.Context, readIdent return UnimplementedError("ContractReader.GetLatestValue unimplemented") } +func (UnimplementedContractReader) GetLatestValueWithHeadData(ctx context.Context, readIdentifier string, confidenceLevel primitives.ConfidenceLevel, params, returnVal any) (Head, error) { + return Head{}, UnimplementedError("ContractReader.GetLatestValueWithHeadData unimplemented") +} + func (UnimplementedContractReader) BatchGetLatestValues(ctx context.Context, request BatchGetLatestValuesRequest) (BatchGetLatestValuesResult, error) { return nil, UnimplementedError("ContractReader.BatchGetLatestValues unimplemented") } From 02a8c3d034c76c948b1a6fb09237d382d0b5134a Mon Sep 17 00:00:00 2001 From: Cedric Date: Thu, 17 Oct 2024 11:16:09 +0100 Subject: [PATCH 3/3] [chore] use beholder/BaseMessage (#856) --- pkg/beholder/pb/base_message.pb.go | 50 +++--- pkg/beholder/pb/base_message.proto | 4 +- pkg/capabilities/events/events.go | 8 +- pkg/capabilities/events/events_test.go | 6 +- pkg/capabilities/events/pb/events.pb.go | 227 ------------------------ pkg/capabilities/events/pb/events.proto | 18 -- pkg/capabilities/events/pb/generate.go | 2 - 7 files changed, 30 insertions(+), 285 deletions(-) delete mode 100644 pkg/capabilities/events/pb/events.pb.go delete mode 100644 pkg/capabilities/events/pb/events.proto delete mode 100644 pkg/capabilities/events/pb/generate.go diff --git a/pkg/beholder/pb/base_message.pb.go b/pkg/beholder/pb/base_message.pb.go index 606ba85ca..773d2c873 100644 --- a/pkg/beholder/pb/base_message.pb.go +++ b/pkg/beholder/pb/base_message.pb.go @@ -32,7 +32,7 @@ type BaseMessage struct { Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` // https://protobuf.dev/programming-guides/proto3/#maps // In go: if Value is empty for a key, nothing will be serialized - Labels map[string]*pb.Value `protobuf:"bytes,2,rep,name=labels,proto3" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + Labels *pb.Map `protobuf:"bytes,2,opt,name=labels,proto3" json:"labels,omitempty"` } func (x *BaseMessage) Reset() { @@ -74,7 +74,7 @@ func (x *BaseMessage) GetMsg() string { return "" } -func (x *BaseMessage) GetLabels() map[string]*pb.Value { +func (x *BaseMessage) GetLabels() *pb.Map { if x != nil { return x.Labels } @@ -87,22 +87,16 @@ var file_beholder_pb_base_message_proto_rawDesc = []byte{ 0x0a, 0x1e, 0x62, 0x65, 0x68, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x2f, 0x70, 0x62, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x1a, 0x16, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x2f, 0x70, 0x62, 0x2f, - 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9e, 0x01, 0x0a, - 0x0b, 0x42, 0x61, 0x73, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, - 0x6d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x33, - 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, - 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x61, 0x73, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, - 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x6c, 0x61, 0x62, - 0x65, 0x6c, 0x73, 0x1a, 0x48, 0x0a, 0x0b, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x23, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x2e, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x3f, 0x5a, - 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6d, 0x61, 0x72, - 0x74, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6b, 0x69, 0x74, 0x2f, 0x63, 0x68, 0x61, - 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x2d, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x6b, - 0x67, 0x2f, 0x62, 0x65, 0x68, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x2f, 0x70, 0x62, 0x2f, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x44, 0x0a, 0x0b, + 0x42, 0x61, 0x73, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, + 0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x12, 0x23, 0x0a, + 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x2e, 0x4d, 0x61, 0x70, 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, + 0x6c, 0x73, 0x42, 0x3f, 0x5a, 0x3d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, + 0x2f, 0x73, 0x6d, 0x61, 0x72, 0x74, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6b, 0x69, + 0x74, 0x2f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x2d, 0x63, 0x6f, 0x6d, 0x6d, + 0x6f, 0x6e, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x62, 0x65, 0x68, 0x6f, 0x6c, 0x64, 0x65, 0x72, 0x2f, + 0x70, 0x62, 0x2f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -117,20 +111,18 @@ func file_beholder_pb_base_message_proto_rawDescGZIP() []byte { return file_beholder_pb_base_message_proto_rawDescData } -var file_beholder_pb_base_message_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_beholder_pb_base_message_proto_msgTypes = make([]protoimpl.MessageInfo, 1) var file_beholder_pb_base_message_proto_goTypes = []interface{}{ (*BaseMessage)(nil), // 0: pb.BaseMessage - nil, // 1: pb.BaseMessage.LabelsEntry - (*pb.Value)(nil), // 2: values.Value + (*pb.Map)(nil), // 1: values.Map } var file_beholder_pb_base_message_proto_depIdxs = []int32{ - 1, // 0: pb.BaseMessage.labels:type_name -> pb.BaseMessage.LabelsEntry - 2, // 1: pb.BaseMessage.LabelsEntry.value:type_name -> values.Value - 2, // [2:2] is the sub-list for method output_type - 2, // [2:2] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name + 1, // 0: pb.BaseMessage.labels:type_name -> values.Map + 1, // [1:1] is the sub-list for method output_type + 1, // [1:1] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } func init() { file_beholder_pb_base_message_proto_init() } @@ -158,7 +150,7 @@ func file_beholder_pb_base_message_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_beholder_pb_base_message_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 1, NumExtensions: 0, NumServices: 0, }, diff --git a/pkg/beholder/pb/base_message.proto b/pkg/beholder/pb/base_message.proto index 341d1f3e6..3d39f8d7a 100644 --- a/pkg/beholder/pb/base_message.proto +++ b/pkg/beholder/pb/base_message.proto @@ -13,5 +13,5 @@ message BaseMessage { string msg=1; // https://protobuf.dev/programming-guides/proto3/#maps // In go: if Value is empty for a key, nothing will be serialized - map labels=2; -} \ No newline at end of file + values.Map labels = 2; +} diff --git a/pkg/capabilities/events/events.go b/pkg/capabilities/events/events.go index 81503b42b..1443fb2ff 100644 --- a/pkg/capabilities/events/events.go +++ b/pkg/capabilities/events/events.go @@ -8,7 +8,7 @@ import ( "google.golang.org/protobuf/proto" "github.com/smartcontractkit/chainlink-common/pkg/beholder" - "github.com/smartcontractkit/chainlink-common/pkg/capabilities/events/pb" + "github.com/smartcontractkit/chainlink-common/pkg/beholder/pb" "github.com/smartcontractkit/chainlink-common/pkg/values" ) @@ -174,9 +174,9 @@ func (e *Emitter) Emit(ctx context.Context, msg Message) error { pm := values.ProtoMap(wm) - bytes, err := proto.Marshal(&pb.OperationalEvent{ - Labels: pm, - Message: msg.Msg, + bytes, err := proto.Marshal(&pb.BaseMessage{ + Labels: pm, + Msg: msg.Msg, }) if err != nil { return fmt.Errorf("could not marshal operational event: %w", err) diff --git a/pkg/capabilities/events/events_test.go b/pkg/capabilities/events/events_test.go index c08975b6e..709296ec7 100644 --- a/pkg/capabilities/events/events_test.go +++ b/pkg/capabilities/events/events_test.go @@ -9,7 +9,7 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/protobuf/proto" - "github.com/smartcontractkit/chainlink-common/pkg/capabilities/events/pb" + "github.com/smartcontractkit/chainlink-common/pkg/beholder/pb" "github.com/smartcontractkit/chainlink-common/pkg/utils/tests" ) @@ -47,11 +47,11 @@ func TestEmitter(t *testing.T) { err = emitter.Emit(tests.Context(t), message) require.NoError(t, err) - event := &pb.OperationalEvent{} + event := &pb.BaseMessage{} err = proto.Unmarshal(client.payload, event) require.NoError(t, err) - assert.Equal(t, event.Message, msg) + assert.Equal(t, event.Msg, msg) } func assertHasKey(t *testing.T, attrs []any, keyName, keyValue string) { diff --git a/pkg/capabilities/events/pb/events.pb.go b/pkg/capabilities/events/pb/events.pb.go deleted file mode 100644 index 411b79b1b..000000000 --- a/pkg/capabilities/events/pb/events.pb.go +++ /dev/null @@ -1,227 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.31.0 -// protoc v4.25.1 -// source: capabilities/events/pb/events.proto - -package pb - -import ( - pb "github.com/smartcontractkit/chainlink-common/pkg/values/pb" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type OperationalEvent struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` - Labels *pb.Map `protobuf:"bytes,2,opt,name=labels,proto3" json:"labels,omitempty"` -} - -func (x *OperationalEvent) Reset() { - *x = OperationalEvent{} - if protoimpl.UnsafeEnabled { - mi := &file_capabilities_events_pb_events_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OperationalEvent) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OperationalEvent) ProtoMessage() {} - -func (x *OperationalEvent) ProtoReflect() protoreflect.Message { - mi := &file_capabilities_events_pb_events_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OperationalEvent.ProtoReflect.Descriptor instead. -func (*OperationalEvent) Descriptor() ([]byte, []int) { - return file_capabilities_events_pb_events_proto_rawDescGZIP(), []int{0} -} - -func (x *OperationalEvent) GetMessage() string { - if x != nil { - return x.Message - } - return "" -} - -func (x *OperationalEvent) GetLabels() *pb.Map { - if x != nil { - return x.Labels - } - return nil -} - -// Used by custom compute to send any beholder errors -// back. -type OperationalEventResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - ErrMsg string `protobuf:"bytes,1,opt,name=errMsg,proto3" json:"errMsg,omitempty"` -} - -func (x *OperationalEventResponse) Reset() { - *x = OperationalEventResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_capabilities_events_pb_events_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *OperationalEventResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*OperationalEventResponse) ProtoMessage() {} - -func (x *OperationalEventResponse) ProtoReflect() protoreflect.Message { - mi := &file_capabilities_events_pb_events_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use OperationalEventResponse.ProtoReflect.Descriptor instead. -func (*OperationalEventResponse) Descriptor() ([]byte, []int) { - return file_capabilities_events_pb_events_proto_rawDescGZIP(), []int{1} -} - -func (x *OperationalEventResponse) GetErrMsg() string { - if x != nil { - return x.ErrMsg - } - return "" -} - -var File_capabilities_events_pb_events_proto protoreflect.FileDescriptor - -var file_capabilities_events_pb_events_proto_rawDesc = []byte{ - 0x0a, 0x23, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x2f, 0x65, - 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x70, 0x62, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x06, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x1a, 0x16, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x73, 0x2f, 0x70, 0x62, 0x2f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x51, 0x0a, 0x10, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x61, 0x6c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x12, 0x23, 0x0a, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x73, 0x2e, 0x4d, 0x61, 0x70, - 0x52, 0x06, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x22, 0x32, 0x0a, 0x18, 0x4f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x61, 0x6c, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x42, 0x49, 0x5a, 0x47, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x73, 0x6d, 0x61, 0x72, 0x74, - 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x61, 0x63, 0x74, 0x6b, 0x69, 0x74, 0x2f, 0x63, 0x68, 0x61, 0x69, - 0x6e, 0x6c, 0x69, 0x6e, 0x6b, 0x2d, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x6b, 0x67, - 0x2f, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x2f, 0x65, 0x76, - 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_capabilities_events_pb_events_proto_rawDescOnce sync.Once - file_capabilities_events_pb_events_proto_rawDescData = file_capabilities_events_pb_events_proto_rawDesc -) - -func file_capabilities_events_pb_events_proto_rawDescGZIP() []byte { - file_capabilities_events_pb_events_proto_rawDescOnce.Do(func() { - file_capabilities_events_pb_events_proto_rawDescData = protoimpl.X.CompressGZIP(file_capabilities_events_pb_events_proto_rawDescData) - }) - return file_capabilities_events_pb_events_proto_rawDescData -} - -var file_capabilities_events_pb_events_proto_msgTypes = make([]protoimpl.MessageInfo, 2) -var file_capabilities_events_pb_events_proto_goTypes = []interface{}{ - (*OperationalEvent)(nil), // 0: events.OperationalEvent - (*OperationalEventResponse)(nil), // 1: events.OperationalEventResponse - (*pb.Map)(nil), // 2: values.Map -} -var file_capabilities_events_pb_events_proto_depIdxs = []int32{ - 2, // 0: events.OperationalEvent.labels:type_name -> values.Map - 1, // [1:1] is the sub-list for method output_type - 1, // [1:1] is the sub-list for method input_type - 1, // [1:1] is the sub-list for extension type_name - 1, // [1:1] is the sub-list for extension extendee - 0, // [0:1] is the sub-list for field type_name -} - -func init() { file_capabilities_events_pb_events_proto_init() } -func file_capabilities_events_pb_events_proto_init() { - if File_capabilities_events_pb_events_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_capabilities_events_pb_events_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OperationalEvent); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_capabilities_events_pb_events_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*OperationalEventResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_capabilities_events_pb_events_proto_rawDesc, - NumEnums: 0, - NumMessages: 2, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_capabilities_events_pb_events_proto_goTypes, - DependencyIndexes: file_capabilities_events_pb_events_proto_depIdxs, - MessageInfos: file_capabilities_events_pb_events_proto_msgTypes, - }.Build() - File_capabilities_events_pb_events_proto = out.File - file_capabilities_events_pb_events_proto_rawDesc = nil - file_capabilities_events_pb_events_proto_goTypes = nil - file_capabilities_events_pb_events_proto_depIdxs = nil -} diff --git a/pkg/capabilities/events/pb/events.proto b/pkg/capabilities/events/pb/events.proto deleted file mode 100644 index 7d19ca585..000000000 --- a/pkg/capabilities/events/pb/events.proto +++ /dev/null @@ -1,18 +0,0 @@ -syntax = "proto3"; - -option go_package = "github.com/smartcontractkit/chainlink-common/pkg/capabilities/events/pb"; - -package events; - -import "values/pb/values.proto"; - -message OperationalEvent { - string message = 1; - values.Map labels = 2; -} - -// Used by custom compute to send any beholder errors -// back. -message OperationalEventResponse { - string errMsg = 1; -} diff --git a/pkg/capabilities/events/pb/generate.go b/pkg/capabilities/events/pb/generate.go deleted file mode 100644 index 8d1c8ee25..000000000 --- a/pkg/capabilities/events/pb/generate.go +++ /dev/null @@ -1,2 +0,0 @@ -//go:generate protoc --go_out=../../../ --go_opt=paths=source_relative --go-grpc_out=../../../ --go-grpc_opt=paths=source_relative --proto_path=../../../ capabilities/events/pb/events.proto values/pb/values.proto -package pb