@0x/contracts-asset-proxy: Fix broken erc1155_proxy tests.

`@0x/contracts-asset-proxy`: Add `ERC1155Proxy.sol` to .solhintignore.
Fix circleci config to work with 3.0 branch.
This commit is contained in:
Lawrence Forman 2019-07-29 22:24:12 -04:00
parent 4afca6ca8d
commit 9b5ba6806f
3 changed files with 20 additions and 11 deletions

View File

@ -225,7 +225,8 @@ jobs:
keys: keys:
- repo-{{ .Environment.CIRCLE_SHA1 }} - repo-{{ .Environment.CIRCLE_SHA1 }}
- run: yarn wsrun test:circleci @0x/contracts-test-utils - run: yarn wsrun test:circleci @0x/contracts-test-utils
- run: yarn wsrun test:circleci @0x/abi-gen # TODO(dorothy-zbornak): Re-enable after updating this package for 3.0.
# - run: yarn wsrun test:circleci-3.0 @0x/abi-gen
- run: yarn wsrun test:circleci @0x/assert - run: yarn wsrun test:circleci @0x/assert
- run: yarn wsrun test:circleci @0x/base-contract - run: yarn wsrun test:circleci @0x/base-contract
# TODO(dorothy-zbornak): Re-enable after updating this package for 3.0. # TODO(dorothy-zbornak): Re-enable after updating this package for 3.0.
@ -238,10 +239,11 @@ jobs:
- run: yarn wsrun test:circleci @0x/subproviders - run: yarn wsrun test:circleci @0x/subproviders
- run: yarn wsrun test:circleci @0x/web3-wrapper - run: yarn wsrun test:circleci @0x/web3-wrapper
- run: yarn wsrun test:circleci @0x/utils - run: yarn wsrun test:circleci @0x/utils
- save_cache: # TODO(dorothy-zbornak): Re-enable after updating this package for 3.0.
key: coverage-abi-gen-{{ .Environment.CIRCLE_SHA1 }} # - save_cache:
paths: # key: coverage-abi-gen-{{ .Environment.CIRCLE_SHA1 }}
- ~/repo/packages/abi-gen/coverage/lcov.info # paths:
# - ~/repo/packages/abi-gen/coverage/lcov.info
- save_cache: - save_cache:
key: coverage-assert-{{ .Environment.CIRCLE_SHA1 }} key: coverage-assert-{{ .Environment.CIRCLE_SHA1 }}
paths: paths:
@ -514,9 +516,10 @@ jobs:
- restore_cache: - restore_cache:
keys: keys:
- repo-{{ .Environment.CIRCLE_SHA1 }} - repo-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache: # TODO(dorothy-zbornak): Re-enable after updating this package for 3.0.
keys: # - restore_cache:
- coverage-abi-gen-{{ .Environment.CIRCLE_SHA1 }} # keys:
# - coverage-abi-gen-{{ .Environment.CIRCLE_SHA1 }}
- restore_cache: - restore_cache:
keys: keys:
- coverage-assert-{{ .Environment.CIRCLE_SHA1 }} - coverage-assert-{{ .Environment.CIRCLE_SHA1 }}

View File

@ -0,0 +1,2 @@
# solhint can't parse `abi.decode` syntax.
contracts/src/ERC1155Proxy.sol

View File

@ -1747,9 +1747,14 @@ describe('ERC1155Proxy', () => {
nftNotOwnerBalance, nftNotOwnerBalance,
]; ];
await erc1155Wrapper.assertBalancesAsync(tokenHolders, tokensToTransfer, expectedInitialBalances); await erc1155Wrapper.assertBalancesAsync(tokenHolders, tokensToTransfer, expectedInitialBalances);
const expectedError = new SafeMathRevertErrors.SafeMathError(
SafeMathRevertErrors.SafeMathErrorCodes.Uint256MultiplicationOverflow,
maxUintValue,
valueMultiplier,
);
// execute transfer // execute transfer
// note - this will overflow because we are trying to transfer `maxUintValue * 2` of the 2nd token // note - this will overflow because we are trying to transfer `maxUintValue * 2` of the 2nd token
await expectTransactionFailedAsync( await expect(
erc1155ProxyWrapper.transferFromAsync( erc1155ProxyWrapper.transferFromAsync(
spender, spender,
receiver, receiver,
@ -1760,8 +1765,7 @@ describe('ERC1155Proxy', () => {
receiverCallbackData, receiverCallbackData,
authorized, authorized,
), ),
RevertReason.Uint256Overflow, ).to.revertWith(expectedError);
);
}); });
it('should revert if transferring > 1 instances of a non-fungible token (valueMultiplier field >1)', async () => { it('should revert if transferring > 1 instances of a non-fungible token (valueMultiplier field >1)', async () => {
// setup test parameters // setup test parameters