rename NewABCIClient to NewClient

This commit is contained in:
tycho garen
2021-09-17 15:27:21 -04:00
parent fac73f065b
commit d3a421b136
10 changed files with 18 additions and 18 deletions
+3 -3
View File
@@ -11,8 +11,8 @@ import (
// Creator creates new ABCI clients.
type Creator interface {
// NewABCIClient returns a new ABCI client.
NewABCIClient() (Client, error)
// NewClient returns a new ABCI client.
NewClient() (Client, error)
}
//----------------------------------------------------
@@ -56,7 +56,7 @@ func NewRemoteCreator(addr, transport string, mustConnect bool) Creator {
}
}
func (r *remoteCreator) NewABCIClient() (Client, error) {
func (r *remoteCreator) NewClient() (Client, error) {
remoteApp, err := NewClient(r.addr, r.transport, r.mustConnect)
if err != nil {
return nil, fmt.Errorf("failed to connect to proxy: %w", err)
+1 -1
View File
@@ -58,7 +58,7 @@ func newMockProxyApp(appHash []byte, abciResponses *tmstate.ABCIResponses) proxy
appHash: appHash,
abciResponses: abciResponses,
})
cli, _ := clientCreator.NewABCIClient()
cli, _ := clientCreator.NewClient()
err := cli.Start()
if err != nil {
panic(err)
+3 -3
View File
@@ -36,7 +36,7 @@ func newMempoolWithApp(cc abciclient.Creator) (*CListMempool, cleanupFunc) {
}
func newMempoolWithAppAndConfig(cc abciclient.Creator, config *cfg.Config) (*CListMempool, cleanupFunc) {
appConnMem, _ := cc.NewABCIClient()
appConnMem, _ := cc.NewClient()
appConnMem.SetLogger(log.TestingLogger().With("module", "abci-client", "connection", "mempool"))
err := appConnMem.Start()
if err != nil {
@@ -313,7 +313,7 @@ func TestSerialReap(t *testing.T) {
mp, cleanup := newMempoolWithApp(cc)
defer cleanup()
appConnCon, _ := cc.NewABCIClient()
appConnCon, _ := cc.NewClient()
appConnCon.SetLogger(log.TestingLogger().With("module", "abci-client", "connection", "consensus"))
err := appConnCon.Start()
require.Nil(t, err)
@@ -518,7 +518,7 @@ func TestMempoolTxsBytes(t *testing.T) {
require.NoError(t, err)
assert.EqualValues(t, 8, mp.SizeBytes())
appConnCon, _ := cc.NewABCIClient()
appConnCon, _ := cc.NewClient()
appConnCon.SetLogger(log.TestingLogger().With("module", "abci-client", "connection", "consensus"))
err = appConnCon.Start()
require.Nil(t, err)
+1 -1
View File
@@ -82,7 +82,7 @@ func setup(t testing.TB, cacheSize int, options ...TxMempoolOption) *TxMempool {
cfg := config.ResetTestRoot(strings.ReplaceAll(t.Name(), "/", "|"))
cfg.Mempool.CacheSize = cacheSize
appConnMem, err := cc.NewABCIClient()
appConnMem, err := cc.NewClient()
require.NoError(t, err)
require.NoError(t, appConnMem.Start())
+3 -3
View File
@@ -63,7 +63,7 @@ func TestEcho(t *testing.T) {
})
// Start client
cli, err := clientCreator.NewABCIClient()
cli, err := clientCreator.NewClient()
if err != nil {
t.Fatalf("Error creating ABCI client: %v", err.Error())
}
@@ -111,7 +111,7 @@ func BenchmarkEcho(b *testing.B) {
})
// Start client
cli, err := clientCreator.NewABCIClient()
cli, err := clientCreator.NewClient()
if err != nil {
b.Fatalf("Error creating ABCI client: %v", err.Error())
}
@@ -164,7 +164,7 @@ func TestInfo(t *testing.T) {
})
// Start client
cli, err := clientCreator.NewABCIClient()
cli, err := clientCreator.NewClient()
if err != nil {
t.Fatalf("Error creating ABCI client: %v", err.Error())
}
+2 -2
View File
@@ -12,8 +12,8 @@ type ClientCreator struct {
mock.Mock
}
// NewABCIClient provides a mock function with given fields:
func (_m *ClientCreator) NewABCIClient() (abciclient.Client, error) {
// NewClient provides a mock function with given fields:
func (_m *ClientCreator) NewClient() (abciclient.Client, error) {
ret := _m.Called()
var r0 abciclient.Client
+1 -1
View File
@@ -179,7 +179,7 @@ func (app *multiAppConn) stopAllClients() {
}
func (app *multiAppConn) abciClientFor(conn string) (abciclient.Client, error) {
c, err := app.clientCreator.NewABCIClient()
c, err := app.clientCreator.NewClient()
if err != nil {
return nil, fmt.Errorf("error creating ABCI client (%s connection): %w", conn, err)
}
+2 -2
View File
@@ -26,7 +26,7 @@ func TestAppConns_Start_Stop(t *testing.T) {
clientMock.On("Stop").Return(nil).Times(4)
clientMock.On("Quit").Return(quitCh).Times(4)
clientCreatorMock.On("NewABCIClient").Return(clientMock, nil).Times(4)
clientCreatorMock.On("NewClient").Return(clientMock, nil).Times(4)
appConns := NewAppConns(clientCreatorMock)
@@ -66,7 +66,7 @@ func TestAppConns_Failure(t *testing.T) {
clientMock.On("Quit").Return(recvQuitCh)
clientMock.On("Error").Return(errors.New("EOF")).Once()
clientCreatorMock.On("NewABCIClient").Return(clientMock, nil)
clientCreatorMock.On("NewClient").Return(clientMock, nil)
appConns := NewAppConns(clientCreatorMock)
+1 -1
View File
@@ -15,7 +15,7 @@ var mp mempool.Mempool
func init() {
app := kvstore.NewApplication()
cc := abciclient.NewLocalCreator(app)
appConnMem, _ := cc.NewABCIClient()
appConnMem, _ := cc.NewClient()
err := appConnMem.Start()
if err != nil {
panic(err)
+1 -1
View File
@@ -15,7 +15,7 @@ var mp mempool.Mempool
func init() {
app := kvstore.NewApplication()
cc := abciclient.NewLocalCreator(app)
appConnMem, _ := cc.NewABCIClient()
appConnMem, _ := cc.NewClient()
err := appConnMem.Start()
if err != nil {
panic(err)