Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 3fff289

Browse files
authored
Rename geth to eth, signifying client independence (#161)
1 parent f7c4a67 commit 3fff289

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+111
-111
lines changed

cmd/coldImport.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ import (
2323
"github.com/vulcanize/vulcanizedb/pkg/crypto"
2424
"github.com/vulcanize/vulcanizedb/pkg/datastore/ethereum"
2525
"github.com/vulcanize/vulcanizedb/pkg/datastore/postgres/repositories"
26+
"github.com/vulcanize/vulcanizedb/pkg/eth/cold_import"
27+
"github.com/vulcanize/vulcanizedb/pkg/eth/converters/cold_db"
28+
vulcCommon "github.com/vulcanize/vulcanizedb/pkg/eth/converters/common"
2629
"github.com/vulcanize/vulcanizedb/pkg/fs"
27-
"github.com/vulcanize/vulcanizedb/pkg/geth/cold_import"
28-
"github.com/vulcanize/vulcanizedb/pkg/geth/converters/cold_db"
29-
vulcCommon "github.com/vulcanize/vulcanizedb/pkg/geth/converters/common"
3030
"github.com/vulcanize/vulcanizedb/utils"
3131
)
3232

cmd/headerSync.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"github.com/vulcanize/vulcanizedb/pkg/core"
2626
"github.com/vulcanize/vulcanizedb/pkg/datastore"
2727
"github.com/vulcanize/vulcanizedb/pkg/datastore/postgres/repositories"
28-
"github.com/vulcanize/vulcanizedb/pkg/geth"
28+
"github.com/vulcanize/vulcanizedb/pkg/eth"
2929
"github.com/vulcanize/vulcanizedb/pkg/history"
3030
"github.com/vulcanize/vulcanizedb/utils"
3131
)
@@ -100,7 +100,7 @@ func headerSync() {
100100
}
101101
}
102102

