From 2dd63a9116fb415bc8c09c064a8f19707dcb6fd6 Mon Sep 17 00:00:00 2001 From: Gurjot Date: Fri, 13 Sep 2024 13:43:54 -0400 Subject: [PATCH] fix event fns --- x/btcstaking/keeper/finality_providers.go | 5 +---- x/btcstaking/types/btc_staking_consumer_events.go | 6 ++---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/x/btcstaking/keeper/finality_providers.go b/x/btcstaking/keeper/finality_providers.go index f6757e936..0a1487a81 100644 --- a/x/btcstaking/keeper/finality_providers.go +++ b/x/btcstaking/keeper/finality_providers.go @@ -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) diff --git a/x/btcstaking/types/btc_staking_consumer_events.go b/x/btcstaking/types/btc_staking_consumer_events.go index 89e6922a8..2f0c12aa3 100644 --- a/x/btcstaking/types/btc_staking_consumer_events.go +++ b/x/btcstaking/types/btc_staking_consumer_events.go @@ -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 }