diff --git a/cmd/show_contract_summary/main.go b/cmd/show_contract_summary/main.go index 318fc124..6a6baeb5 100644 --- a/cmd/show_contract_summary/main.go +++ b/cmd/show_contract_summary/main.go @@ -10,8 +10,8 @@ import ( "math/big" "github.com/8thlight/vulcanizedb/cmd" + "github.com/8thlight/vulcanizedb/pkg/contract_summary" "github.com/8thlight/vulcanizedb/pkg/geth" - "github.com/8thlight/vulcanizedb/pkg/watched_contracts" ) func main() { @@ -24,11 +24,11 @@ func main() { repository := cmd.LoadPostgres(config.Database) blockNumber := requestedBlockNumber(_blockNumber) - contractSummary, err := watched_contracts.NewSummary(blockchain, repository, *contractHash, blockNumber) + contractSummary, err := contract_summary.NewSummary(blockchain, repository, *contractHash, blockNumber) if err != nil { log.Fatalln(err) } - output := watched_contracts.GenerateConsoleOutput(contractSummary) + output := contract_summary.GenerateConsoleOutput(contractSummary) fmt.Println(output) } diff --git a/pkg/watched_contracts/console_presenter.go b/pkg/contract_summary/console_presenter.go similarity index 98% rename from pkg/watched_contracts/console_presenter.go rename to pkg/contract_summary/console_presenter.go index badd8917..b577a769 100644 --- a/pkg/watched_contracts/console_presenter.go +++ b/pkg/contract_summary/console_presenter.go @@ -1,4 +1,4 @@ -package watched_contracts +package contract_summary import ( "fmt" diff --git a/pkg/watched_contracts/watched_contracts_suite_test.go b/pkg/contract_summary/contract_summary_suite_test.go similarity index 68% rename from pkg/watched_contracts/watched_contracts_suite_test.go rename to pkg/contract_summary/contract_summary_suite_test.go index 82ca609b..ce0e0fb5 100644 --- a/pkg/watched_contracts/watched_contracts_suite_test.go +++ b/pkg/contract_summary/contract_summary_suite_test.go @@ -1,4 +1,4 @@ -package watched_contracts_test +package contract_summary_test import ( . "github.com/onsi/ginkgo" @@ -9,5 +9,5 @@ import ( func TestWatchedContracts(t *testing.T) { RegisterFailHandler(Fail) - RunSpecs(t, "WatchedContracts Suite") + RunSpecs(t, "ContractSummary Suite") } diff --git a/pkg/watched_contracts/summary.go b/pkg/contract_summary/summary.go similarity index 98% rename from pkg/watched_contracts/summary.go rename to pkg/contract_summary/summary.go index 98ec4352..c684a635 100644 --- a/pkg/watched_contracts/summary.go +++ b/pkg/contract_summary/summary.go @@ -1,4 +1,4 @@ -package watched_contracts +package contract_summary import ( "errors" diff --git a/pkg/watched_contracts/summary_test.go b/pkg/contract_summary/summary_test.go similarity index 89% rename from pkg/watched_contracts/summary_test.go rename to pkg/contract_summary/summary_test.go index 8308ad03..ed2e9aa6 100644 --- a/pkg/watched_contracts/summary_test.go +++ b/pkg/contract_summary/summary_test.go @@ -1,18 +1,18 @@ -package watched_contracts_test +package contract_summary_test import ( "math/big" + "github.com/8thlight/vulcanizedb/pkg/contract_summary" "github.com/8thlight/vulcanizedb/pkg/core" "github.com/8thlight/vulcanizedb/pkg/fakes" "github.com/8thlight/vulcanizedb/pkg/repositories" - "github.com/8thlight/vulcanizedb/pkg/watched_contracts" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) -func NewCurrentContractSummary(blockchain core.Blockchain, repository repositories.Repository, contractHash string) (watched_contracts.ContractSummary, error) { - return watched_contracts.NewSummary(blockchain, repository, contractHash, nil) +func NewCurrentContractSummary(blockchain core.Blockchain, repository repositories.Repository, contractHash string) (contract_summary.ContractSummary, error) { + return contract_summary.NewSummary(blockchain, repository, contractHash, nil) } var _ = Describe("The watched contract summary", func() { @@ -24,7 +24,7 @@ var _ = Describe("The watched contract summary", func() { contractSummary, err := NewCurrentContractSummary(blockchain, repository, "0x123") - Expect(contractSummary).To(Equal(watched_contracts.ContractSummary{})) + Expect(contractSummary).To(Equal(contract_summary.ContractSummary{})) Expect(err).NotTo(BeNil()) }) }) @@ -38,7 +38,7 @@ var _ = Describe("The watched contract summary", func() { contractSummary, err := NewCurrentContractSummary(blockchain, repository, "0x123") - Expect(contractSummary).NotTo(Equal(watched_contracts.ContractSummary{})) + Expect(contractSummary).NotTo(Equal(contract_summary.ContractSummary{})) Expect(err).To(BeNil()) }) @@ -111,7 +111,7 @@ var _ = Describe("The watched contract summary", func() { blockchain.SetContractStateAttribute("0x123", nil, "foo", "bar") blockchain.SetContractStateAttribute("0x123", blockNumber, "foo", "baz") - contractSummary, _ := watched_contracts.NewSummary(blockchain, repository, "0x123", blockNumber) + contractSummary, _ := contract_summary.NewSummary(blockchain, repository, "0x123", blockNumber) attribute := contractSummary.GetStateAttribute("foo") Expect(attribute).To(Equal("baz"))