Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: remove abci flush() #216

Merged
merged 2 commits into from
Apr 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions abci/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ type Client interface {
SetResponseCallback(Callback)
Error() error

FlushAsync() *ReqRes
EchoAsync(msg string) *ReqRes
InfoAsync(types.RequestInfo) *ReqRes
SetOptionAsync(types.RequestSetOption) *ReqRes
Expand All @@ -44,7 +43,6 @@ type Client interface {
LoadSnapshotChunkAsync(types.RequestLoadSnapshotChunk) *ReqRes
ApplySnapshotChunkAsync(types.RequestApplySnapshotChunk) *ReqRes

FlushSync() error
EchoSync(msg string) (*types.ResponseEcho, error)
InfoSync(types.RequestInfo) (*types.ResponseInfo, error)
SetOptionSync(types.RequestSetOption) (*types.ResponseSetOption, error)
Expand Down
9 changes: 0 additions & 9 deletions abci/client/grpc_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,6 @@ func (cli *grpcClient) EchoAsync(msg string) *ReqRes {
return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_Echo{Echo: res}})
}

func (cli *grpcClient) FlushAsync() *ReqRes {
req := types.ToRequestFlush()
res, err := cli.client.Flush(context.Background(), req.GetFlush(), grpc.WaitForReady(true))
if err != nil {
cli.StopForError(err)
}
return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_Flush{Flush: res}})
}

func (cli *grpcClient) InfoAsync(params types.RequestInfo) *ReqRes {
req := types.ToRequestInfo(params)
res, err := cli.client.Info(context.Background(), req.GetInfo(), grpc.WaitForReady(true))
Expand Down
2 changes: 0 additions & 2 deletions abci/client/grpc_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ func TestProperSyncCalls(t *testing.T) {
go func() {
// This is BeginBlockSync unrolled....
reqres := c.BeginBlockAsync(types.RequestBeginBlock{})
err := c.FlushSync()
require.NoError(t, err)
res := reqres.Response.GetBeginBlock()
require.NotNil(t, res)
resp <- c.Error()
Expand Down
5 changes: 0 additions & 5 deletions abci/client/local_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,6 @@ func (app *localClient) Error() error {
return nil
}

func (app *localClient) FlushAsync() *ReqRes {
// Do nothing
return newLocalReqRes(types.ToRequestFlush(), nil)
}

func (app *localClient) EchoAsync(msg string) *ReqRes {
app.mtx.Lock()
defer app.mtx.Unlock()
Expand Down
8 changes: 0 additions & 8 deletions abci/tests/benchmarks/simple/simple.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"fmt"
"io"
"log"
"reflect"

"github.com/line/ostracon/abci/types"
tmnet "github.com/line/ostracon/libs/net"
Expand Down Expand Up @@ -41,10 +40,6 @@ func makeRequest(conn io.ReadWriter, req *types.Request) (*types.Response, error
if err != nil {
return nil, err
}
err = types.WriteMessage(types.ToRequestFlush(), bufWriter)
if err != nil {
return nil, err
}
err = bufWriter.Flush()
if err != nil {
return nil, err
Expand All @@ -61,9 +56,6 @@ func makeRequest(conn io.ReadWriter, req *types.Request) (*types.Response, error
if err != nil {
return nil, err
}
if _, ok := resFlush.Value.(*types.Response_Flush); !ok {
return nil, fmt.Errorf("expected flush response but got something else: %v", reflect.TypeOf(resFlush))
}

return res, nil
}
4 changes: 0 additions & 4 deletions abci/types/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,6 @@ func (app *GRPCApplication) Echo(ctx context.Context, req *RequestEcho) (*Respon
return &ResponseEcho{Message: req.Message}, nil
}

func (app *GRPCApplication) Flush(ctx context.Context, req *RequestFlush) (*ResponseFlush, error) {
return &ResponseFlush{}, nil
}

func (app *GRPCApplication) Info(ctx context.Context, req *RequestInfo) (*ResponseInfo, error) {
res := app.app.Info(*req)
return &res, nil
Expand Down
12 changes: 0 additions & 12 deletions abci/types/messages.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,6 @@ func ToRequestEcho(message string) *Request {
}
}

func ToRequestFlush() *Request {
return &Request{
Value: &Request_Flush{&RequestFlush{}},
}
}

func ToRequestInfo(req RequestInfo) *Request {
return &Request{
Value: &Request_Info{&req},
Expand Down Expand Up @@ -185,12 +179,6 @@ func ToResponseEcho(message string) *Response {
}
}

func ToResponseFlush() *Response {
return &Response{
Value: &Response_Flush{&ResponseFlush{}},
}
}

func ToResponseInfo(res ResponseInfo) *Response {
return &Response{
Value: &Response_Info{&res},
Expand Down
Loading