Skip to content

Commit

Permalink
fix: add more fixing for abci.Client, Async()
Browse files Browse the repository at this point in the history
  • Loading branch information
egonspace committed Jul 8, 2021
1 parent 1413661 commit 0ed36c7
Show file tree
Hide file tree
Showing 5 changed files with 76 additions and 62 deletions.
39 changes: 39 additions & 0 deletions abci/client/mocks/client.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 0 additions & 4 deletions light/rpc/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import (
"testing"

ics23 "github.com/confio/ics23/go"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"

abci "github.com/line/ostracon/abci/types"
"github.com/line/ostracon/crypto/merkle"
Expand All @@ -19,7 +16,6 @@ import (
rpcmock "github.com/line/ostracon/rpc/client/mocks"
ctypes "github.com/line/ostracon/rpc/core/types"
"github.com/line/ostracon/types"
"github.com/line/tm-db/v2/memdb"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
Expand Down
14 changes: 8 additions & 6 deletions proxy/app_conn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
//----------------------------------------

type AppConnTest interface {
FlushSync() error
FlushSync() (*types.ResponseFlush, error)
EchoAsync(string, abcicli.ResponseCallback) *abcicli.ReqRes
InfoSync(types.RequestInfo) (*types.ResponseInfo, error)
}
Expand All @@ -33,7 +33,7 @@ func (app *appConnTest) EchoAsync(msg string, cb abcicli.ResponseCallback) *abci
return app.appConn.EchoAsync(msg, cb)
}

func (app *appConnTest) FlushSync() error {
func (app *appConnTest) FlushSync() (*types.ResponseFlush, error) {
return app.appConn.FlushSync()
}

Expand Down Expand Up @@ -77,8 +77,9 @@ func TestEcho(t *testing.T) {
for i := 0; i < 1000; i++ {
proxy.EchoAsync(fmt.Sprintf("echo-%v", i), nil)
}
if err := proxy.FlushSync(); err != nil {
t.Error(err)
_, err2 := proxy.FlushSync()
if err2 != nil {
t.Error(err2)
}
}

Expand Down Expand Up @@ -117,8 +118,9 @@ func BenchmarkEcho(b *testing.B) {
for i := 0; i < b.N; i++ {
proxy.EchoAsync(echoString, nil)
}
if err := proxy.FlushSync(); err != nil {
b.Error(err)
_, err2 := proxy.FlushSync()
if err2 != nil {
b.Error(err2)
}

b.StopTimer()
Expand Down
10 changes: 5 additions & 5 deletions proxy/mocks/app_conn_consensus.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

71 changes: 24 additions & 47 deletions proxy/mocks/app_conn_mempool.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0ed36c7

Please sign in to comment.