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:
@@ -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(
|
||||
|
@@ -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);
|
||||
});
|
||||
|
||||
|
@@ -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);
|
||||
});
|
||||
|
Reference in New Issue
Block a user