diff --git a/contracts/exchange/contracts/src/MixinAssetProxyDispatcher.sol b/contracts/exchange/contracts/src/MixinAssetProxyDispatcher.sol index 26d018c603..b94b18f559 100644 --- a/contracts/exchange/contracts/src/MixinAssetProxyDispatcher.sol +++ b/contracts/exchange/contracts/src/MixinAssetProxyDispatcher.sol @@ -84,7 +84,7 @@ contract MixinAssetProxyDispatcher is internal { // Do nothing if no amount should be transferred. - if (amount > 0 && from != to) { + if (amount > 0) { // Ensure assetData length is valid if (assetData.length <= 3) { LibRichErrors.rrevert(LibExchangeRichErrors.AssetProxyDispatchError( diff --git a/contracts/exchange/test/core.ts b/contracts/exchange/test/core.ts index 58552ec104..a06b1e8907 100644 --- a/contracts/exchange/test/core.ts +++ b/contracts/exchange/test/core.ts @@ -368,7 +368,7 @@ blockchainTests.resets('Exchange core', () => { return expect(tx).to.revertWith(expectedError); }); - it('should not emit transfer events for transfers where from == to', async () => { + it('should noop transfer but return nonzero FillResults for fills where from == to', async () => { await fillOrderWrapper.fillOrderAndAssertEffectsAsync(signedOrder, makerAddress); }); diff --git a/contracts/exchange/test/dispatcher.ts b/contracts/exchange/test/dispatcher.ts index 467f051edb..f3b94333f1 100644 --- a/contracts/exchange/test/dispatcher.ts +++ b/contracts/exchange/test/dispatcher.ts @@ -230,7 +230,7 @@ describe('AssetProxyDispatcher', () => { expect(newBalances).to.deep.equal(erc20Balances); }); - it('should not dispatch a transfer if from == to', async () => { + it('should perform a noop transfer if from == to', async () => { // Register ERC20 proxy await assetProxyDispatcher.registerAssetProxy.awaitTransactionSuccessAsync(erc20Proxy.address, { from: owner, @@ -249,7 +249,7 @@ describe('AssetProxyDispatcher', () => { amount, { from: owner }, ); - expect(txReceipt.logs.length).to.be.equal(0); + expect(txReceipt.logs.length).to.be.equal(1); const newBalances = await erc20Wrapper.getBalancesAsync(); expect(newBalances).to.deep.equal(erc20Balances); });