Skip to content

Commit

Permalink
fix: lint issueson btc utils
Browse files Browse the repository at this point in the history
  • Loading branch information
RafilxTenfen committed Nov 20, 2024
1 parent 2e9dfd4 commit 41b4906
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
9 changes: 5 additions & 4 deletions x/btccheckpoint/keeper/submissions.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package keeper
import (
"context"
"fmt"
sdk "github.com/cosmos/cosmos-sdk/types"
"math"

sdk "github.com/cosmos/cosmos-sdk/types"

"cosmossdk.io/store/prefix"
bbn "github.com/babylonlabs-io/babylon/types"
"github.com/babylonlabs-io/babylon/x/btccheckpoint/types"
Expand Down Expand Up @@ -123,11 +124,11 @@ func (k Keeper) checkSubmissionStatus(ctx context.Context, info *types.Submissio
subDepth := info.SubmissionDepth()
if subDepth >= k.GetParams(ctx).CheckpointFinalizationTimeout {
return types.Finalized
} else if subDepth >= k.GetParams(ctx).BtcConfirmationDepth {
}
if subDepth >= k.GetParams(ctx).BtcConfirmationDepth {
return types.Confirmed
} else {
return types.Submitted
}
return types.Submitted
}

func (k Keeper) GetSubmissionBtcInfo(ctx context.Context, sk types.SubmissionKey) (*types.SubmissionBtcInfo, error) {
Expand Down
4 changes: 2 additions & 2 deletions x/btccheckpoint/types/btcutils.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ func createBranch(nodes []*chainhash.Hash, numfLeafs uint, idx uint) []*chainhas
branch = append(branch, nodes[i+j])

// divide index by 2 as there are two times less nodes on second level
index = index >> 1
index >>= 1

// after getting node at this level we move to next one by advancing i by
// the size of the current level
i = i + size
i += size

// update the size to the next level size i.e (current level size / 2)
// + 1 is needed to correctly account for cases that the last node of the level
Expand Down

0 comments on commit 41b4906

Please sign in to comment.