Merge pull request #2087 from 0xProject/fix/3.0/exchange/execute-noop-transfer

remove from != to check and update tests
This commit is contained in:
mzhu25
2019-08-21 17:02:03 -07:00
committed by GitHub
3 changed files with 4 additions and 4 deletions

View File

@@ -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(

View File

@@ -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);
});

View File

@@ -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);
});