Skip to content

Commit

Permalink
fix event fns
Browse files Browse the repository at this point in the history
  • Loading branch information
gusin13 committed Sep 13, 2024
1 parent 30fb27c commit 2dd63a9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
5 changes: 1 addition & 4 deletions x/btcstaking/keeper/finality_providers.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,7 @@ func (k Keeper) NotifyConsumersOfSlashedFinalityProvider(ctx context.Context, fp

for _, delegation := range delegations {
// Create SlashedBTCDelegation event
consumerEvent, err := types.CreateSlashedBTCDelegationEvent(delegation)
if err != nil {
return err
}
consumerEvent := types.CreateSlashedBTCDelegationEvent(delegation)

// Get consumer IDs of non-Babylon finality providers
restakedFPConsumerIDs, err := k.restakedFPConsumerIDs(ctx, delegation.FpBtcPkList)
Expand Down
6 changes: 2 additions & 4 deletions x/btcstaking/types/btc_staking_consumer_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,12 @@ func CreateUnbondedBTCDelegationEvent(unbondedDel *BTCDelegation) (*BTCStakingCo
return event, nil
}

func CreateSlashedBTCDelegationEvent(slashedDel *BTCDelegation) (*BTCStakingConsumerEvent, error) {
event := &BTCStakingConsumerEvent{
func CreateSlashedBTCDelegationEvent(slashedDel *BTCDelegation) *BTCStakingConsumerEvent {
return &BTCStakingConsumerEvent{
Event: &BTCStakingConsumerEvent_SlashedDel{
SlashedDel: &SlashedBTCDelegation{
StakingTxHash: slashedDel.MustGetStakingTxHash().String(),
},
},
}

return event, nil
}

0 comments on commit 2dd63a9

Please sign in to comment.