ipld-eth-server/pkg/core/watched_contract.go

30 lines
580 B
Go
Raw Normal View History

package core
type WatchedContract struct {
Hash string
Transactions []Transaction
}
type Contract struct {
Attributes ContractAttributes
Hash string
}
type ContractAttribute struct {
Name string
Type string
}
type ContractAttributes []ContractAttribute
2017-11-28 20:40:05 +00:00
func (attributes ContractAttributes) Len() int {
return len(attributes)
}
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:40:05 +00:00
func (attributes ContractAttributes) Less(i, j int) bool {
return attributes[i].Name < attributes[j].Name
}