aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test/asset_proxy
diff options
context:
space:
mode:
authorJacob Evans <jacob@dekz.net>2018-06-18 12:47:18 +0800
committerJacob Evans <jacob@dekz.net>2018-06-20 08:00:59 +0800
commitbddc47f9b2e5d889e4c172f3d8ed1eb4b61faf1b (patch)
treeeaeb8b59b052863d6bd48951bce62e98922a1cef /packages/contracts/test/asset_proxy
parente216eb1e7b49f1ad4bc2c8a07007b4ef94373c5d (diff)
downloaddexon-sol-tools-bddc47f9b2e5d889e4c172f3d8ed1eb4b61faf1b.tar
dexon-sol-tools-bddc47f9b2e5d889e4c172f3d8ed1eb4b61faf1b.tar.gz
dexon-sol-tools-bddc47f9b2e5d889e4c172f3d8ed1eb4b61faf1b.tar.bz2
dexon-sol-tools-bddc47f9b2e5d889e4c172f3d8ed1eb4b61faf1b.tar.lz
dexon-sol-tools-bddc47f9b2e5d889e4c172f3d8ed1eb4b61faf1b.tar.xz
dexon-sol-tools-bddc47f9b2e5d889e4c172f3d8ed1eb4b61faf1b.tar.zst
dexon-sol-tools-bddc47f9b2e5d889e4c172f3d8ed1eb4b61faf1b.zip
ERC721Proxy Always call safeTransferFrom
Diffstat (limited to 'packages/contracts/test/asset_proxy')
-rw-r--r--packages/contracts/test/asset_proxy/proxies.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/packages/contracts/test/asset_proxy/proxies.ts b/packages/contracts/test/asset_proxy/proxies.ts
index 9760d3b9c..2c27f7382 100644
--- a/packages/contracts/test/asset_proxy/proxies.ts
+++ b/packages/contracts/test/asset_proxy/proxies.ts
@@ -276,7 +276,7 @@ describe('Asset Transfer Proxies', () => {
expect(newOwnerMakerAsset).to.be.bignumber.equal(takerAddress);
});
- it('should not call onERC721Received when transferring to a smart contract without receiver data', async () => {
+ it('should call onERC721Received when transferring to a smart contract without receiver data', async () => {
// Construct ERC721 asset data
const encodedAssetData = assetProxyUtils.encodeERC721AssetData(erc721Token.address, erc721MakerTokenId);
const encodedAssetDataWithoutProxyId = encodedAssetData.slice(0, -2);
@@ -297,7 +297,11 @@ describe('Asset Transfer Proxies', () => {
const logDecoder = new LogDecoder(web3Wrapper, erc721Receiver.address);
const tx = await logDecoder.getTxWithDecodedLogsAsync(txHash);
// Verify that no log was emitted by erc721 receiver
- expect(tx.logs.length).to.be.equal(0);
+ expect(tx.logs.length).to.be.equal(1);
+ const tokenReceivedLog = tx.logs[0] as LogWithDecodedArgs<TokenReceivedContractEventArgs>;
+ expect(tokenReceivedLog.args.from).to.be.equal(makerAddress);
+ expect(tokenReceivedLog.args.tokenId).to.be.bignumber.equal(erc721MakerTokenId);
+ expect(tokenReceivedLog.args.data).to.be.equal(constants.NULL_BYTES);
// Verify transfer was successful
const newOwnerMakerAsset = await erc721Token.ownerOf.callAsync(erc721MakerTokenId);
expect(newOwnerMakerAsset).to.be.bignumber.equal(erc721Receiver.address);