mirror of
https://github.com/tendermint/tendermint.git
synced 2026-08-31 13:16:59 +00:00
context position fixup
This commit is contained in:
@@ -46,7 +46,7 @@ func TestByzantinePrevoteEquivocation(t *testing.T) {
|
||||
tickerFunc := newMockTickerFunc(true)
|
||||
appFunc := newKVStore
|
||||
|
||||
valSet, privVals := factory.ValidatorSet(t, ctx, nValidators, 30)
|
||||
valSet, privVals := factory.ValidatorSet(ctx, t, nValidators, 30)
|
||||
genDoc := factory.GenesisDoc(config, time.Now(), valSet.Validators, nil)
|
||||
states := make([]*State, nValidators)
|
||||
|
||||
|
||||
@@ -522,7 +522,7 @@ func loadPrivValidator(t *testing.T, cfg *config.Config) *privval.FilePV {
|
||||
func makeState(ctx context.Context, t *testing.T, cfg *config.Config, logger log.Logger, nValidators int) (*State, []*validatorStub) {
|
||||
t.Helper()
|
||||
// Get State
|
||||
state, privVals := makeGenesisState(t, ctx, cfg, genesisStateArgs{
|
||||
state, privVals := makeGenesisState(ctx, t, cfg, genesisStateArgs{
|
||||
Validators: nValidators,
|
||||
})
|
||||
|
||||
@@ -734,7 +734,7 @@ func makeConsensusState(
|
||||
) ([]*State, cleanupFunc) {
|
||||
t.Helper()
|
||||
|
||||
valSet, privVals := factory.ValidatorSet(t, ctx, nValidators, 30)
|
||||
valSet, privVals := factory.ValidatorSet(ctx, t, nValidators, 30)
|
||||
genDoc := factory.GenesisDoc(cfg, time.Now(), valSet.Validators, nil)
|
||||
css := make([]*State, nValidators)
|
||||
logger := consensusLogger()
|
||||
@@ -795,7 +795,7 @@ func randConsensusNetWithPeers(
|
||||
) ([]*State, *types.GenesisDoc, *config.Config, cleanupFunc) {
|
||||
t.Helper()
|
||||
|
||||
valSet, privVals := factory.ValidatorSet(t, ctx, nValidators, testMinPower)
|
||||
valSet, privVals := factory.ValidatorSet(ctx, t, nValidators, testMinPower)
|
||||
genDoc := factory.GenesisDoc(cfg, time.Now(), valSet.Validators, nil)
|
||||
css := make([]*State, nPeers)
|
||||
t.Helper()
|
||||
@@ -853,7 +853,7 @@ type genesisStateArgs struct {
|
||||
Time time.Time
|
||||
}
|
||||
|
||||
func makeGenesisState(t *testing.T, ctx context.Context, cfg *config.Config, args genesisStateArgs) (sm.State, []types.PrivValidator) {
|
||||
func makeGenesisState(ctx context.Context, t *testing.T, cfg *config.Config, args genesisStateArgs) (sm.State, []types.PrivValidator) {
|
||||
t.Helper()
|
||||
if args.Power == 0 {
|
||||
args.Power = 1
|
||||
@@ -861,7 +861,7 @@ func makeGenesisState(t *testing.T, ctx context.Context, cfg *config.Config, arg
|
||||
if args.Validators == 0 {
|
||||
args.Power = 4
|
||||
}
|
||||
valSet, privValidators := factory.ValidatorSet(t, ctx, args.Validators, args.Power)
|
||||
valSet, privValidators := factory.ValidatorSet(ctx, t, args.Validators, args.Power)
|
||||
if args.Params == nil {
|
||||
args.Params = types.DefaultConsensusParams()
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ func TestMempoolNoProgressUntilTxsAvailable(t *testing.T) {
|
||||
t.Cleanup(func() { _ = os.RemoveAll(config.RootDir) })
|
||||
|
||||
config.Consensus.CreateEmptyBlocks = false
|
||||
state, privVals := makeGenesisState(t, ctx, baseConfig, genesisStateArgs{
|
||||
state, privVals := makeGenesisState(ctx, t, baseConfig, genesisStateArgs{
|
||||
Validators: 1,
|
||||
Power: 10})
|
||||
cs := newStateWithConfig(ctx, t, log.TestingLogger(), config, state, privVals[0], NewCounterApplication())
|
||||
@@ -67,7 +67,7 @@ func TestMempoolProgressAfterCreateEmptyBlocksInterval(t *testing.T) {
|
||||
t.Cleanup(func() { _ = os.RemoveAll(config.RootDir) })
|
||||
|
||||
config.Consensus.CreateEmptyBlocksInterval = ensureTimeout
|
||||
state, privVals := makeGenesisState(t, ctx, baseConfig, genesisStateArgs{
|
||||
state, privVals := makeGenesisState(ctx, t, baseConfig, genesisStateArgs{
|
||||
Validators: 1,
|
||||
Power: 10})
|
||||
cs := newStateWithConfig(ctx, t, log.TestingLogger(), config, state, privVals[0], NewCounterApplication())
|
||||
@@ -92,7 +92,7 @@ func TestMempoolProgressInHigherRound(t *testing.T) {
|
||||
t.Cleanup(func() { _ = os.RemoveAll(config.RootDir) })
|
||||
|
||||
config.Consensus.CreateEmptyBlocks = false
|
||||
state, privVals := makeGenesisState(t, ctx, baseConfig, genesisStateArgs{
|
||||
state, privVals := makeGenesisState(ctx, t, baseConfig, genesisStateArgs{
|
||||
Validators: 1,
|
||||
Power: 10})
|
||||
cs := newStateWithConfig(ctx, t, log.TestingLogger(), config, state, privVals[0], NewCounterApplication())
|
||||
@@ -143,7 +143,7 @@ func TestMempoolTxConcurrentWithCommit(t *testing.T) {
|
||||
|
||||
config := configSetup(t)
|
||||
logger := log.TestingLogger()
|
||||
state, privVals := makeGenesisState(t, ctx, config, genesisStateArgs{
|
||||
state, privVals := makeGenesisState(ctx, t, config, genesisStateArgs{
|
||||
Validators: 1,
|
||||
Power: 10})
|
||||
stateStore := sm.NewStore(dbm.NewMemDB())
|
||||
@@ -178,7 +178,7 @@ func TestMempoolRmBadTx(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
|
||||
state, privVals := makeGenesisState(t, ctx, config, genesisStateArgs{
|
||||
state, privVals := makeGenesisState(ctx, t, config, genesisStateArgs{
|
||||
Validators: 1,
|
||||
Power: 10})
|
||||
app := NewCounterApplication()
|
||||
|
||||
@@ -104,7 +104,7 @@ func newPBTSTestHarness(ctx context.Context, t *testing.T, tc pbtsTestConfigurat
|
||||
consensusParams := types.DefaultConsensusParams()
|
||||
consensusParams.Synchrony = tc.synchronyParams
|
||||
|
||||
state, privVals := makeGenesisState(t, ctx, cfg, genesisStateArgs{
|
||||
state, privVals := makeGenesisState(ctx, t, cfg, genesisStateArgs{
|
||||
Params: consensusParams,
|
||||
Time: tc.genesisTime,
|
||||
Validators: validators,
|
||||
|
||||
@@ -383,7 +383,7 @@ func TestReactorWithEvidence(t *testing.T) {
|
||||
tickerFunc := newMockTickerFunc(true)
|
||||
appFunc := newKVStore
|
||||
|
||||
valSet, privVals := factory.ValidatorSet(t, ctx, n, 30)
|
||||
valSet, privVals := factory.ValidatorSet(ctx, t, n, 30)
|
||||
genDoc := factory.GenesisDoc(cfg, time.Now(), valSet.Validators, nil)
|
||||
states := make([]*State, n)
|
||||
logger := consensusLogger()
|
||||
|
||||
@@ -33,7 +33,7 @@ func TestPeerCatchupRounds(t *testing.T) {
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
defer cancel()
|
||||
|
||||
valSet, privVals := factory.ValidatorSet(t, ctx, 10, 1)
|
||||
valSet, privVals := factory.ValidatorSet(ctx, t, 10, 1)
|
||||
|
||||
hvs := NewHeightVoteSet(cfg.ChainID(), 1, valSet)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user