throw an exception if event name isn't found

This commit is contained in:
Nanolucas 2021-03-27 00:01:37 +01:00
parent 91ef36fa4c
commit d4e9e4a533

View File

@ -893,9 +893,9 @@ class Contract
$eventLogData = []; $eventLogData = [];
//if there's no data for this event, no need to proceed further //ensure the event actually exists before trying to filter for it
if (!array_key_exists($eventName, $this->events)) { if (!array_key_exists($eventName, $this->events)) {
return $eventLogData; throw new InvalidArgumentException("'{$eventName}' does not exist in the ABI for this contract");
} }
//indexed and non-indexed event parameters must be treated separately //indexed and non-indexed event parameters must be treated separately