103-
func validateArgs(blockChain *geth.BlockChain) {
103+
func validateArgs(blockChain *eth.BlockChain) {
104104
lastBlock, err := blockChain.LastBlock()
105105
if err != nil {
106106
LogWithCommand.Error("validateArgs: Error getting last block: ", err)

cmd/root.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ import (
2828
"github.com/spf13/viper"
2929

3030
"github.com/vulcanize/vulcanizedb/pkg/config"
31-
"github.com/vulcanize/vulcanizedb/pkg/geth"
32-
"github.com/vulcanize/vulcanizedb/pkg/geth/client"
33-
vRpc "github.com/vulcanize/vulcanizedb/pkg/geth/converters/rpc"
34-
"github.com/vulcanize/vulcanizedb/pkg/geth/node"
31+
"github.com/vulcanize/vulcanizedb/pkg/eth"
32+
"github.com/vulcanize/vulcanizedb/pkg/eth/client"
33+
vRpc "github.com/vulcanize/vulcanizedb/pkg/eth/converters/rpc"
34+
"github.com/vulcanize/vulcanizedb/pkg/eth/node"
3535
)
3636

3737
var (
@@ -155,12 +155,12 @@ func initConfig() {
155155
}
156156
}
157157

158-
func getBlockChain() *geth.BlockChain {
158+
func getBlockChain() *eth.BlockChain {
159159
rpcClient, ethClient := getClients()
160160
vdbEthClient := client.NewEthClient(ethClient)
161161
vdbNode := node.MakeNode(rpcClient)
162162
transactionConverter := vRpc.NewRpcTransactionConverter(ethClient)
163-
return geth.NewBlockChain(vdbEthClient, rpcClient, vdbNode, transactionConverter)
163+
return eth.NewBlockChain(vdbEthClient, rpcClient, vdbNode, transactionConverter)
164164
}
165165

166166
func getClients() (client.RpcClient, *ethclient.Client) {

integration_test/block_rewards_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ import (
2222
. "github.com/onsi/ginkgo"
2323
. "github.com/onsi/gomega"
2424

25-
"github.com/vulcanize/vulcanizedb/pkg/geth"
26-
"github.com/vulcanize/vulcanizedb/pkg/geth/client"
27-
vRpc "github.com/vulcanize/vulcanizedb/pkg/geth/converters/rpc"
28-
"github.com/vulcanize/vulcanizedb/pkg/geth/node"
25+
"github.com/vulcanize/vulcanizedb/pkg/eth"
26+
"github.com/vulcanize/vulcanizedb/pkg/eth/client"
27+
vRpc "github.com/vulcanize/vulcanizedb/pkg/eth/converters/rpc"
28+
"github.com/vulcanize/vulcanizedb/pkg/eth/node"
2929
"github.com/vulcanize/vulcanizedb/test_config"
3030
)
3131

@@ -39,7 +39,7 @@ var _ = Describe("Rewards calculations", func() {
3939
blockChainClient := client.NewEthClient(ethClient)
4040
node := node.MakeNode(rpcClient)
4141
transactionConverter := vRpc.NewRpcTransactionConverter(ethClient)
42-
blockChain := geth.NewBlockChain(blockChainClient, rpcClient, node, transactionConverter)
42+
blockChain := eth.NewBlockChain(blockChainClient, rpcClient, node, transactionConverter)
4343
block, err := blockChain.GetBlockByNumber(1071819)
4444
Expect(err).ToNot(HaveOccurred())
4545
Expect(block.Reward).To(Equal("5313550000000000000"))
@@ -53,7 +53,7 @@ var _ = Describe("Rewards calculations", func() {
5353
blockChainClient := client.NewEthClient(ethClient)
5454
node := node.MakeNode(rpcClient)
5555
transactionConverter := vRpc.NewRpcTransactionConverter(ethClient)
56-
blockChain := geth.NewBlockChain(blockChainClient, rpcClient, node, transactionConverter)
56+
blockChain := eth.NewBlockChain(blockChainClient, rpcClient, node, transactionConverter)
5757
block, err := blockChain.GetBlockByNumber(1071819)
5858
Expect(err).ToNot(HaveOccurred())
5959
Expect(block.UnclesReward).To(Equal("6875000000000000000"))

integration_test/contract_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,11 @@ import (
2626
. "github.com/onsi/gomega"
2727

2828
"github.com/vulcanize/vulcanizedb/pkg/core"
29-
"github.com/vulcanize/vulcanizedb/pkg/geth"
30-
"github.com/vulcanize/vulcanizedb/pkg/geth/client"
31-
rpc2 "github.com/vulcanize/vulcanizedb/pkg/geth/converters/rpc"
32-
"github.com/vulcanize/vulcanizedb/pkg/geth/node"
33-
"github.com/vulcanize/vulcanizedb/pkg/geth/testing"
29+
"github.com/vulcanize/vulcanizedb/pkg/eth"
30+
"github.com/vulcanize/vulcanizedb/pkg/eth/client"
31+
rpc2 "github.com/vulcanize/vulcanizedb/pkg/eth/converters/rpc"
32+
"github.com/vulcanize/vulcanizedb/pkg/eth/node"
33+
"github.com/vulcanize/vulcanizedb/pkg/eth/testing"
3434
"github.com/vulcanize/vulcanizedb/test_config"
3535
)
3636

@@ -56,7 +56,7 @@ var _ = Describe("Reading contracts", func() {
5656
blockChainClient := client.NewEthClient(ethClient)
5757
node := node.MakeNode(rpcClient)
5858
transactionConverter := rpc2.NewRpcTransactionConverter(ethClient)
59-
blockChain := geth.NewBlockChain(blockChainClient, rpcClient, node, transactionConverter)
59+
blockChain := eth.NewBlockChain(blockChainClient, rpcClient, node, transactionConverter)
6060
contract := testing.SampleContract()
6161

6262
logs, err := blockChain.GetFullSyncLogs(contract, big.NewInt(4703824), nil)
@@ -74,7 +74,7 @@ var _ = Describe("Reading contracts", func() {
7474
blockChainClient := client.NewEthClient(ethClient)
7575
node := node.MakeNode(rpcClient)
7676
transactionConverter := rpc2.NewRpcTransactionConverter(ethClient)
77-
blockChain := geth.NewBlockChain(blockChainClient, rpcClient, node, transactionConverter)
77+
blockChain := eth.NewBlockChain(blockChainClient, rpcClient, node, transactionConverter)
7878

7979
logs, err := blockChain.GetFullSyncLogs(core.Contract{Hash: "0x123"}, big.NewInt(4703824), nil)
8080

@@ -92,7 +92,7 @@ var _ = Describe("Reading contracts", func() {
9292
blockChainClient := client.NewEthClient(ethClient)
9393
node := node.MakeNode(rpcClient)
9494
transactionConverter := rpc2.NewRpcTransactionConverter(ethClient)
95-
blockChain := geth.NewBlockChain(blockChainClient, rpcClient, node, transactionConverter)
95+
blockChain := eth.NewBlockChain(blockChainClient, rpcClient, node, transactionConverter)
9696

9797
contract := testing.SampleContract()
9898
var balance = new(big.Int)

integration_test/geth_blockchain_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ import (
2424
. "github.com/onsi/gomega"
2525

2626
"github.com/vulcanize/vulcanizedb/pkg/core"
27+
"github.com/vulcanize/vulcanizedb/pkg/eth"
28+
"github.com/vulcanize/vulcanizedb/pkg/eth/client"
29+
rpc2 "github.com/vulcanize/vulcanizedb/pkg/eth/converters/rpc"
30+
"github.com/vulcanize/vulcanizedb/pkg/eth/node"
2731
"github.com/vulcanize/vulcanizedb/pkg/fakes"
28-
"github.com/vulcanize/vulcanizedb/pkg/geth"
29-
"github.com/vulcanize/vulcanizedb/pkg/geth/client"
30-
rpc2 "github.com/vulcanize/vulcanizedb/pkg/geth/converters/rpc"
31-
"github.com/vulcanize/vulcanizedb/pkg/geth/node"
3232
"github.com/vulcanize/vulcanizedb/pkg/history"
3333
"github.com/vulcanize/vulcanizedb/test_config"
3434
)
3535

3636
var _ = Describe("Reading from the Geth blockchain", func() {
37-
var blockChain *geth.BlockChain
37+
var blockChain *eth.BlockChain
3838

3939
BeforeEach(func() {
4040
rawRpcClient, err := rpc.Dial(test_config.InfuraClient.IPCPath)
@@ -44,7 +44,7 @@ var _ = Describe("Reading from the Geth blockchain", func() {
4444
blockChainClient := client.NewEthClient(ethClient)
4545
node := node.MakeNode(rpcClient)
4646
transactionConverter := rpc2.NewRpcTransactionConverter(ethClient)
47-
blockChain = geth.NewBlockChain(blockChainClient, rpcClient, node, transactionConverter)
47+
blockChain = eth.NewBlockChain(blockChainClient, rpcClient, node, transactionConverter)
4848
})
4949

5050
It("reads two blocks", func(done Done) {

pkg/config/contract.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package config
1919
import (
2020
log "github.com/sirupsen/logrus"
2121
"github.com/spf13/viper"
22-
"github.com/vulcanize/vulcanizedb/pkg/geth"
22+
"github.com/vulcanize/vulcanizedb/pkg/eth"
2323
"strings"
2424
)
2525

@@ -98,7 +98,7 @@ func (contractConfig *ContractConfig) PrepConfig() {
9898
}
9999
}
100100
if abi != "" {
101-
if _, abiErr := geth.ParseAbi(abi); abiErr != nil {
101+
if _, abiErr := eth.ParseAbi(abi); abiErr != nil {
102102
log.Fatal(addr, "transformer `abi` not valid JSON")
103103
}
104104
}

pkg/contract_watcher/shared/getter/getter_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ import (
2424

2525
"github.com/vulcanize/vulcanizedb/pkg/contract_watcher/shared/constants"
2626
"github.com/vulcanize/vulcanizedb/pkg/contract_watcher/shared/getter"
27-
"github.com/vulcanize/vulcanizedb/pkg/geth"
28-
"github.com/vulcanize/vulcanizedb/pkg/geth/client"
29-
rpc2 "github.com/vulcanize/vulcanizedb/pkg/geth/converters/rpc"
30-
"github.com/vulcanize/vulcanizedb/pkg/geth/node"
27+
"github.com/vulcanize/vulcanizedb/pkg/eth"
28+
"github.com/vulcanize/vulcanizedb/pkg/eth/client"
29+
rpc2 "github.com/vulcanize/vulcanizedb/pkg/eth/converters/rpc"
30+
"github.com/vulcanize/vulcanizedb/pkg/eth/node"
3131
"github.com/vulcanize/vulcanizedb/test_config"
3232
)
3333

@@ -45,12 +45,12 @@ var _ = Describe("Interface Getter", func() {
4545
blockChainClient := client.NewEthClient(ethClient)
4646
node := node.MakeNode(rpcClient)
4747
transactionConverter := rpc2.NewRpcTransactionConverter(ethClient)
48-
blockChain := geth.NewBlockChain(blockChainClient, rpcClient, node, transactionConverter)
48+
blockChain := eth.NewBlockChain(blockChainClient, rpcClient, node, transactionConverter)
4949
interfaceGetter := getter.NewInterfaceGetter(blockChain)
5050
abi, err := interfaceGetter.GetABI(constants.PublicResolverAddress, blockNumber)
5151
Expect(err).NotTo(HaveOccurred())
5252
Expect(abi).To(Equal(expectedABI))
53-
_, err = geth.ParseAbi(abi)
53+
_, err = eth.ParseAbi(abi)
5454
Expect(err).ToNot(HaveOccurred())
5555
})
5656
})

pkg/contract_watcher/shared/helpers/test_helpers/database.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ import (
3030
"github.com/vulcanize/vulcanizedb/pkg/core"
3131
"github.com/vulcanize/vulcanizedb/pkg/datastore/postgres"
3232
"github.com/vulcanize/vulcanizedb/pkg/datastore/postgres/repositories"
33-
"github.com/vulcanize/vulcanizedb/pkg/geth"
34-
"github.com/vulcanize/vulcanizedb/pkg/geth/client"
35-
rpc2 "github.com/vulcanize/vulcanizedb/pkg/geth/converters/rpc"
36-
"github.com/vulcanize/vulcanizedb/pkg/geth/node"
33+
"github.com/vulcanize/vulcanizedb/pkg/eth"
34+
"github.com/vulcanize/vulcanizedb/pkg/eth/client"
35+
rpc2 "github.com/vulcanize/vulcanizedb/pkg/eth/converters/rpc"
36+
"github.com/vulcanize/vulcanizedb/pkg/eth/node"
3737
"github.com/vulcanize/vulcanizedb/test_config"
3838
)
3939

@@ -117,7 +117,7 @@ func SetupDBandBC() (*postgres.DB, core.BlockChain) {
117117
blockChainClient := client.NewEthClient(ethClient)
118118
madeNode := node.MakeNode(rpcClient)
119119
transactionConverter := rpc2.NewRpcTransactionConverter(ethClient)
120-
blockChain := geth.NewBlockChain(blockChainClient, rpcClient, madeNode, transactionConverter)
120+
blockChain := eth.NewBlockChain(blockChainClient, rpcClient, madeNode, transactionConverter)
121121

122122
db, err := postgres.NewDB(config.Database{
123123
Hostname: "localhost",

pkg/contract_watcher/shared/helpers/test_helpers/mocks/parser.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"github.com/ethereum/go-ethereum/accounts/abi"
2121

2222
"github.com/vulcanize/vulcanizedb/pkg/contract_watcher/shared/types"
23-
"github.com/vulcanize/vulcanizedb/pkg/geth"
23+
"github.com/vulcanize/vulcanizedb/pkg/eth"
2424
)
2525

2626
// Mock parser
@@ -50,7 +50,7 @@ func (p *parser) ParsedAbi() abi.ABI {
5050
// for the given contract address
5151
func (p *parser) Parse() error {
5252
var err error
53-
p.parsedAbi, err = geth.ParseAbi(p.abi)
53+
p.parsedAbi, err = eth.ParseAbi(p.abi)
5454

5555
return err
5656
}

0 commit comments

Comments
 (0)