Store contract ABI on watched_contracts

This commit is contained in:
Eric Meyer
2017-12-04 14:13:15 -06:00
parent 52e3266495
commit fa2766b64d
7 changed files with 33 additions and 12 deletions
+10 -1
View File
@@ -230,7 +230,6 @@ func AssertRepositoryBehavior(buildRepository func() repositories.Repository) {
watchedContract := repository.FindWatchedContract("x123")
Expect(watchedContract).ToNot(BeNil())
Expect(watchedContract.Transactions).To(BeEmpty())
})
It("returns transactions 'To' a watched contract", func() {
@@ -253,6 +252,16 @@ func AssertRepositoryBehavior(buildRepository func() repositories.Repository) {
{Hash: "TRANSACTION3", To: "x123"},
}))
})
It("stores the ABI of the contract", func() {
repository.CreateWatchedContract(repositories.WatchedContract{
Abi: "{\"some\": \"json\"}",
Hash: "x123",
})
watchedContract := repository.FindWatchedContract("x123")
Expect(watchedContract).ToNot(BeNil())
Expect(watchedContract.Abi).To(Equal("{\"some\": \"json\"}"))
})
})
}