Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
julienrbrt committed Aug 14, 2024
1 parent 0ad4295 commit 573c992
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions types/context_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import (
"github.com/cosmos/cosmos-sdk/types"
)

type dummyCtxKey struct{}

type contextTestSuite struct {
suite.Suite
}
Expand Down Expand Up @@ -137,8 +139,7 @@ func (s *contextTestSuite) TestContextWithCustom() {
s.Require().Equal(cp, ctx.WithConsensusParams(cp).ConsensusParams())

// test inner context
var ctxKey = struct{}{}
newContext := context.WithValue(ctx.Context(), ctxKey, "value")
newContext := context.WithValue(ctx.Context(), dummyCtxKey{}, "value")
s.Require().NotEqual(ctx.Context(), ctx.WithContext(newContext).Context())
}

Expand Down Expand Up @@ -226,8 +227,7 @@ func (s *contextTestSuite) TestUnwrapSDKContext() {
s.Require().Panics(func() { types.UnwrapSDKContext(ctx) })

// test unwrapping when we've used context.WithValue
var ctxKey = struct{}{}
ctx = context.WithValue(sdkCtx, ctxKey, "bar")
ctx = context.WithValue(sdkCtx, dummyCtxKey{}, "bar")
sdkCtx2 = types.UnwrapSDKContext(ctx)
s.Require().Equal(sdkCtx, sdkCtx2)
}

0 comments on commit 573c992

Please sign in to comment.