aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/asset_proxy/decoder.ts
diff options
context:
space:
mode:
authorAmir Bandeali <abandeali1@gmail.com>2018-06-13 07:05:46 +0800
committerGitHub <noreply@github.com>2018-06-13 07:05:46 +0800
commit90cf85c3f0712e6714f3297200cf876582e9ec97 (patch)
treeb79fd5ce4b2eec3ee1d0503066a028e8b2a0556b /packages/contracts/test/asset_proxy/decoder.ts
parentf50d3088dcc7fc7fb88ebfce397684b32aa037aa (diff)
parent0917fa0d75b7328c156af2ffafa641ae09286e2e (diff)
downloaddexon-sol-tools-90cf85c3f0712e6714f3297200cf876582e9ec97.tar.gz
dexon-sol-tools-90cf85c3f0712e6714f3297200cf876582e9ec97.tar.zst
dexon-sol-tools-90cf85c3f0712e6714f3297200cf876582e9ec97.zip
Merge pull request #682 from 0xProject/feature/contracts/popProxyId
Remove proxyId checks in AssetProxies
Diffstat (limited to 'packages/contracts/test/asset_proxy/decoder.ts')
-rw-r--r--packages/contracts/test/asset_proxy/decoder.ts21
1 files changed, 2 insertions, 19 deletions
diff --git a/packages/contracts/test/asset_proxy/decoder.ts b/packages/contracts/test/asset_proxy/decoder.ts
index d4fae1601..875d55daa 100644
--- a/packages/contracts/test/asset_proxy/decoder.ts
+++ b/packages/contracts/test/asset_proxy/decoder.ts
@@ -42,33 +42,19 @@ describe('TestAssetDataDecoders', () => {
});
describe('Asset Data Decoders', () => {
- it('should correctly decode ERC20 asset data)', async () => {
- const encodedAssetData = assetProxyUtils.encodeERC20AssetData(testAddress);
- const expectedDecodedAssetData = assetProxyUtils.decodeERC20AssetData(encodedAssetData);
- let decodedAssetProxyId: number;
- let decodedTokenAddress: string;
- [decodedAssetProxyId, decodedTokenAddress] = await testAssetProxyDecoder.publicDecodeERC20Data.callAsync(
- encodedAssetData,
- );
- expect(decodedAssetProxyId).to.be.equal(expectedDecodedAssetData.assetProxyId);
- expect(decodedTokenAddress).to.be.equal(expectedDecodedAssetData.tokenAddress);
- });
-
it('should correctly decode ERC721 asset data', async () => {
const tokenId = generatePseudoRandomSalt();
const encodedAssetData = assetProxyUtils.encodeERC721AssetData(testAddress, tokenId);
+ const encodedAssetDataWithoutProxyId = encodedAssetData.slice(0, -2);
const expectedDecodedAssetData = assetProxyUtils.decodeERC721AssetData(encodedAssetData);
- let decodedAssetProxyId: number;
let decodedTokenAddress: string;
let decodedTokenId: BigNumber;
let decodedData: string;
[
- decodedAssetProxyId,
decodedTokenAddress,
decodedTokenId,
decodedData,
- ] = await testAssetProxyDecoder.publicDecodeERC721Data.callAsync(encodedAssetData);
- expect(decodedAssetProxyId).to.be.equal(expectedDecodedAssetData.assetProxyId);
+ ] = await testAssetProxyDecoder.publicDecodeERC721Data.callAsync(encodedAssetDataWithoutProxyId);
expect(decodedTokenAddress).to.be.equal(expectedDecodedAssetData.tokenAddress);
expect(decodedTokenId).to.be.bignumber.equal(expectedDecodedAssetData.tokenId);
expect(decodedData).to.be.equal(expectedDecodedAssetData.receiverData);
@@ -84,17 +70,14 @@ describe('TestAssetDataDecoders', () => {
const receiverData = receiverDataFirst32Bytes + receiverDataExtraBytes;
const encodedAssetData = assetProxyUtils.encodeERC721AssetData(testAddress, tokenId, receiverData);
const expectedDecodedAssetData = assetProxyUtils.decodeERC721AssetData(encodedAssetData);
- let decodedAssetProxyId: number;
let decodedTokenAddress: string;
let decodedTokenId: BigNumber;
let decodedReceiverData: string;
[
- decodedAssetProxyId,
decodedTokenAddress,
decodedTokenId,
decodedReceiverData,
] = await testAssetProxyDecoder.publicDecodeERC721Data.callAsync(encodedAssetData);
- expect(decodedAssetProxyId).to.be.equal(expectedDecodedAssetData.assetProxyId);
expect(decodedTokenAddress).to.be.equal(expectedDecodedAssetData.tokenAddress);
expect(decodedTokenId).to.be.bignumber.equal(expectedDecodedAssetData.tokenId);
expect(decodedReceiverData).to.be.equal(expectedDecodedAssetData.receiverData);