-
Notifications
You must be signed in to change notification settings - Fork 465
BUGFIX: don't remove maker/zrx order from cache twice #357
Conversation
According to the Set docs Set.delete() just returns false and doesn't throw. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/delete |
@LogvinovLeon the issue is that you are trying to call |
This LGTM. Do we make this same mistake elsewhere? Would also be great if we could add a regression test for this. |
this._removeFromDependentOrderHashes(signedOrder.maker, zrxTokenAddress, orderHash); | ||
this._removeFromDependentOrderHashes(signedOrder.maker, signedOrder.makerTokenAddress, orderHash); | ||
if (zrxTokenAddress !== signedOrder.makerTokenAddress) { | ||
this.removeFromDependentOrderHashes(signedOrder.maker, signedOrder.makerTokenAddress, orderHash); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
theres an underscore missing here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How did this compile 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It didn't. But I changed that before publishing
When removing an order from the watcher cache, we call _removeFromDependentOrderHashes for both the makerTokenAddress and the ZRX token address for fees. The problem is when the makerTokenAddress is the ZRX token address and you call this line:
This fails and results in the rest of the script terminating.