Move OrderValidator to the protocol package

This commit is contained in:
Leonid Logvinov 2018-12-11 09:38:22 -08:00
parent 7b72b0c762
commit 36736f82d4
No known key found for this signature in database
GPG Key ID: 0DD294BFDE8C95D4
12 changed files with 20 additions and 23 deletions

View File

@ -18,5 +18,5 @@
} }
} }
}, },
"contracts": ["DutchAuction", "Forwarder", "OrderValidator"] "contracts": ["DutchAuction", "Forwarder"]
} }

View File

@ -33,7 +33,7 @@
"lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol"
}, },
"config": { "config": {
"abis": "generated-artifacts/@(DutchAuction|Forwarder|OrderValidator).json" "abis": "generated-artifacts/@(DutchAuction|Forwarder).json"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -2,10 +2,8 @@ import { ContractArtifact } from 'ethereum-types';
import * as DutchAuction from '../../generated-artifacts/DutchAuction.json'; import * as DutchAuction from '../../generated-artifacts/DutchAuction.json';
import * as Forwarder from '../../generated-artifacts/Forwarder.json'; import * as Forwarder from '../../generated-artifacts/Forwarder.json';
import * as OrderValidator from '../../generated-artifacts/OrderValidator.json';
export const artifacts = { export const artifacts = {
DutchAuction: DutchAuction as ContractArtifact, DutchAuction: DutchAuction as ContractArtifact,
Forwarder: Forwarder as ContractArtifact, Forwarder: Forwarder as ContractArtifact,
OrderValidator: OrderValidator as ContractArtifact,
}; };

View File

@ -1,3 +1,2 @@
export * from '../../generated-wrappers/dutch_auction'; export * from '../../generated-wrappers/dutch_auction';
export * from '../../generated-wrappers/forwarder'; export * from '../../generated-wrappers/forwarder';
export * from '../../generated-wrappers/order_validator';

View File

@ -6,10 +6,6 @@
"resolveJsonModule": true "resolveJsonModule": true
}, },
"include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"], "include": ["./src/**/*", "./test/**/*", "./generated-wrappers/**/*"],
"files": [ "files": ["./generated-artifacts/DutchAuction.json", "./generated-artifacts/Forwarder.json"],
"./generated-artifacts/DutchAuction.json",
"./generated-artifacts/Forwarder.json",
"./generated-artifacts/OrderValidator.json"
],
"exclude": ["./deploy/solc/solc_bin"] "exclude": ["./deploy/solc/solc_bin"]
} }

View File

@ -25,6 +25,7 @@
"Exchange", "Exchange",
"MixinAuthorizable", "MixinAuthorizable",
"MultiAssetProxy", "MultiAssetProxy",
"OrderValidator",
"TestAssetProxyOwner", "TestAssetProxyOwner",
"TestAssetProxyDispatcher", "TestAssetProxyDispatcher",
"TestExchangeInternals", "TestExchangeInternals",

View File

