func (cli *grpcClient) EndBlockAsync(height uint64) *ReqRes { req := types.ToRequestEndBlock(height) res, err := cli.client.EndBlock(context.Background(), req.GetEndBlock(), grpc.FailFast(true)) if err != nil { cli.StopForError(err) } return cli.finishAsyncCall(req, &types.Response{&types.Response_EndBlock{res}}) }
func (cli *socketClient) EndBlockSync(height uint64) (validators []*types.Validator, err error) { reqres := cli.queueRequest(types.ToRequestEndBlock(height)) cli.FlushSync() if err := cli.Error(); err != nil { return nil, err } return reqres.Response.GetEndBlock().Diffs, nil }
func (app *localClient) EndBlockAsync(height uint64) *ReqRes { app.mtx.Lock() var validators []*types.Validator if bcApp, ok := app.Application.(types.BlockchainAware); ok { validators = bcApp.EndBlock(height) } app.mtx.Unlock() return app.callback( types.ToRequestEndBlock(height), types.ToResponseEndBlock(validators), ) }
func (cli *socketClient) EndBlockAsync(height uint64) *ReqRes { return cli.queueRequest(types.ToRequestEndBlock(height)) }