func (cli *grpcClient) BeginBlockAsync(height uint64) *ReqRes { req := types.ToRequestBeginBlock(height) res, err := cli.client.BeginBlock(context.Background(), req.GetBeginBlock(), grpc.FailFast(true)) if err != nil { cli.StopForError(err) } return cli.finishAsyncCall(req, &types.Response{&types.Response_BeginBlock{res}}) }
func (cli *socketClient) BeginBlockSync(height uint64) (err error) { cli.queueRequest(types.ToRequestBeginBlock(height)) cli.FlushSync() if err := cli.Error(); err != nil { return err } return nil }
func (app *localClient) BeginBlockAsync(height uint64) *ReqRes { app.mtx.Lock() if bcApp, ok := app.Application.(types.BlockchainAware); ok { bcApp.BeginBlock(height) } app.mtx.Unlock() return app.callback( types.ToRequestBeginBlock(height), types.ToResponseBeginBlock(), ) }
func (cli *socketClient) BeginBlockAsync(height uint64) *ReqRes { return cli.queueRequest(types.ToRequestBeginBlock(height)) }