Rename watched_contracts package to contract_summary

This commit is contained in:
Eric Meyer 2017-12-04 15:36:11 -06:00
parent 5aa0bcd6ce
commit e432219e20
5 changed files with 14 additions and 14 deletions

View File

@ -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)
}

View File

@ -1,4 +1,4 @@
package watched_contracts
package contract_summary
import (
"fmt"

View File

@ -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")
}

View File

@ -1,4 +1,4 @@
package watched_contracts
package contract_summary
import (
"errors"

View File

@ -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"))