review fixes

This commit is contained in:
Ian Norden
2019-12-02 13:49:27 -06:00
parent 5be205ffa6
commit 4036d9d6a0
11 changed files with 31 additions and 46 deletions
+2 -2
View File
@@ -181,11 +181,11 @@ func getClients() (client.RPCClient, *ethclient.Client) {
func getWSClient() core.RPCClient {
wsRPCpath := viper.GetString("client.wsPath")
if wsRPCpath == "" {
LogWithCommand.Fatal(errors.New("getWSClient() was called but no ws rpc path is provided"))
logWithCommand.Fatal(errors.New("getWSClient() was called but no ws rpc path is provided"))
}
wsRPCClient, dialErr := rpc.Dial(wsRPCpath)
if dialErr != nil {
LogWithCommand.Fatal(dialErr)
logWithCommand.Fatal(dialErr)
}
return client.NewRPCClient(wsRPCClient, wsRPCpath)
}
+2 -2
View File
@@ -216,7 +216,7 @@ func configureSubscription() {
}
}
func getRPCClient() core.RpcClient {
func getRPCClient() core.RPCClient {
vulcPath := viper.GetString("subscription.path")
if vulcPath == "" {
vulcPath = "ws://127.0.0.1:8080" // default to and try the default ws url if no path is provided
@@ -225,5 +225,5 @@ func getRPCClient() core.RpcClient {
if err != nil {
logWithCommand.Fatal(err)
}
return client.NewRpcClient(rawRPCClient, vulcPath)
return client.NewRPCClient(rawRPCClient, vulcPath)
}
+3 -3
View File
@@ -77,16 +77,16 @@ func syncAndPublish() {
wg.Wait() // If an error was thrown, wg.Add was never called and this will fall through
}
func getBlockChainAndClient(path string) (*eth.BlockChain, core.RpcClient) {
func getBlockChainAndClient(path string) (*eth.BlockChain, core.RPCClient) {
rawRPCClient, dialErr := rpc.Dial(path)
if dialErr != nil {
logWithCommand.Fatal(dialErr)
}
rpcClient := client.NewRpcClient(rawRPCClient, ipc)
rpcClient := client.NewRPCClient(rawRPCClient, ipc)
ethClient := ethclient.NewClient(rawRPCClient)
vdbEthClient := client.NewEthClient(ethClient)
vdbNode := node.MakeNode(rpcClient)
transactionConverter := vRpc.NewRpcTransactionConverter(ethClient)
transactionConverter := vRpc.NewRPCTransactionConverter(ethClient)
blockChain := eth.NewBlockChain(vdbEthClient, rpcClient, vdbNode, transactionConverter)
return blockChain, rpcClient
}