Rename WatchedContract to Contract

This commit is contained in:
Eric Meyer
2017-12-05 09:39:58 -06:00
parent 3a2e7e0cc1
commit 0439791381
16 changed files with 225 additions and 230 deletions
+2 -2
View File
@@ -7,6 +7,6 @@ type Blockchain interface {
SubscribeToBlocks(blocks chan Block)
StartListening()
StopListening()
GetAttributes(watchedContract WatchedContract) (ContractAttributes, error)
GetAttribute(watchedContract WatchedContract, attributeName string, blockNumber *big.Int) (interface{}, error)
GetAttributes(contract Contract) (ContractAttributes, error)
GetAttribute(contract Contract, attributeName string, blockNumber *big.Int) (interface{}, error)
}
+3 -21
View File
@@ -1,25 +1,7 @@
package core
type Contract struct {
Attributes ContractAttributes
Hash string
}
type ContractAttribute struct {
Name string
Type string
}
type ContractAttributes []ContractAttribute
func (attributes ContractAttributes) Len() int {
return len(attributes)
}
func (attributes ContractAttributes) Swap(i, j int) {
attributes[i], attributes[j] = attributes[j], attributes[i]
}
func (attributes ContractAttributes) Less(i, j int) bool {
return attributes[i].Name < attributes[j].Name
Abi string
Hash string
Transactions []Transaction
}
+20
View File
@@ -0,0 +1,20 @@
package core
type ContractAttribute struct {
Name string
Type string
}
type ContractAttributes []ContractAttribute
func (attributes ContractAttributes) Len() int {
return len(attributes)
}
func (attributes ContractAttributes) Swap(i, j int) {
attributes[i], attributes[j] = attributes[j], attributes[i]
}
func (attributes ContractAttributes) Less(i, j int) bool {
return attributes[i].Name < attributes[j].Name
}
-7
View File
@@ -1,7 +0,0 @@
package core
type WatchedContract struct {
Abi string
Hash string
Transactions []Transaction
}