Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Exchange & Proxy Integration Tests - ERC1155 #1673

Merged
merged 10 commits into from
Mar 19, 2019

Conversation

hysz
Copy link
Contributor

@hysz hysz commented Mar 6, 2019

Description

Integration tests for the ERC1155 proxy with the Mutli-Asset Proxy and Exchange.

Testing instructions

Types of changes

Checklist:

  • Prefix PR title with [WIP] if necessary.
  • Add tests to cover changes as needed.
  • Update documentation as needed.
  • Add new entries to the relevant CHANGELOG.jsons.

@hysz hysz force-pushed the feature/contracts/erc1155Proxy-4 branch from c0eef21 to 49ccb98 Compare March 7, 2019 22:40
@hysz hysz force-pushed the feature/contracts/erc1155ProxyIntegrationTests-2 branch from 403a815 to 06d591c Compare March 7, 2019 23:00
@hysz hysz force-pushed the feature/contracts/erc1155ProxyIntegrationTests-2 branch from faba871 to b2f9b07 Compare March 8, 2019 01:09
@hysz hysz changed the title [WIP] Exchange & Proxy Integration Tests - ERC1155 Exchange & Proxy Integration Tests - ERC1155 Mar 11, 2019
@hysz hysz force-pushed the feature/contracts/erc1155ProxyIntegrationTests-2 branch from 4e72b93 to 5e62bde Compare March 12, 2019 01:24
@hysz hysz force-pushed the feature/contracts/erc1155Proxy-4 branch 2 times, most recently from 12eeed4 to 441b379 Compare March 12, 2019 21:38
Copy link
Contributor

@fabioberger fabioberger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't review the actual Solidity and someone else should make sure the tests actually test what they intend to test, but I reviewed the dev tooling changes and they look solid.

@@ -0,0 +1,268 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How this already been reviewed elsewhere? Are we duplicating Solidity source code within the monorepo?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup! Been reviewed in #1661. Just had to do a cheeky rebase.

"pr": 1657
}
]
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be one CHANGELOG entry.

@fabioberger
Copy link
Contributor

Eventually we'll also need to add ERC1155 support to OrderWatcher.

@hysz hysz force-pushed the feature/contracts/erc1155Proxy-4 branch from 9b2197f to 32b0b0b Compare March 14, 2019 21:21
@hysz hysz force-pushed the feature/contracts/erc1155ProxyIntegrationTests-2 branch from 5e62bde to fefd068 Compare March 14, 2019 23:23
@hysz hysz requested a review from abandeali1 as a code owner March 14, 2019 23:23
@hysz hysz force-pushed the feature/contracts/erc1155Proxy-4 branch from 32b0b0b to 5cc46b7 Compare March 15, 2019 03:48
@hysz hysz force-pushed the feature/contracts/erc1155ProxyIntegrationTests-2 branch 2 times, most recently from 4fa27ec to ce6ff86 Compare March 15, 2019 04:42
@coveralls
Copy link

coveralls commented Mar 15, 2019

Coverage Status

Coverage increased (+0.08%) to 85.194% when pulling 98c6fa1 on feature/contracts/erc1155ProxyIntegrationTests-2 into 3fff3d9 on development.

@hysz hysz force-pushed the feature/contracts/erc1155ProxyIntegrationTests-2 branch 3 times, most recently from 75cc676 to 44db7d3 Compare March 15, 2019 05:56
@hysz hysz force-pushed the feature/contracts/erc1155Proxy-4 branch from a33da79 to 22bc1fb Compare March 15, 2019 22:06
@hysz hysz force-pushed the feature/contracts/erc1155ProxyIntegrationTests-2 branch from 24859f2 to ecd604f Compare March 16, 2019 01:46
@hysz hysz changed the base branch from feature/contracts/erc1155Proxy-4 to development March 16, 2019 01:52
@hysz hysz force-pushed the feature/contracts/erc1155ProxyIntegrationTests-2 branch from ecd604f to d540e4b Compare March 16, 2019 04:34
Copy link
Member

@abandeali1 abandeali1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few small changes, then LGTM!

}
]
},
{
"timestamp": 1551479279,
"version": "1.0.9",
"version": "1.å.9",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo?

const tokensToTransfer = erc1155FungibleTokens.slice(0, 1);
const valuesToTransfer = [new BigNumber(25)];
const valueMultiplier = new BigNumber(23);
const receiverCallbackData = '0x0102030405';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This data is just being ignored since both parties are EOAs, correct? It might be good to explicitly test for when the callback data is null as well.

});
it('should allow an order exchanging erc1155 assets to be partially filled', async () => {
// NOTICE:
// As-per the eip1155 standard, there is no way to distinguish between a fungible or non-fungible erc1155 assets.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't a partial transfer of a non-fungible still fail with TRANSFER_FAILED? Whatever the behavior is, we should add a test for it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We chatted about this offline.

Partial fills on non-fungible assets should be prohibited by the maker by setting the amount to 1. The proxy cannot distinguish between fungible and non-fungible assets, so it cannot force partial fills to fail in this scenario. If the amount is not set to 1 and an asset is non-fungible then the behavior depends on the implementation of the ERC1155 contract.

@hysz hysz force-pushed the feature/contracts/erc1155ProxyIntegrationTests-2 branch from 8dff829 to 98c6fa1 Compare March 19, 2019 16:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants