2017-11-09 19:59:12 +00:00
|
|
|
package core
|
|
|
|
|
2017-11-13 16:11:27 +00:00
|
|
|
type WatchedContract struct {
|
2017-11-13 21:41:32 +00:00
|
|
|
Hash string
|
|
|
|
Transactions []Transaction
|
2017-11-09 19:59:12 +00:00
|
|
|
}
|
2017-11-27 22:18:42 +00:00
|
|
|
|
2017-11-30 22:36:18 +00:00
|
|
|
type Contract struct {
|
|
|
|
Attributes ContractAttributes
|
|
|
|
Hash string
|
|
|
|
}
|
|
|
|
|
2017-11-27 22:18:42 +00:00
|
|
|
type ContractAttribute struct {
|
|
|
|
Name string
|
|
|
|
Type string
|
|
|
|
}
|
2017-11-28 20:03:21 +00:00
|
|
|
|
|
|
|
type ContractAttributes []ContractAttribute
|
|
|
|
|
2017-11-28 20:40:05 +00:00
|
|
|
func (attributes ContractAttributes) Len() int {
|
|
|
|
return len(attributes)
|
2017-11-28 20:03:21 +00:00
|
|
|
}
|
2017-11-28 20:40:05 +00:00
|
|
|
func (attributes ContractAttributes) Swap(i, j int) {
|
|
|
|
attributes[i], attributes[j] = attributes[j], attributes[i]
|
2017-11-28 20:03:21 +00:00
|
|
|
}
|
|
|
|
|
2017-11-28 20:40:05 +00:00
|
|
|
func (attributes ContractAttributes) Less(i, j int) bool {
|
|
|
|
return attributes[i].Name < attributes[j].Name
|
|
|
|
}
|