Skip to content

Commit

Permalink
Merge pull request #417 from ethpandaops/fix/hermes-host-event-payloa…
Browse files Browse the repository at this point in the history
…d-changes

refactor: Update field name 'Transient' to 'Limited'
  • Loading branch information
mattevans authored Dec 2, 2024
2 parents c1c55be + 375a14b commit dedce7f
Show file tree
Hide file tree
Showing 3 changed files with 151 additions and 112 deletions.
14 changes: 8 additions & 6 deletions pkg/proto/libp2p/trace.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
ma "github.com/multiformats/go-multiaddr"
"github.com/probe-lab/hermes/host"
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
timestamppb "google.golang.org/protobuf/types/known/timestamppb"
wrapperspb "google.golang.org/protobuf/types/known/wrapperspb"
"google.golang.org/protobuf/types/known/timestamppb"
"google.golang.org/protobuf/types/known/wrapperspb"
)

// Helper function to convert a Hermes TraceEvent to a libp2p AddPeer
Expand Down Expand Up @@ -242,7 +242,7 @@ func TraceEventToConnected(event *host.TraceEvent) (*Connected, error) {
AgentVersion string
Direction string
Opened time.Time
Transient bool
Limited bool
})
if !ok {
return nil, fmt.Errorf("invalid payload type for Connected")
Expand All @@ -254,7 +254,8 @@ func TraceEventToConnected(event *host.TraceEvent) (*Connected, error) {
AgentVersion: wrapperspb.String(payload.AgentVersion),
Direction: wrapperspb.String(payload.Direction),
Opened: timestamppb.New(payload.Opened),
Transient: wrapperspb.Bool(payload.Transient),
Limited: wrapperspb.Bool(payload.Limited),
Transient: wrapperspb.Bool(payload.Limited),
}, nil
}

Expand All @@ -265,7 +266,7 @@ func TraceEventToDisconnected(event *host.TraceEvent) (*Disconnected, error) {
AgentVersion string
Direction string
Opened time.Time
Transient bool
Limited bool
})
if !ok {
return nil, fmt.Errorf("invalid payload type for Disconnected")
Expand All @@ -277,7 +278,8 @@ func TraceEventToDisconnected(event *host.TraceEvent) (*Disconnected, error) {
AgentVersion: wrapperspb.String(payload.AgentVersion),
Direction: wrapperspb.String(payload.Direction),
Opened: timestamppb.New(payload.Opened),
Transient: wrapperspb.Bool(payload.Transient),
Limited: wrapperspb.Bool(payload.Limited),
Transient: wrapperspb.Bool(payload.Limited),
}, nil
}

Expand Down
Loading

0 comments on commit dedce7f

Please sign in to comment.