You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current implementation of evmEvents contains multiple logical operations directly within the function, which should be separated into distinct functions.
Fetching logs from ethereum client
Converting those logs to EVMEvent objects
Verifying the converted events
Sorting the events
This approach limits testability, as it prevents writing tests for specific logic handled by evmEvents and increases complexity by combining too many responsibilities.
Suggested solution
Refactor by delegating separable logic into dedicated functions. For example, we can serpate the following logics to other functions.
Geth log conversion and verification
Sorting EVMEvents
Current: the evmEvents function handled
Fetching logs from ethereum client
Converting those logs to EVMEvent objects
Verifying the converted events
Sorting the events
Suggestion: The evmEvents function
Fetch logs from ethereum client
Delegates conversion and verification to types.EthLogToEVMEvent.
Description and context
The current implementation of evmEvents contains multiple logical operations directly within the function, which should be separated into distinct functions.
This approach limits testability, as it prevents writing tests for specific logic handled by
evmEvents
and increases complexity by combining too many responsibilities.Suggested solution
Refactor by delegating separable logic into dedicated functions. For example, we can serpate the following logics to other functions.
Current: the
evmEvents
function handledEVMEvent
objectsSuggestion: The
evmEvents
functiontypes.EthLogToEVMEvent
.types.SortEVMEvents
.Definition of done
#106 is merged
The text was updated successfully, but these errors were encountered: