forked from cerc-io/ipld-eth-server
Get ABI via etherscan API (#96)
- Added ABI request - Add unique constraint on contract hash for watched contracts
This commit is contained in:
@@ -262,6 +262,20 @@ func AssertRepositoryBehavior(buildRepository func() repositories.Repository) {
|
||||
Expect(contract).ToNot(BeNil())
|
||||
Expect(contract.Abi).To(Equal("{\"some\": \"json\"}"))
|
||||
})
|
||||
|
||||
It("updates the ABI of the contract if hash already present", func() {
|
||||
repository.CreateContract(core.Contract{
|
||||
Abi: "{\"some\": \"json\"}",
|
||||
Hash: "x123",
|
||||
})
|
||||
repository.CreateContract(core.Contract{
|
||||
Abi: "{\"some\": \"different json\"}",
|
||||
Hash: "x123",
|
||||
})
|
||||
contract := repository.FindContract("x123")
|
||||
Expect(contract).ToNot(BeNil())
|
||||
Expect(contract.Abi).To(Equal("{\"some\": \"different json\"}"))
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user