Skip to content

Commit

Permalink
Merge pull request #14 from ethpandaops/fix/signed-voluntary-exit
Browse files Browse the repository at this point in the history
fix: Use SignedVoluntaryExit in voluntary exit event
  • Loading branch information
samcm authored Apr 13, 2023
2 parents 1c92aed + ad8b665 commit 5ca1670
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/beacon/beacon.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ type Node interface {
// OnChainReOrg is called when a chain reorg is received.
OnChainReOrg(ctx context.Context, handler func(ctx context.Context, ev *v1.ChainReorgEvent) error)
// OnVoluntaryExit is called when a voluntary exit is received.
OnVoluntaryExit(ctx context.Context, handler func(ctx context.Context, ev *phase0.VoluntaryExit) error)
OnVoluntaryExit(ctx context.Context, handler func(ctx context.Context, ev *phase0.SignedVoluntaryExit) error)
// OnContributionAndProof is called when a contribution and proof is received.
OnContributionAndProof(ctx context.Context, handler func(ctx context.Context, ev *altair.SignedContributionAndProof) error)

Expand Down
2 changes: 1 addition & 1 deletion pkg/beacon/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (n *node) publishHead(ctx context.Context, event *v1.HeadEvent) {
n.broker.Emit(topicHead, event)
}

func (n *node) publishVoluntaryExit(ctx context.Context, event *phase0.VoluntaryExit) {
func (n *node) publishVoluntaryExit(ctx context.Context, event *phase0.SignedVoluntaryExit) {
n.broker.Emit(topicVoluntaryExit, event)
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/beacon/subscriber.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ func (n *node) OnHead(ctx context.Context, handler func(ctx context.Context, eve
})
}

func (n *node) OnVoluntaryExit(ctx context.Context, handler func(ctx context.Context, event *phase0.VoluntaryExit) error) {
n.broker.On(topicVoluntaryExit, func(event *phase0.VoluntaryExit) {
func (n *node) OnVoluntaryExit(ctx context.Context, handler func(ctx context.Context, event *phase0.SignedVoluntaryExit) error) {
n.broker.On(topicVoluntaryExit, func(event *phase0.SignedVoluntaryExit) {
n.handleSubscriberError(handler(ctx, event), topicVoluntaryExit)
})
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/beacon/subscriptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func (n *node) handleHead(ctx context.Context, event *v1.Event) error {
}

func (n *node) handleVoluntaryExit(ctx context.Context, event *v1.Event) error {
exit, valid := event.Data.(*phase0.VoluntaryExit)
exit, valid := event.Data.(*phase0.SignedVoluntaryExit)
if !valid {
return errors.New("invalid voluntary exit event")
}
Expand Down

0 comments on commit 5ca1670

Please sign in to comment.