rpc: use interfaces for pipe

This commit is contained in:
Ethan Buchman
2016-10-14 21:38:49 -04:00
parent 7d493774c7
commit 2113b6f4bb
7 changed files with 79 additions and 45 deletions
+10 -3
View File
@@ -206,10 +206,9 @@ func (n *Node) StartRPC() ([]net.Listener, error) {
rpccore.SetEventSwitch(n.evsw)
rpccore.SetBlockStore(n.blockStore)
rpccore.SetConsensusState(n.consensusState)
rpccore.SetConsensusReactor(n.consensusReactor)
rpccore.SetMempoolReactor(n.mempoolReactor)
rpccore.SetMempool(n.mempoolReactor.Mempool)
rpccore.SetSwitch(n.sw)
rpccore.SetPrivValidator(n.privValidator)
rpccore.SetPubKey(n.privValidator.PubKey)
rpccore.SetGenesisDoc(n.genesisDoc)
rpccore.SetProxyAppQuery(n.proxyApp.Query())
@@ -260,6 +259,14 @@ func (n *Node) PrivValidator() *types.PrivValidator {
return n.privValidator
}
func (n *Node) GenesisDoc() *types.GenesisDoc {
return n.genesisDoc
}
func (n *Node) ProxyApp() proxy.AppConns {
return n.proxyApp
}
func makeNodeInfo(config cfg.Config, sw *p2p.Switch, privKey crypto.PrivKeyEd25519) *p2p.NodeInfo {
nodeInfo := &p2p.NodeInfo{