Skip to content

Commit

Permalink
add context with value
Browse files Browse the repository at this point in the history
  • Loading branch information
randygrok committed Aug 6, 2024
1 parent 71d0027 commit cadccd4
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions simapp/v2/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ package simapp
import (
"context"
app2 "cosmossdk.io/core/app"
"cosmossdk.io/core/comet"
context2 "cosmossdk.io/core/context"
serverv2 "cosmossdk.io/server/v2"
"crypto/sha256"
"encoding/json"
Expand Down Expand Up @@ -75,6 +77,14 @@ func MoveNextBlock(t *testing.T, app *SimApp[transaction.Tx], ctx context.Contex
height, err := app.LoadLatestHeight()
require.NoError(t, err)

// TODO: this is a hack to set the comet info in the context for distribution module dependency.
ctx = context.WithValue(ctx, context2.CometInfoKey, comet.Info{
Evidence: nil,
ValidatorsHash: nil,
ProposerAddress: nil,
LastCommit: comet.CommitInfo{},
})

_, newState, err := app.DeliverBlock(
ctx,
&app2.BlockRequest[transaction.Tx]{
Expand Down

0 comments on commit cadccd4

Please sign in to comment.