Rename WatchedContract to Contract
This commit is contained in:
@@ -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
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
package core
|
||||
|
||||
type WatchedContract struct {
|
||||
Abi string
|
||||
Hash string
|
||||
Transactions []Transaction
|
||||
}
|
||||
Reference in New Issue
Block a user