diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-07-16 20:29:23 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2018-07-16 20:29:23 +0800 |
commit | 4921a83813d31e18bd9377ededc1f7a6e42bbf2a (patch) | |
tree | 7897f7bcb448393c25a4d600f5cc298a746b1504 | |
parent | a97ba41b8676d3d9003f9896381737565d418fab (diff) | |
download | dexon-sol-tools-4921a83813d31e18bd9377ededc1f7a6e42bbf2a.tar dexon-sol-tools-4921a83813d31e18bd9377ededc1f7a6e42bbf2a.tar.gz dexon-sol-tools-4921a83813d31e18bd9377ededc1f7a6e42bbf2a.tar.bz2 dexon-sol-tools-4921a83813d31e18bd9377ededc1f7a6e42bbf2a.tar.lz dexon-sol-tools-4921a83813d31e18bd9377ededc1f7a6e42bbf2a.tar.xz dexon-sol-tools-4921a83813d31e18bd9377ededc1f7a6e42bbf2a.tar.zst dexon-sol-tools-4921a83813d31e18bd9377ededc1f7a6e42bbf2a.zip |
Register asset types within collisionResistantAbiDecoder
-rw-r--r-- | packages/order-watcher/src/order_watcher/order_watcher.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/order-watcher/src/order_watcher/order_watcher.ts b/packages/order-watcher/src/order_watcher/order_watcher.ts index af479f32d..cefead761 100644 --- a/packages/order-watcher/src/order_watcher/order_watcher.ts +++ b/packages/order-watcher/src/order_watcher/order_watcher.ts @@ -152,6 +152,20 @@ export class OrderWatcher { this._orderByOrderHash[orderHash] = signedOrder; this._dependentOrderHashesTracker.addToDependentOrderHashes(signedOrder); + + const decodedMakerAssetData = assetProxyUtils.decodeAssetData(signedOrder.makerAssetData); + if (decodedMakerAssetData.assetProxyId === AssetProxyId.ERC20) { + this._collisionResistantAbiDecoder.addERC20Token(decodedMakerAssetData.tokenAddress); + } else if (decodedMakerAssetData.assetProxyId === AssetProxyId.ERC721) { + this._collisionResistantAbiDecoder.addERC721Token(decodedMakerAssetData.tokenAddress); + } + + const decodedTakerAssetData = assetProxyUtils.decodeAssetData(signedOrder.takerAssetData); + if (decodedTakerAssetData.assetProxyId === AssetProxyId.ERC20) { + this._collisionResistantAbiDecoder.addERC20Token(decodedTakerAssetData.tokenAddress); + } else if (decodedTakerAssetData.assetProxyId === AssetProxyId.ERC721) { + this._collisionResistantAbiDecoder.addERC721Token(decodedTakerAssetData.tokenAddress); + } } /** * Removes an order from the orderWatcher |