Added sort method to ContractAttributes array

This commit is contained in:
Matt Krump
2017-11-28 14:05:39 -06:00
parent aa3318451b
commit 1bae6db483
7 changed files with 27 additions and 14 deletions
+1 -1
View File
@@ -13,7 +13,7 @@ type ContractSummary struct {
NumberOfTransactions int
LastTransaction *core.Transaction
blockChain core.Blockchain
Attributes []core.ContractAttribute
Attributes core.ContractAttributes
}
var NewContractNotWatchedErr = func(contractHash string) error {
+2 -2
View File
@@ -106,9 +106,9 @@ var _ bool = Describe("The watched contract summary", func() {
contractSummary, _ := watched_contracts.NewSummary(blockchain, repository, "0x123")
Expect(contractSummary.Attributes).To(Equal(
[]core.ContractAttribute{
{Name: "foo", Type: "string"},
core.ContractAttributes{
{Name: "baz", Type: "string"},
{Name: "foo", Type: "string"},
},
))
})