diff options
author | Fabio Berger <me@fabioberger.com> | 2018-07-18 21:18:54 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-18 21:18:54 +0800 |
commit | e2fb49a8f871fd4b631bb01bb641c632b7c19435 (patch) | |
tree | 6a04c7686159cfa80435e47e08ceb08533c0dd77 /packages/contracts/test/utils/asset_wrapper.ts | |
parent | f3241ff86a0d99f4291c5a5f4eaaa5ebe1736da0 (diff) | |
parent | b9e7973a0f92661f2e469b748a162b0d3bb53624 (diff) | |
download | dexon-sol-tools-e2fb49a8f871fd4b631bb01bb641c632b7c19435.tar dexon-sol-tools-e2fb49a8f871fd4b631bb01bb641c632b7c19435.tar.gz dexon-sol-tools-e2fb49a8f871fd4b631bb01bb641c632b7c19435.tar.bz2 dexon-sol-tools-e2fb49a8f871fd4b631bb01bb641c632b7c19435.tar.lz dexon-sol-tools-e2fb49a8f871fd4b631bb01bb641c632b7c19435.tar.xz dexon-sol-tools-e2fb49a8f871fd4b631bb01bb641c632b7c19435.tar.zst dexon-sol-tools-e2fb49a8f871fd4b631bb01bb641c632b7c19435.zip |
Merge pull request #884 from 0xProject/export-more-0x.js
Export missing V2 pieces from 0x.js
Diffstat (limited to 'packages/contracts/test/utils/asset_wrapper.ts')
-rw-r--r-- | packages/contracts/test/utils/asset_wrapper.ts | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/packages/contracts/test/utils/asset_wrapper.ts b/packages/contracts/test/utils/asset_wrapper.ts index 3e548d186..e3a4800c6 100644 --- a/packages/contracts/test/utils/asset_wrapper.ts +++ b/packages/contracts/test/utils/asset_wrapper.ts @@ -1,4 +1,4 @@ -import { assetProxyUtils } from '@0xproject/order-utils'; +import { assetDataUtils } from '@0xproject/order-utils'; import { AssetProxyId } from '@0xproject/types'; import { BigNumber, errorUtils } from '@0xproject/utils'; import * as _ from 'lodash'; @@ -26,7 +26,7 @@ export class AssetWrapper { }); } public async getBalanceAsync(userAddress: string, assetData: string): Promise<BigNumber> { - const proxyId = assetProxyUtils.decodeAssetDataId(assetData); + const proxyId = assetDataUtils.decodeAssetProxyId(assetData); switch (proxyId) { case AssetProxyId.ERC20: { const erc20Wrapper = this._proxyIdToAssetWrappers[proxyId] as ERC20Wrapper; @@ -35,7 +35,7 @@ export class AssetWrapper { } case AssetProxyId.ERC721: { const assetWrapper = this._proxyIdToAssetWrappers[proxyId] as ERC721Wrapper; - const assetProxyData = assetProxyUtils.decodeERC721AssetData(assetData); + const assetProxyData = assetDataUtils.decodeERC721AssetData(assetData); const isOwner = await assetWrapper.isOwnerAsync( userAddress, assetProxyData.tokenAddress, @@ -49,7 +49,7 @@ export class AssetWrapper { } } public async setBalanceAsync(userAddress: string, assetData: string, desiredBalance: BigNumber): Promise<void> { - const proxyId = assetProxyUtils.decodeAssetDataId(assetData); + const proxyId = assetDataUtils.decodeAssetProxyId(assetData); switch (proxyId) { case AssetProxyId.ERC20: { const erc20Wrapper = this._proxyIdToAssetWrappers[proxyId] as ERC20Wrapper; @@ -61,7 +61,7 @@ export class AssetWrapper { throw new Error(`Balance for ERC721 token can only be set to 0 or 1. Got: ${desiredBalance}`); } const erc721Wrapper = this._proxyIdToAssetWrappers[proxyId] as ERC721Wrapper; - const assetProxyData = assetProxyUtils.decodeERC721AssetData(assetData); + const assetProxyData = assetDataUtils.decodeERC721AssetData(assetData); const doesTokenExist = erc721Wrapper.doesTokenExistAsync( assetProxyData.tokenAddress, assetProxyData.tokenId, @@ -107,7 +107,7 @@ export class AssetWrapper { } } public async getProxyAllowanceAsync(userAddress: string, assetData: string): Promise<BigNumber> { - const proxyId = assetProxyUtils.decodeAssetDataId(assetData); + const proxyId = assetDataUtils.decodeAssetProxyId(assetData); switch (proxyId) { case AssetProxyId.ERC20: { const erc20Wrapper = this._proxyIdToAssetWrappers[proxyId] as ERC20Wrapper; @@ -116,7 +116,7 @@ export class AssetWrapper { } case AssetProxyId.ERC721: { const assetWrapper = this._proxyIdToAssetWrappers[proxyId] as ERC721Wrapper; - const erc721ProxyData = assetProxyUtils.decodeERC721AssetData(assetData); + const erc721ProxyData = assetDataUtils.decodeERC721AssetData(assetData); const isProxyApprovedForAll = await assetWrapper.isProxyApprovedForAllAsync( userAddress, erc721ProxyData.tokenAddress, @@ -141,7 +141,7 @@ export class AssetWrapper { assetData: string, desiredAllowance: BigNumber, ): Promise<void> { - const proxyId = assetProxyUtils.decodeAssetDataId(assetData); + const proxyId = assetDataUtils.decodeAssetProxyId(assetData); switch (proxyId) { case AssetProxyId.ERC20: { const erc20Wrapper = this._proxyIdToAssetWrappers[proxyId] as ERC20Wrapper; @@ -159,7 +159,7 @@ export class AssetWrapper { ); } const erc721Wrapper = this._proxyIdToAssetWrappers[proxyId] as ERC721Wrapper; - const assetProxyData = assetProxyUtils.decodeERC721AssetData(assetData); + const assetProxyData = assetDataUtils.decodeERC721AssetData(assetData); const doesTokenExist = await erc721Wrapper.doesTokenExistAsync( assetProxyData.tokenAddress, |