address comments

This commit is contained in:
Michael Zhu 2020-01-06 17:24:10 -05:00 committed by Amir
parent b70cb726c5
commit 87cd5fca90
2 changed files with 14 additions and 1 deletions

View File

@ -146,6 +146,9 @@ contract MixinAssets is
);
}
/// @dev Decodes MultiAsset assetData and recursively transfers assets to sender.
/// @param assetData Byte array encoded for the respective asset proxy.
/// @param amount Amount of asset to transfer to sender.
function _transferMultiAsset(
bytes memory assetData,
uint256 amount

View File

@ -158,10 +158,20 @@ blockchainTests.resets('Supported asset type unit tests', env => {
const result = await forwarder.areUnderlyingAssetsEqual(erc20AssetData, multiAssetData).callAsync();
expect(result).to.be.false();
});
it('returns true if assetData1 == assetData2 are MultiAsset', async () => {
it('returns true if assetData1 == assetData2 are MultiAsset (single nested asset)', async () => {
const result = await forwarder.areUnderlyingAssetsEqual(multiAssetData, multiAssetData).callAsync();
expect(result).to.be.true();
});
it('returns true if assetData1 == assetData2 are MultiAsset (multiple nested assets)', async () => {
const assetData = assetDataEncoder
.MultiAsset(
[getRandomInteger(0, constants.MAX_UINT256), new BigNumber(1)],
[erc20AssetData, erc721AssetData],
)
.getABIEncodedTransactionData();
const result = await forwarder.areUnderlyingAssetsEqual(assetData, assetData).callAsync();
expect(result).to.be.true();
});
it('returns false if assetData1 != assetData2 are MultiAsset', async () => {
const differentMultiAssetData = assetDataEncoder
.MultiAsset([getRandomInteger(0, constants.MAX_UINT256)], [erc721AssetData])