aboutsummaryrefslogtreecommitdiffstats
path: root/packages/order-utils/test
diff options
context:
space:
mode:
authorAmir Bandeali <abandeali1@gmail.com>2019-01-05 06:31:25 +0800
committerAmir Bandeali <abandeali1@gmail.com>2019-01-08 02:31:11 +0800
commit24564b986daa703f66e54f85abf4782d99a40f94 (patch)
tree8fbe8caa669b773eafe10c68c5a1a8a08c4954c5 /packages/order-utils/test
parenta91bc415ed3c9dc94dda2661c0d7ac13bcc58e08 (diff)
downloaddexon-sol-tools-24564b986daa703f66e54f85abf4782d99a40f94.tar
dexon-sol-tools-24564b986daa703f66e54f85abf4782d99a40f94.tar.gz
dexon-sol-tools-24564b986daa703f66e54f85abf4782d99a40f94.tar.bz2
dexon-sol-tools-24564b986daa703f66e54f85abf4782d99a40f94.tar.lz
dexon-sol-tools-24564b986daa703f66e54f85abf4782d99a40f94.tar.xz
dexon-sol-tools-24564b986daa703f66e54f85abf4782d99a40f94.tar.zst
dexon-sol-tools-24564b986daa703f66e54f85abf4782d99a40f94.zip
Minimize unnecessary type assertions
Diffstat (limited to 'packages/order-utils/test')
-rw-r--r--packages/order-utils/test/asset_data_utils_test.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/packages/order-utils/test/asset_data_utils_test.ts b/packages/order-utils/test/asset_data_utils_test.ts
index ebc5bdeac..c498c5a00 100644
--- a/packages/order-utils/test/asset_data_utils_test.ts
+++ b/packages/order-utils/test/asset_data_utils_test.ts
@@ -27,7 +27,6 @@ const KNOWN_MULTI_ASSET_ENCODING = {
'0x94cfcdd7000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000024f47261b00000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c48000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044025717920000000000000000000000001dc4c1cefef38a777b15aa20260a54e584b16c48000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000',
};
-// tslint:disable:no-unnecessary-type-assertion
describe('assetDataUtils', () => {
it('should encode ERC20', () => {
const assetData = assetDataUtils.encodeERC20AssetData(KNOWN_ERC20_ENCODING.address);
@@ -69,6 +68,7 @@ describe('assetDataUtils', () => {
expect(decodedAssetData.assetProxyId).to.equal(AssetProxyId.MultiAsset);
expect(decodedAssetData.amounts).to.deep.equal(KNOWN_MULTI_ASSET_ENCODING.amounts);
const decodedErc20AssetData = decodedAssetData.nestedAssetData[0];
+ // tslint:disable-next-line:no-unnecessary-type-assertion
const decodedErc721AssetData = decodedAssetData.nestedAssetData[1] as ERC721AssetData;
expect(decodedErc20AssetData.tokenAddress).to.equal(KNOWN_ERC20_ENCODING.address);
expect(decodedErc20AssetData.assetProxyId).to.equal(AssetProxyId.ERC20);
@@ -91,8 +91,10 @@ describe('assetDataUtils', () => {
const expectedLength = 4;
expect(decodedAssetData.nestedAssetData.length).to.be.equal(expectedLength);
const decodedErc20AssetData1 = decodedAssetData.nestedAssetData[0];
+ // tslint:disable-next-line:no-unnecessary-type-assertion
const decodedErc721AssetData1 = decodedAssetData.nestedAssetData[1] as ERC721AssetData;
const decodedErc20AssetData2 = decodedAssetData.nestedAssetData[2];
+ // tslint:disable-next-line:no-unnecessary-type-assertion
const decodedErc721AssetData2 = decodedAssetData.nestedAssetData[3] as ERC721AssetData;
expect(decodedErc20AssetData1.tokenAddress).to.equal(KNOWN_ERC20_ENCODING.address);
expect(decodedErc20AssetData1.assetProxyId).to.equal(AssetProxyId.ERC20);