abci: application type should take contexts (#8388)

This commit is contained in:
Sam Kleinman
2022-04-22 10:58:01 -04:00
committed by GitHub
parent 6970c9177b
commit 8345dc4f7c
38 changed files with 543 additions and 357 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ type testTx struct {
priority int64
}
func (app *application) CheckTx(req abci.RequestCheckTx) abci.ResponseCheckTx {
func (app *application) CheckTx(_ context.Context, req abci.RequestCheckTx) abci.ResponseCheckTx {
var (
priority int64
sender string
+11
View File
@@ -11,6 +11,8 @@ import (
mock "github.com/stretchr/testify/mock"
testing "testing"
types "github.com/tendermint/tendermint/types"
)
@@ -170,3 +172,12 @@ func (_m *Mempool) Update(ctx context.Context, blockHeight int64, blockTxs types
return r0
}
// NewMempool creates a new instance of Mempool. It also registers a cleanup function to assert the mocks expectations.
func NewMempool(t testing.TB) *Mempool {
mock := &Mempool{}
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}