adapt Tendermint to new abci.Client interface

which was introduced in https://github.com/tendermint/abci/pull/130
This commit is contained in:
Anton Kaliaev
2017-11-22 18:55:09 -06:00
parent 4a31532897
commit f65e357d2b
16 changed files with 94 additions and 75 deletions

View File

@ -80,7 +80,7 @@ func TestABCIResponsesSaveLoad(t *testing.T) {
abciResponses := NewABCIResponses(block)
abciResponses.DeliverTx[0] = &abci.ResponseDeliverTx{Data: []byte("foo"), Tags: []*abci.KVPair{}}
abciResponses.DeliverTx[1] = &abci.ResponseDeliverTx{Data: []byte("bar"), Log: "ok", Tags: []*abci.KVPair{}}
abciResponses.EndBlock = abci.ResponseEndBlock{Diffs: []*abci.Validator{
abciResponses.EndBlock = &abci.ResponseEndBlock{Diffs: []*abci.Validator{
{
PubKey: crypto.GenPrivKeyEd25519().PubKey().Bytes(),
Power: 10,
@ -198,12 +198,13 @@ func makeHeaderPartsResponses(state *State, height int,
block := makeBlock(height, state)
_, val := state.Validators.GetByIndex(0)
abciResponses := &ABCIResponses{
Height: height,
Height: height,
EndBlock: &abci.ResponseEndBlock{Diffs: []*abci.Validator{}},
}
// if the pubkey is new, remove the old and add the new
if !bytes.Equal(pubkey.Bytes(), val.PubKey.Bytes()) {
abciResponses.EndBlock = abci.ResponseEndBlock{
abciResponses.EndBlock = &abci.ResponseEndBlock{
Diffs: []*abci.Validator{
{val.PubKey.Bytes(), 0},
{pubkey.Bytes(), 10},