mirror of
https://github.com/fluencelabs/tendermint
synced 2025-06-23 01:41:31 +00:00
use request structs for InitChain and BeginBlock
This commit is contained in:
@ -109,23 +109,23 @@ func (app *localClient) CommitAsync() *ReqRes {
|
||||
)
|
||||
}
|
||||
|
||||
func (app *localClient) InitChainAsync(validators []*types.Validator) *ReqRes {
|
||||
func (app *localClient) InitChainAsync(params types.RequestInitChain) *ReqRes {
|
||||
app.mtx.Lock()
|
||||
app.Application.InitChain(validators)
|
||||
app.Application.InitChain(params)
|
||||
reqRes := app.callback(
|
||||
types.ToRequestInitChain(validators),
|
||||
types.ToRequestInitChain(params),
|
||||
types.ToResponseInitChain(),
|
||||
)
|
||||
app.mtx.Unlock()
|
||||
return reqRes
|
||||
}
|
||||
|
||||
func (app *localClient) BeginBlockAsync(hash []byte, header *types.Header) *ReqRes {
|
||||
func (app *localClient) BeginBlockAsync(params types.RequestBeginBlock) *ReqRes {
|
||||
app.mtx.Lock()
|
||||
app.Application.BeginBlock(hash, header)
|
||||
app.Application.BeginBlock(params)
|
||||
app.mtx.Unlock()
|
||||
return app.callback(
|
||||
types.ToRequestBeginBlock(hash, header),
|
||||
types.ToRequestBeginBlock(params),
|
||||
types.ToResponseBeginBlock(),
|
||||
)
|
||||
}
|
||||
@ -192,16 +192,16 @@ func (app *localClient) CommitSync() (res types.Result) {
|
||||
return res
|
||||
}
|
||||
|
||||
func (app *localClient) InitChainSync(validators []*types.Validator) (err error) {
|
||||
func (app *localClient) InitChainSync(params types.RequestInitChain) (err error) {
|
||||
app.mtx.Lock()
|
||||
app.Application.InitChain(validators)
|
||||
app.Application.InitChain(params)
|
||||
app.mtx.Unlock()
|
||||
return nil
|
||||
}
|
||||
|
||||
func (app *localClient) BeginBlockSync(hash []byte, header *types.Header) (err error) {
|
||||
func (app *localClient) BeginBlockSync(params types.RequestBeginBlock) (err error) {
|
||||
app.mtx.Lock()
|
||||
app.Application.BeginBlock(hash, header)
|
||||
app.Application.BeginBlock(params)
|
||||
app.mtx.Unlock()
|
||||
return nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user