Skip to content

Commit 770f745

Browse files
author
Jan Xie
committed
fix log_listener in tester
1 parent 88f9e8b commit 770f745

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/ethereum/tester/abi_contract.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ def initialize(state, abi, address, listen: true, log_listener: nil, default_key
1616
if listen
1717
listener = ->(log) {
1818
result = @translator.listen log, noprint: false
19-
log_listener(result) if result && log_listener
19+
# result could be nil if the log cannot be parsed into an event
20+
# in that case we just pass raw log to listener
21+
log_listener.call(result || log) if log_listener
2022
}
2123
@state.block.log_listeners.push listener
2224
end

0 commit comments

Comments
 (0)