Require ABI filepath for watching a contract

This commit is contained in:
Eric Meyer
2017-12-04 15:12:27 -06:00
parent fa2766b64d
commit a0cd7f773a
6 changed files with 50 additions and 6 deletions
+9
View File
@@ -21,6 +21,15 @@ var _ = Describe("Reading ABI files", func() {
Expect(err).To(BeNil())
})
It("reads the contents of a valid ABI file", func() {
path := filepath.Join(cfg.ProjectRoot(), "pkg", "geth", "testing", "valid_abi.json")
contractAbi, err := geth.ReadAbiFile(path)
Expect(contractAbi).To(Equal("[{\"foo\": \"bar\"}]"))
Expect(err).To(BeNil())
})
It("returns an error when the file does not exist", func() {
path := filepath.Join(cfg.ProjectRoot(), "pkg", "geth", "testing", "missing_abi.json")