mirror of
https://github.com/tendermint/tendermint.git
synced 2026-08-22 15:16:24 +00:00
rename NewABCIClient to NewClient
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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())
|
||||
|
||||
|
||||
@@ -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())
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user