Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

orderwatch: Remove null txHashes & fix uninstantiated map issue #280

Merged
merged 3 commits into from
Jul 18, 2019

Conversation

fabioberger
Copy link
Contributor

During testing I noticed that OrderEvents consistently had 2 txHashes, with the first one always being the null address. By inspecting the code, I saw we are appending to an array created using make() which pre-created len number of zero-value entries. I've decided to fix by reverting to using []common.Hash{} instead of make(). Although less efficient, in the subsequent looping over the map, we don't have a readily available index to use in replacing the zero-values and so this feels like the cleanest approach.

I additionally noticed we weren't instantiating TxHashes in the cleanup job, which would have caused later code to attempt to treat a nil value as an instantiated map.

@albrow albrow self-requested a review July 18, 2019 15:55
Copy link
Contributor

@albrow albrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved assuming CI passes.

@fabioberger fabioberger merged commit 7b19d88 into development Jul 18, 2019
@fabioberger fabioberger deleted the fix/removeNullTxAddress branch July 18, 2019 16:00
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants