Skip to content

Commit

Permalink
Fix:module name in Milestone logger
Browse files Browse the repository at this point in the history
  • Loading branch information
VAIBHAVJINDAL3012 committed Sep 11, 2023
1 parent 846f292 commit 00fbcab
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions checkpoint/handler_milestone.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (

// handleMsgMilestone validates milestone transaction
func handleMsgMilestone(ctx sdk.Context, msg types.MsgMilestone, k Keeper) sdk.Result {
logger := k.Logger(ctx)
logger := k.MilestoneLogger(ctx)
milestoneLength := helper.MilestoneLength

//
Expand Down Expand Up @@ -114,7 +114,7 @@ func handleMsgMilestone(ctx sdk.Context, msg types.MsgMilestone, k Keeper) sdk.R

// Handles milestone timeout transaction
func handleMsgMilestoneTimeout(ctx sdk.Context, _ types.MsgMilestoneTimeout, k Keeper) sdk.Result {
logger := k.Logger(ctx)
logger := k.MilestoneLogger(ctx)

// Get current block time
currentTime := ctx.BlockTime()
Expand Down
6 changes: 6 additions & 0 deletions checkpoint/keeper_milestone.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"strconv"

sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/tendermint/tendermint/libs/log"

cmn "github.com/maticnetwork/heimdall/common"
"github.com/maticnetwork/heimdall/helper"
Expand All @@ -19,6 +20,11 @@ var (
BlockNumberKey = []byte{0x70} //Key to store the count
)

// Logger returns a module-specific logger
func (k Keeper) MilestoneLogger(ctx sdk.Context) log.Logger {
return ctx.Logger().With("module", "Milestone")
}

// AddMilestone adds milestone in the store
func (k *Keeper) AddMilestone(ctx sdk.Context, milestone hmTypes.Milestone) error {
milestoneNumber := k.GetMilestoneCount(ctx) + 1 //GetCount gives the number of previous milestone
Expand Down
4 changes: 2 additions & 2 deletions checkpoint/side_milestone_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ func SideHandleMsgMilestone(ctx sdk.Context, k Keeper, msg types.MsgMilestone, c
milestoneLength := helper.MilestoneLength

// logger
logger := k.Logger(ctx)
logger := k.MilestoneLogger(ctx)

//Get the milestone count
count := k.GetMilestoneCount(ctx)
Expand Down Expand Up @@ -72,7 +72,7 @@ func SideHandleMsgMilestone(ctx sdk.Context, k Keeper, msg types.MsgMilestone, c

// PostHandleMsgMilestone handles msg milestone
func PostHandleMsgMilestone(ctx sdk.Context, k Keeper, msg types.MsgMilestone, sideTxResult abci.SideTxResultType) sdk.Result {
logger := k.Logger(ctx)
logger := k.MilestoneLogger(ctx)
timeStamp := uint64(ctx.BlockTime().Unix())

// TX bytes
Expand Down

0 comments on commit 00fbcab

Please sign in to comment.