Skip to content

Commit

Permalink
Merge branch 'main' into will/kill-common
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkouv authored Oct 17, 2024
2 parents a38a7af + 02a8c3d commit 170745a
Show file tree
Hide file tree
Showing 11 changed files with 83 additions and 285 deletions.
50 changes: 21 additions & 29 deletions pkg/beholder/pb/base_message.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pkg/beholder/pb/base_message.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, values.Value> labels=2;
}
values.Map labels = 2;
}
8 changes: 4 additions & 4 deletions pkg/capabilities/events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions pkg/capabilities/events/events_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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) {
Expand Down
227 changes: 0 additions & 227 deletions pkg/capabilities/events/pb/events.pb.go

This file was deleted.

18 changes: 0 additions & 18 deletions pkg/capabilities/events/pb/events.proto

This file was deleted.

2 changes: 0 additions & 2 deletions pkg/capabilities/events/pb/generate.go

This file was deleted.

Loading

0 comments on commit 170745a

Please sign in to comment.