Skip to content

Commit

Permalink
Fixing UTs
Browse files Browse the repository at this point in the history
  • Loading branch information
sergio-mena committed Feb 4, 2022
1 parent 6011f23 commit 2c249e1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion internal/consensus/byzantine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ func TestByzantinePrevoteEquivocation(t *testing.T) {
proposerAddr := lazyNodeState.privValidatorPubKey.Address()

block, blockParts, err := lazyNodeState.blockExec.CreateProposalBlock(
lazyNodeState.Height, lazyNodeState.state, commit, proposerAddr,
ctx, lazyNodeState.Height, lazyNodeState.state, commit, proposerAddr,
)
require.NoError(t, err)

Expand Down
2 changes: 1 addition & 1 deletion internal/consensus/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ func decideProposal(
t.Helper()

cs1.mtx.Lock()
block, blockParts, err := cs1.createProposalBlock()
block, blockParts, err := cs1.createProposalBlock(ctx)
require.NoError(t, err)
validRound := cs1.ValidRound
chainID := cs1.state.ChainID
Expand Down
2 changes: 1 addition & 1 deletion internal/consensus/pbts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ func (p *pbtsTestHarness) nextHeight(ctx context.Context, t *testing.T, proposer

ensureNewRound(t, p.roundCh, p.currentHeight, p.currentRound)

b, _, err := p.observedState.createProposalBlock()
b, _, err := p.observedState.createProposalBlock(ctx)
require.NoError(t, err)
b.Height = p.currentHeight
b.Header.Height = p.currentHeight
Expand Down
8 changes: 4 additions & 4 deletions internal/consensus/replay_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ func setupSimulator(ctx context.Context, t *testing.T) *simulatorTestSuite {
newValidatorTx1 := kvstore.MakeValSetChangeTx(valPubKey1ABCI, testMinPower)
err = assertMempool(t, css[0].txNotifier).CheckTx(ctx, newValidatorTx1, nil, mempool.TxInfo{})
assert.NoError(t, err)
propBlock, _, err := css[0].createProposalBlock() // changeProposer(t, cs1, vs2)
propBlock, _, err := css[0].createProposalBlock(ctx) // changeProposer(t, cs1, vs2)
require.NoError(t, err)
propBlockParts, err := propBlock.MakePartSet(partSize)
require.NoError(t, err)
Expand Down Expand Up @@ -417,7 +417,7 @@ func setupSimulator(ctx context.Context, t *testing.T) *simulatorTestSuite {
updateValidatorTx1 := kvstore.MakeValSetChangeTx(updatePubKey1ABCI, 25)
err = assertMempool(t, css[0].txNotifier).CheckTx(ctx, updateValidatorTx1, nil, mempool.TxInfo{})
assert.NoError(t, err)
propBlock, _, err = css[0].createProposalBlock() // changeProposer(t, cs1, vs2)
propBlock, _, err = css[0].createProposalBlock(ctx) // changeProposer(t, cs1, vs2)
require.NoError(t, err)
propBlockParts, err = propBlock.MakePartSet(partSize)
require.NoError(t, err)
Expand Down Expand Up @@ -458,7 +458,7 @@ func setupSimulator(ctx context.Context, t *testing.T) *simulatorTestSuite {
newValidatorTx3 := kvstore.MakeValSetChangeTx(newVal3ABCI, testMinPower)
err = assertMempool(t, css[0].txNotifier).CheckTx(ctx, newValidatorTx3, nil, mempool.TxInfo{})
assert.NoError(t, err)
propBlock, _, err = css[0].createProposalBlock() // changeProposer(t, cs1, vs2)
propBlock, _, err = css[0].createProposalBlock(ctx) // changeProposer(t, cs1, vs2)
require.NoError(t, err)
propBlockParts, err = propBlock.MakePartSet(partSize)
require.NoError(t, err)
Expand Down Expand Up @@ -546,7 +546,7 @@ func setupSimulator(ctx context.Context, t *testing.T) *simulatorTestSuite {
removeValidatorTx3 := kvstore.MakeValSetChangeTx(newVal3ABCI, 0)
err = assertMempool(t, css[0].txNotifier).CheckTx(ctx, removeValidatorTx3, nil, mempool.TxInfo{})
assert.NoError(t, err)
propBlock, _, err = css[0].createProposalBlock() // changeProposer(t, cs1, vs2)
propBlock, _, err = css[0].createProposalBlock(ctx) // changeProposer(t, cs1, vs2)
require.NoError(t, err)
propBlockParts, err = propBlock.MakePartSet(partSize)
require.NoError(t, err)
Expand Down
8 changes: 4 additions & 4 deletions internal/consensus/state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ func TestStateBadProposal(t *testing.T) {
proposalCh := subscribe(ctx, t, cs1.eventBus, types.EventQueryCompleteProposal)
voteCh := subscribe(ctx, t, cs1.eventBus, types.EventQueryVote)

propBlock, _, err := cs1.createProposalBlock() // changeProposer(t, cs1, vs2)
propBlock, _, err := cs1.createProposalBlock(ctx) // changeProposer(t, cs1, vs2)
require.NoError(t, err)

// make the second validator the proposer by incrementing round
Expand Down Expand Up @@ -284,7 +284,7 @@ func TestStateOversizedBlock(t *testing.T) {
timeoutProposeCh := subscribe(ctx, t, cs1.eventBus, types.EventQueryTimeoutPropose)
voteCh := subscribe(ctx, t, cs1.eventBus, types.EventQueryVote)

propBlock, _, err := cs1.createProposalBlock()
propBlock, _, err := cs1.createProposalBlock(ctx)
require.NoError(t, err)
propBlock.Data.Txs = []types.Tx{tmrand.Bytes(2001)}
propBlock.Header.DataHash = propBlock.Data.Hash()
Expand Down Expand Up @@ -2535,7 +2535,7 @@ func TestStateTimestamp_ProposalNotMatch(t *testing.T) {
addr := pv1.Address()
voteCh := subscribeToVoter(ctx, t, cs1, addr)

propBlock, _, err := cs1.createProposalBlock()
propBlock, _, err := cs1.createProposalBlock(ctx)
require.NoError(t, err)
round++
incrementRound(vss[1:]...)
Expand Down Expand Up @@ -2584,7 +2584,7 @@ func TestStateTimestamp_ProposalMatch(t *testing.T) {
addr := pv1.Address()
voteCh := subscribeToVoter(ctx, t, cs1, addr)

propBlock, _, err := cs1.createProposalBlock()
propBlock, _, err := cs1.createProposalBlock(ctx)
require.NoError(t, err)
round++
incrementRound(vss[1:]...)
Expand Down

0 comments on commit 2c249e1

Please sign in to comment.