diff options
Diffstat (limited to 'packages/contracts/test/exchange')
-rw-r--r-- | packages/contracts/test/exchange/core.ts | 24 | ||||
-rw-r--r-- | packages/contracts/test/exchange/libs.ts | 16 | ||||
-rw-r--r-- | packages/contracts/test/exchange/signature_validator.ts | 16 |
3 files changed, 24 insertions, 32 deletions
diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts index 33246a681..b324988cc 100644 --- a/packages/contracts/test/exchange/core.ts +++ b/packages/contracts/test/exchange/core.ts @@ -456,30 +456,6 @@ describe('Exchange core', () => { RevertReason.RoundingError, ); }); - - it('should throw if assetData has a length < 132', async () => { - // Construct Exchange parameters - const makerAssetId = erc721MakerAssetIds[0]; - const takerAssetId = erc721TakerAssetIds[0]; - const makerAssetData = assetDataUtils.encodeERC721AssetData(erc721Token.address, makerAssetId).slice(0, -2); - signedOrder = await orderFactory.newSignedOrderAsync({ - makerAssetAmount: new BigNumber(1), - takerAssetAmount: new BigNumber(1), - makerAssetData, - takerAssetData: assetDataUtils.encodeERC721AssetData(erc721Token.address, takerAssetId), - }); - // Verify pre-conditions - const initialOwnerMakerAsset = await erc721Token.ownerOf.callAsync(makerAssetId); - expect(initialOwnerMakerAsset).to.be.bignumber.equal(makerAddress); - const initialOwnerTakerAsset = await erc721Token.ownerOf.callAsync(takerAssetId); - expect(initialOwnerTakerAsset).to.be.bignumber.equal(takerAddress); - // Call Exchange - const takerAssetFillAmount = signedOrder.takerAssetAmount; - return expectTransactionFailedAsync( - exchangeWrapper.fillOrderAsync(signedOrder, takerAddress, { takerAssetFillAmount }), - RevertReason.LengthGreaterThan131Required, - ); - }); }); describe('getOrderInfo', () => { diff --git a/packages/contracts/test/exchange/libs.ts b/packages/contracts/test/exchange/libs.ts index 2e95fa96c..51794d8a3 100644 --- a/packages/contracts/test/exchange/libs.ts +++ b/packages/contracts/test/exchange/libs.ts @@ -4,6 +4,7 @@ import { SignedOrder } from '@0xproject/types'; import { BigNumber } from '@0xproject/utils'; import * as chai from 'chai'; +import { TestConstantsContract } from '../../generated_contract_wrappers/test_constants'; import { TestLibsContract } from '../../generated_contract_wrappers/test_libs'; import { addressUtils } from '../utils/address_utils'; import { artifacts } from '../utils/artifacts'; @@ -21,6 +22,7 @@ describe('Exchange libs', () => { let signedOrder: SignedOrder; let orderFactory: OrderFactory; let libs: TestLibsContract; + let testConstants: TestConstantsContract; before(async () => { await blockchainLifecycle.startAsync(); @@ -32,6 +34,11 @@ describe('Exchange libs', () => { const accounts = await web3Wrapper.getAvailableAddressesAsync(); const makerAddress = accounts[0]; libs = await TestLibsContract.deployFrom0xArtifactAsync(artifacts.TestLibs, provider, txDefaults); + testConstants = await TestConstantsContract.deployFrom0xArtifactAsync( + artifacts.TestConstants, + provider, + txDefaults, + ); const defaultOrderParams = { ...constants.STATIC_ORDER_PARAMS, @@ -52,6 +59,15 @@ describe('Exchange libs', () => { await blockchainLifecycle.revertAsync(); }); + describe('LibConstants', () => { + describe('ZRX_ASSET_DATA', () => { + it('should have the correct ZRX_ASSET_DATA', async () => { + const isValid = await testConstants.assertValidZrxAssetData.callAsync(); + expect(isValid).to.be.equal(true); + }); + }); + }); + describe('LibOrder', () => { describe('getOrderSchema', () => { it('should output the correct order schema hash', async () => { diff --git a/packages/contracts/test/exchange/signature_validator.ts b/packages/contracts/test/exchange/signature_validator.ts index ef154bf9b..f2bb42c75 100644 --- a/packages/contracts/test/exchange/signature_validator.ts +++ b/packages/contracts/test/exchange/signature_validator.ts @@ -9,8 +9,8 @@ import { TestSignatureValidatorContract, TestSignatureValidatorSignatureValidatorApprovalEventArgs, } from '../../generated_contract_wrappers/test_signature_validator'; -import { TestValidatorContract } from '../../generated_contract_wrappers/test_validator'; -import { TestWalletContract } from '../../generated_contract_wrappers/test_wallet'; +import { ValidatorContract } from '../../generated_contract_wrappers/validator'; +import { WalletContract } from '../../generated_contract_wrappers/wallet'; import { addressUtils } from '../utils/address_utils'; import { artifacts } from '../utils/artifacts'; import { expectContractCallFailed } from '../utils/assertions'; @@ -29,8 +29,8 @@ describe('MixinSignatureValidator', () => { let signedOrder: SignedOrder; let orderFactory: OrderFactory; let signatureValidator: TestSignatureValidatorContract; - let testWallet: TestWalletContract; - let testValidator: TestValidatorContract; + let testWallet: WalletContract; + let testValidator: ValidatorContract; let signerAddress: string; let signerPrivateKey: Buffer; let notSignerAddress: string; @@ -53,14 +53,14 @@ describe('MixinSignatureValidator', () => { provider, txDefaults, ); - testWallet = await TestWalletContract.deployFrom0xArtifactAsync( - artifacts.TestWallet, + testWallet = await WalletContract.deployFrom0xArtifactAsync( + artifacts.Wallet, provider, txDefaults, signerAddress, ); - testValidator = await TestValidatorContract.deployFrom0xArtifactAsync( - artifacts.TestValidator, + testValidator = await ValidatorContract.deployFrom0xArtifactAsync( + artifacts.Validator, provider, txDefaults, signerAddress, |