adding test coverage when no event is found

This commit is contained in:
Unknown 2019-04-01 09:57:46 +02:00
parent 5a8eaf668f
commit a72a46aab5

View file

@ -771,4 +771,9 @@ func TestABI_EventById(t *testing.T) {
if event.Id() != topicID { if event.Id() != topicID {
t.Errorf("topic %v (id %v) not 'findable' by id in ABI", topic, topicID) t.Errorf("topic %v (id %v) not 'findable' by id in ABI", topic, topicID)
} }
UnknowntopicID := crypto.Keccak256Hash([]byte("unkownEvent"))
if _, err := abi.EventById(UnknowntopicID); err == nil {
t.Errorf("Expected error, no matching event id")
}
} }