4
4
eth "github.com/ethereum/go-ethereum"
5
5
ethTypes "github.com/ethereum/go-ethereum/core/types"
6
6
tmtcTypes "github.com/tendermint/tendermint/rpc/core/types"
7
+ tmtrpctypes "github.com/tendermint/tendermint/rpc/lib/types"
7
8
tmtTypes "github.com/tendermint/tendermint/types"
8
9
tmtCore "github.com/tendermint/tendermint/rpc/core"
9
10
"bytes"
@@ -19,8 +20,8 @@ type API interface {
19
20
20
21
type consensusApi struct {
21
22
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 )
24
25
}
25
26
26
27
var _ API = & consensusApi {}
@@ -34,7 +35,7 @@ func NewConsensusApi(isRunning func() bool) API {
34
35
}
35
36
36
37
func (a * consensusApi ) SyncProgress () (eth.SyncProgress , error ) {
37
- status , err := a .status ()
38
+ status , err := a .status (nil )
38
39
if err != nil {
39
40
return eth.SyncProgress {}, err
40
41
}
@@ -71,7 +72,7 @@ func (a *consensusApi) BroadcastTx(tx ethTypes.Transaction) error {
71
72
return err
72
73
}
73
74
74
- _ , err := a .broadcastTx (buf .Bytes ())
75
+ _ , err := a .broadcastTx (nil , buf .Bytes ())
75
76
if err != nil {
76
77
return err
77
78
}
@@ -84,7 +85,7 @@ func (a *consensusApi) Status() (tmtcTypes.ResultStatus, error) {
84
85
return tmtcTypes.ResultStatus {}, fmt .Errorf ("Consensus node is not running" )
85
86
}
86
87
87
- status , err := tmtCore .Status ()
88
+ status , err := tmtCore .Status (nil )
88
89
if err != nil {
89
90
return tmtcTypes.ResultStatus {}, err
90
91
}
0 commit comments