forked from cerc-io/ipld-eth-server
Address PR comments
This commit is contained in:
parent
1bae6db483
commit
54458e9741
@ -12,13 +12,13 @@ type ContractAttribute struct {
|
|||||||
|
|
||||||
type ContractAttributes []ContractAttribute
|
type ContractAttributes []ContractAttribute
|
||||||
|
|
||||||
func (s ContractAttributes) Len() int {
|
func (attributes ContractAttributes) Len() int {
|
||||||
return len(s)
|
return len(attributes)
|
||||||
}
|
}
|
||||||
func (s ContractAttributes) Swap(i, j int) {
|
func (attributes ContractAttributes) Swap(i, j int) {
|
||||||
s[i], s[j] = s[j], s[i]
|
attributes[i], attributes[j] = attributes[j], attributes[i]
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s ContractAttributes) Less(i, j int) bool {
|
func (attributes ContractAttributes) Less(i, j int) bool {
|
||||||
return s[i].Name < s[j].Name
|
return attributes[i].Name < attributes[j].Name
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ var _ bool = Describe("The watched contract summary", func() {
|
|||||||
Expect(contractSummary.GetStateAttribute("foo")).To(Equal("bar"))
|
Expect(contractSummary.GetStateAttribute("foo")).To(Equal("bar"))
|
||||||
})
|
})
|
||||||
|
|
||||||
It("gets a attributes for the contract from the blockchain", func() {
|
It("gets attributes for the contract from the blockchain", func() {
|
||||||
repository := repositories.NewInMemory()
|
repository := repositories.NewInMemory()
|
||||||
watchedContract := core.WatchedContract{Hash: "0x123"}
|
watchedContract := core.WatchedContract{Hash: "0x123"}
|
||||||
repository.CreateWatchedContract(watchedContract)
|
repository.CreateWatchedContract(watchedContract)
|
||||||
|
Loading…
Reference in New Issue
Block a user