Rename watched_contracts package to contract_summary
This commit is contained in:
parent
5aa0bcd6ce
commit
e432219e20
@ -10,8 +10,8 @@ import (
|
|||||||
"math/big"
|
"math/big"
|
||||||
|
|
||||||
"github.com/8thlight/vulcanizedb/cmd"
|
"github.com/8thlight/vulcanizedb/cmd"
|
||||||
|
"github.com/8thlight/vulcanizedb/pkg/contract_summary"
|
||||||
"github.com/8thlight/vulcanizedb/pkg/geth"
|
"github.com/8thlight/vulcanizedb/pkg/geth"
|
||||||
"github.com/8thlight/vulcanizedb/pkg/watched_contracts"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@ -24,11 +24,11 @@ func main() {
|
|||||||
repository := cmd.LoadPostgres(config.Database)
|
repository := cmd.LoadPostgres(config.Database)
|
||||||
blockNumber := requestedBlockNumber(_blockNumber)
|
blockNumber := requestedBlockNumber(_blockNumber)
|
||||||
|
|
||||||
contractSummary, err := watched_contracts.NewSummary(blockchain, repository, *contractHash, blockNumber)
|
contractSummary, err := contract_summary.NewSummary(blockchain, repository, *contractHash, blockNumber)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatalln(err)
|
log.Fatalln(err)
|
||||||
}
|
}
|
||||||
output := watched_contracts.GenerateConsoleOutput(contractSummary)
|
output := contract_summary.GenerateConsoleOutput(contractSummary)
|
||||||
fmt.Println(output)
|
fmt.Println(output)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package watched_contracts
|
package contract_summary
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
@ -1,4 +1,4 @@
|
|||||||
package watched_contracts_test
|
package contract_summary_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
@ -9,5 +9,5 @@ import (
|
|||||||
|
|
||||||
func TestWatchedContracts(t *testing.T) {
|
func TestWatchedContracts(t *testing.T) {
|
||||||
RegisterFailHandler(Fail)
|
RegisterFailHandler(Fail)
|
||||||
RunSpecs(t, "WatchedContracts Suite")
|
RunSpecs(t, "ContractSummary Suite")
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package watched_contracts
|
package contract_summary
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
@ -1,18 +1,18 @@
|
|||||||
package watched_contracts_test
|
package contract_summary_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"math/big"
|
"math/big"
|
||||||
|
|
||||||
|
"github.com/8thlight/vulcanizedb/pkg/contract_summary"
|
||||||
"github.com/8thlight/vulcanizedb/pkg/core"
|
"github.com/8thlight/vulcanizedb/pkg/core"
|
||||||
"github.com/8thlight/vulcanizedb/pkg/fakes"
|
"github.com/8thlight/vulcanizedb/pkg/fakes"
|
||||||
"github.com/8thlight/vulcanizedb/pkg/repositories"
|
"github.com/8thlight/vulcanizedb/pkg/repositories"
|
||||||
"github.com/8thlight/vulcanizedb/pkg/watched_contracts"
|
|
||||||
. "github.com/onsi/ginkgo"
|
. "github.com/onsi/ginkgo"
|
||||||
. "github.com/onsi/gomega"
|
. "github.com/onsi/gomega"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewCurrentContractSummary(blockchain core.Blockchain, repository repositories.Repository, contractHash string) (watched_contracts.ContractSummary, error) {
|
func NewCurrentContractSummary(blockchain core.Blockchain, repository repositories.Repository, contractHash string) (contract_summary.ContractSummary, error) {
|
||||||
return watched_contracts.NewSummary(blockchain, repository, contractHash, nil)
|
return contract_summary.NewSummary(blockchain, repository, contractHash, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ = Describe("The watched contract summary", func() {
|
var _ = Describe("The watched contract summary", func() {
|
||||||
@ -24,7 +24,7 @@ var _ = Describe("The watched contract summary", func() {
|
|||||||
|
|
||||||
contractSummary, err := NewCurrentContractSummary(blockchain, repository, "0x123")
|
contractSummary, err := NewCurrentContractSummary(blockchain, repository, "0x123")
|
||||||
|
|
||||||
Expect(contractSummary).To(Equal(watched_contracts.ContractSummary{}))
|
Expect(contractSummary).To(Equal(contract_summary.ContractSummary{}))
|
||||||
Expect(err).NotTo(BeNil())
|
Expect(err).NotTo(BeNil())
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -38,7 +38,7 @@ var _ = Describe("The watched contract summary", func() {
|
|||||||
|
|
||||||
contractSummary, err := NewCurrentContractSummary(blockchain, repository, "0x123")
|
contractSummary, err := NewCurrentContractSummary(blockchain, repository, "0x123")
|
||||||
|
|
||||||
Expect(contractSummary).NotTo(Equal(watched_contracts.ContractSummary{}))
|
Expect(contractSummary).NotTo(Equal(contract_summary.ContractSummary{}))
|
||||||
Expect(err).To(BeNil())
|
Expect(err).To(BeNil())
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -111,7 +111,7 @@ var _ = Describe("The watched contract summary", func() {
|
|||||||
blockchain.SetContractStateAttribute("0x123", nil, "foo", "bar")
|
blockchain.SetContractStateAttribute("0x123", nil, "foo", "bar")
|
||||||
blockchain.SetContractStateAttribute("0x123", blockNumber, "foo", "baz")
|
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")
|
attribute := contractSummary.GetStateAttribute("foo")
|
||||||
|
|
||||||
Expect(attribute).To(Equal("baz"))
|
Expect(attribute).To(Equal("baz"))
|
Loading…
Reference in New Issue
Block a user