diff --git a/abci/client/grpc_client.go b/abci/client/grpc_client.go index 2034445b2..bf3d9efcf 100644 --- a/abci/client/grpc_client.go +++ b/abci/client/grpc_client.go @@ -309,26 +309,14 @@ func (cli *grpcClient) PrepareProposalAsync(params types.RequestPrepareProposal) return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_PrepareProposal{PrepareProposal: res}}) } -func (cli *grpcClient) ProcessProposalAsync( - ctx context.Context, - params types.RequestProcessProposal, -) (*ReqRes, error) { - +func (cli *grpcClient) ProcessProposalAsync(params types.RequestProcessProposal) *ReqRes { req := types.ToRequestProcessProposal(params) - res, err := cli.client.ProcessProposal(ctx, req.GetProcessProposal(), grpc.WaitForReady(true)) + res, err := cli.client.ProcessProposal(context.Background(), req.GetProcessProposal(), grpc.WaitForReady(true)) if err != nil { - return nil, err + cli.StopForError(err) } - return cli.finishAsyncCall( - ctx, - req, - &types.Response{ - Value: &types.Response_ProcessProposal{ - ProcessProposal: res, - }, - }, - ) + return cli.finishAsyncCall(req, &types.Response{Value: &types.Response_ProcessProposal{ProcessProposal: res}}) } // finishAsyncCall creates a ReqRes for an async call, and immediately populates it @@ -455,14 +443,7 @@ func (cli *grpcClient) PrepareProposalSync( return cli.finishSyncCall(reqres).GetPrepareProposal(), cli.Error() } -func (cli *grpcClient) ProcessProposalSync( - ctx context.Context, - params types.RequestProcessProposal, -) (*types.ResponseProcessProposal, error) { - - reqres, err := cli.ProcessProposalAsync(ctx, params) - if err != nil { - return nil, err - } +func (cli *grpcClient) ProcessProposalSync(params types.RequestProcessProposal) (*types.ResponseProcessProposal, error) { + reqres := cli.ProcessProposalAsync(params) return cli.finishSyncCall(reqres).GetProcessProposal(), cli.Error() } diff --git a/abci/client/local_client.go b/abci/client/local_client.go index e2773aa32..ba9fcaa2e 100644 --- a/abci/client/local_client.go +++ b/abci/client/local_client.go @@ -4,6 +4,7 @@ import ( types "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/libs/service" tmsync "github.com/tendermint/tendermint/libs/sync" + "golang.org/x/net/context" ) var _ Client = (*localClient)(nil) @@ -218,10 +219,7 @@ func (app *localClient) PrepareProposalAsync(req types.RequestPrepareProposal) * ) } -func (app *localClient) ProcessProposalAsync( - ctx context.Context, - req types.RequestProcessProposal, -) (*ReqRes, error) { +func (app *localClient) ProcessProposalAsync(req types.RequestProcessProposal) *ReqRes { app.mtx.Lock() defer app.mtx.Unlock() @@ -229,7 +227,7 @@ func (app *localClient) ProcessProposalAsync( return app.callback( types.ToRequestProcessProposal(req), types.ToResponseProcessProposal(res), - ), nil + ) } //------------------------------------------------------- diff --git a/abci/client/socket_client.go b/abci/client/socket_client.go index cea929c8c..40267fc30 100644 --- a/abci/client/socket_client.go +++ b/abci/client/socket_client.go @@ -15,6 +15,7 @@ import ( "github.com/tendermint/tendermint/libs/service" tmsync "github.com/tendermint/tendermint/libs/sync" "github.com/tendermint/tendermint/libs/timer" + "golang.org/x/net/context" ) const ( @@ -283,11 +284,8 @@ func (cli *socketClient) PrepareProposalAsync(req types.RequestPrepareProposal) return cli.queueRequest(types.ToRequestPrepareProposal(req)) } -func (cli *socketClient) ProcessProposalAsync( - ctx context.Context, - req types.RequestProcessProposal, -) (*ReqRes, error) { - return cli.queueRequestAsync(ctx, types.ToRequestProcessProposal(req)) +func (cli *socketClient) ProcessProposalAsync(req types.RequestProcessProposal) *ReqRes { + return cli.queueRequest(types.ToRequestProcessProposal(req)) } //----------------------------------------