From 055827e3ced43eabfeb3904a1bf0d051e9eb7d50 Mon Sep 17 00:00:00 2001 From: KonradStaniec Date: Thu, 12 Dec 2024 13:55:22 +0100 Subject: [PATCH] pr comments --- x/btcstaking/keeper/msg_server.go | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/x/btcstaking/keeper/msg_server.go b/x/btcstaking/keeper/msg_server.go index 4cff8222c..3a08512a6 100644 --- a/x/btcstaking/keeper/msg_server.go +++ b/x/btcstaking/keeper/msg_server.go @@ -179,22 +179,21 @@ func (ms msgServer) getTimeInfoAndParams( } return timeInfo, paramsByHeight, version, nil - } else { - // staking tx is not included on BTC, retrieve params for the current tip height - // and return info about the tip - btcTip := ms.btclcKeeper.GetTipInfo(ctx) - - paramsByHeight, version, err := ms.GetParamsForBtcHeight(ctx, uint64(btcTip.Height)) - if err != nil { - return nil, nil, 0, err - } + } + // staking tx is not included on BTC, retrieve params for the current tip height + // and return info about the tip + btcTip := ms.btclcKeeper.GetTipInfo(ctx) - return &DelegationTimeRangeInfo{ - StartHeight: 0, - EndHeight: 0, - TipHeight: btcTip.Height, - }, paramsByHeight, version, nil + paramsByHeight, version, err := ms.GetParamsForBtcHeight(ctx, uint64(btcTip.Height)) + if err != nil { + return nil, nil, 0, err } + + return &DelegationTimeRangeInfo{ + StartHeight: 0, + EndHeight: 0, + TipHeight: btcTip.Height, + }, paramsByHeight, version, nil } // CreateBTCDelegation creates a BTC delegation