address comments
This commit is contained in:
parent
b70cb726c5
commit
87cd5fca90
@ -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(
|
function _transferMultiAsset(
|
||||||
bytes memory assetData,
|
bytes memory assetData,
|
||||||
uint256 amount
|
uint256 amount
|
||||||
|
@ -158,10 +158,20 @@ blockchainTests.resets('Supported asset type unit tests', env => {
|
|||||||
const result = await forwarder.areUnderlyingAssetsEqual(erc20AssetData, multiAssetData).callAsync();
|
const result = await forwarder.areUnderlyingAssetsEqual(erc20AssetData, multiAssetData).callAsync();
|
||||||
expect(result).to.be.false();
|
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();
|
const result = await forwarder.areUnderlyingAssetsEqual(multiAssetData, multiAssetData).callAsync();
|
||||||
expect(result).to.be.true();
|
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 () => {
|
it('returns false if assetData1 != assetData2 are MultiAsset', async () => {
|
||||||
const differentMultiAssetData = assetDataEncoder
|
const differentMultiAssetData = assetDataEncoder
|
||||||
.MultiAsset([getRandomInteger(0, constants.MAX_UINT256)], [erc721AssetData])
|
.MultiAsset([getRandomInteger(0, constants.MAX_UINT256)], [erc721AssetData])
|
||||||
|
Loading…
x
Reference in New Issue
Block a user