Skip to content

Commit 4cb19c0

Browse files
ggarriEnchanterIO
authored andcommitted
#166 Adding latest tendermint version compatibility
1 parent dc40ff1 commit 4cb19c0

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

consensus/api/api.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
eth "github.com/ethereum/go-ethereum"
55
ethTypes "github.com/ethereum/go-ethereum/core/types"
66
tmtcTypes "github.com/tendermint/tendermint/rpc/core/types"
7+
tmtrpctypes "github.com/tendermint/tendermint/rpc/lib/types"
78
tmtTypes "github.com/tendermint/tendermint/types"
89
tmtCore "github.com/tendermint/tendermint/rpc/core"
910
"bytes"
@@ -19,8 +20,8 @@ type API interface {
1920

2021
type consensusApi struct {
2122
isRunning func() bool
22-
status func() (*tmtcTypes.ResultStatus, error)
23-
broadcastTx func (tx tmtTypes.Tx) (*tmtcTypes.ResultBroadcastTx, error)
23+
status func(ctx *tmtrpctypes.Context) (*tmtcTypes.ResultStatus, error)
24+
broadcastTx func (ctx *tmtrpctypes.Context, tx tmtTypes.Tx) (*tmtcTypes.ResultBroadcastTx, error)
2425
}
2526

2627
var _ API = &consensusApi{}
@@ -34,7 +35,7 @@ func NewConsensusApi(isRunning func() bool) API {
3435
}
3536

3637
func (a *consensusApi) SyncProgress() (eth.SyncProgress, error) {
37-
status, err := a.status()
38+
status, err := a.status(nil)
3839
if err != nil {
3940
return eth.SyncProgress{}, err
4041
}
@@ -71,7 +72,7 @@ func (a *consensusApi) BroadcastTx(tx ethTypes.Transaction) error {
7172
return err
7273
}
7374

74-
_, err := a.broadcastTx(buf.Bytes())
75+
_, err := a.broadcastTx(nil, buf.Bytes())
7576
if err != nil {
7677
return err
7778
}
@@ -84,7 +85,7 @@ func (a *consensusApi) Status() (tmtcTypes.ResultStatus, error) {
8485
return tmtcTypes.ResultStatus{}, fmt.Errorf("Consensus node is not running")
8586
}
8687

87-
status, err := tmtCore.Status()
88+
status, err := tmtCore.Status(nil)
8889
if err != nil {
8990
return tmtcTypes.ResultStatus{}, err
9091
}

0 commit comments

Comments
 (0)