@ -33,7 +33,7 @@
"lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol" "lint-contracts": "solhint -c ../.solhint.json contracts/**/**/**/**/*.sol"
}, },
"config": { "config": {
"abis": "generated-artifacts/@(AssetProxyOwner|ERC20Proxy|ERC721Proxy|Exchange|MixinAuthorizable|MultiAssetProxy|TestSignatureValidator|TestAssetProxyOwner|TestAssetProxyDispatcher|TestExchangeInternals|TestStaticCallReceiver).json" "abis": "generated-artifacts/@(AssetProxyOwner|ERC20Proxy|ERC721Proxy|Exchange|MixinAuthorizable|MultiAssetProxy|OrderValidator|TestSignatureValidator|TestAssetProxyOwner|TestAssetProxyDispatcher|TestExchangeInternals|TestStaticCallReceiver).json"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -6,6 +6,7 @@ import * as ERC721Proxy from '../../generated-artifacts/ERC721Proxy.json';
import * as Exchange from '../../generated-artifacts/Exchange.json'; import * as Exchange from '../../generated-artifacts/Exchange.json';
import * as MixinAuthorizable from '../../generated-artifacts/MixinAuthorizable.json'; import * as MixinAuthorizable from '../../generated-artifacts/MixinAuthorizable.json';
import * as MultiAssetProxy from '../../generated-artifacts/MultiAssetProxy.json'; import * as MultiAssetProxy from '../../generated-artifacts/MultiAssetProxy.json';
import * as OrderValidator from '../../generated-artifacts/OrderValidator.json';
import * as TestAssetProxyDispatcher from '../../generated-artifacts/TestAssetProxyDispatcher.json'; import * as TestAssetProxyDispatcher from '../../generated-artifacts/TestAssetProxyDispatcher.json';
import * as TestAssetProxyOwner from '../../generated-artifacts/TestAssetProxyOwner.json'; import * as TestAssetProxyOwner from '../../generated-artifacts/TestAssetProxyOwner.json';
import * as TestExchangeInternals from '../../generated-artifacts/TestExchangeInternals.json'; import * as TestExchangeInternals from '../../generated-artifacts/TestExchangeInternals.json';
@ -19,6 +20,7 @@ export const artifacts = {
Exchange: Exchange as ContractArtifact, Exchange: Exchange as ContractArtifact,
MixinAuthorizable: MixinAuthorizable as ContractArtifact, MixinAuthorizable: MixinAuthorizable as ContractArtifact,
MultiAssetProxy: MultiAssetProxy as ContractArtifact, MultiAssetProxy: MultiAssetProxy as ContractArtifact,
OrderValidator: OrderValidator as ContractArtifact,
TestAssetProxyDispatcher: TestAssetProxyDispatcher as ContractArtifact, TestAssetProxyDispatcher: TestAssetProxyDispatcher as ContractArtifact,
TestAssetProxyOwner: TestAssetProxyOwner as ContractArtifact, TestAssetProxyOwner: TestAssetProxyOwner as ContractArtifact,
TestExchangeInternals: TestExchangeInternals as ContractArtifact, TestExchangeInternals: TestExchangeInternals as ContractArtifact,

View File

@ -3,6 +3,7 @@ export * from '../../generated-wrappers/erc20_proxy';
export * from '../../generated-wrappers/erc721_proxy'; export * from '../../generated-wrappers/erc721_proxy';
export * from '../../generated-wrappers/exchange'; export * from '../../generated-wrappers/exchange';
export * from '../../generated-wrappers/mixin_authorizable'; export * from '../../generated-wrappers/mixin_authorizable';
export * from '../../generated-wrappers/order_validator';
export * from '../../generated-wrappers/test_asset_proxy_dispatcher'; export * from '../../generated-wrappers/test_asset_proxy_dispatcher';
export * from '../../generated-wrappers/test_asset_proxy_owner'; export * from '../../generated-wrappers/test_asset_proxy_owner';
export * from '../../generated-wrappers/test_exchange_internals'; export * from '../../generated-wrappers/test_exchange_internals';

View File

@ -1,12 +1,3 @@
import {
artifacts as protocolArtifacts,
ERC20ProxyContract,
ERC20Wrapper,
ERC721ProxyContract,
ERC721Wrapper,
ExchangeContract,
ExchangeWrapper,
} from '@0x/contracts-protocol';
import { import {
chaiSetup, chaiSetup,
constants, constants,
@ -24,8 +15,16 @@ import { BigNumber } from '@0x/utils';
import * as chai from 'chai'; import * as chai from 'chai';
import * as _ from 'lodash'; import * as _ from 'lodash';
import { OrderValidatorContract } from '../../generated-wrappers/order_validator'; import {
import { artifacts } from '../../src/artifacts'; artifacts,
ERC20ProxyContract,
ERC20Wrapper,
ERC721ProxyContract,
ERC721Wrapper,
ExchangeContract,
ExchangeWrapper,
OrderValidatorContract,
} from '../../src';
chaiSetup.configure(); chaiSetup.configure();
const expect = chai.expect; const expect = chai.expect;
@ -81,7 +80,7 @@ describe('OrderValidator', () => {
const zrxAssetData = assetDataUtils.encodeERC20AssetData(zrxToken.address); const zrxAssetData = assetDataUtils.encodeERC20AssetData(zrxToken.address);
exchange = await ExchangeContract.deployFrom0xArtifactAsync( exchange = await ExchangeContract.deployFrom0xArtifactAsync(
protocolArtifacts.Exchange, artifacts.Exchange,
provider, provider,
txDefaults, txDefaults,
zrxAssetData, zrxAssetData,

View File

@ -13,6 +13,7 @@
"./generated-artifacts/Exchange.json", "./generated-artifacts/Exchange.json",
"./generated-artifacts/MixinAuthorizable.json", "./generated-artifacts/MixinAuthorizable.json",
"./generated-artifacts/MultiAssetProxy.json", "./generated-artifacts/MultiAssetProxy.json",
"./generated-artifacts/OrderValidator.json",
"./generated-artifacts/TestAssetProxyDispatcher.json", "./generated-artifacts/TestAssetProxyDispatcher.json",
"./generated-artifacts/TestAssetProxyOwner.json", "./generated-artifacts/TestAssetProxyOwner.json",
"./generated-artifacts/TestExchangeInternals.json", "./generated-artifacts/TestExchangeInternals.json",