Lint/Prettify

This commit is contained in:
Ara Kevonian
2018-04-09 07:05:46 -07:00
parent 8d76d74a17
commit c80b42712a
4 changed files with 33 additions and 38 deletions

View File

@@ -4,7 +4,9 @@ Edit the package's CHANGELOG.json file only.
-->
CHANGELOG
## v0.36.0 - TBD
* Add `zeroEx.exchange.getOrderStateAsync` to allow obtaining current OrderState for a signedOrder
## v0.35.0 - _April 2, 2018_

View File

@@ -2,43 +2,38 @@
"name": "0x.js",
"version": "0.35.0",
"description": "A javascript library for interacting with the 0x protocol",
"keywords": [
"0x.js",
"0xproject",
"ethereum",
"tokens",
"exchange"
],
"keywords": ["0x.js", "0xproject", "ethereum", "tokens", "exchange"],
"main": "lib/src/index.js",
"types": "lib/src/index.d.ts",
"scripts": {
"build:watch": "tsc -w",
"prebuild": "run-s clean generate_contract_wrappers",
"build": "run-p build:umd:prod build:commonjs; exit 0;",
"generate_contract_wrappers": "node ../abi-gen/lib/index.js --abis 'src/artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|TokenRegistry|DummyToken).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/contract_wrappers/generated --backend ethers && prettier --write 'src/contract_wrappers/generated/**.ts'",
"generate_contract_wrappers":
"node ../abi-gen/lib/index.js --abis 'src/artifacts/@(Exchange|Token|TokenTransferProxy|EtherToken|TokenRegistry|DummyToken).json' --template ../contract_templates/contract.handlebars --partials '../contract_templates/partials/**/*.handlebars' --output src/contract_wrappers/generated --backend ethers && prettier --write 'src/contract_wrappers/generated/**.ts'",
"lint": "tslint --project . 'src/**/*.ts' 'test/**/*.ts'",
"test:circleci": "run-s test:coverage",
"test": "run-s clean test:commonjs",
"test:coverage": "nyc npm run test --all && yarn coverage:report:lcov",
"coverage:report:lcov": "nyc report --reporter=text-lcov > coverage/lcov.info",
"update_contracts": "for i in ${npm_package_config_artifacts}; do copyfiles -u 4 ../contracts/build/contracts/$i.json ../0x.js/src/artifacts; done;",
"update_contracts":
"for i in ${npm_package_config_artifacts}; do copyfiles -u 4 ../contracts/build/contracts/$i.json ../0x.js/src/artifacts; done;",
"clean": "shx rm -rf _bundles lib test_temp scripts",
"build:umd:prod": "NODE_ENV=production webpack",
"build:commonjs": "tsc && copyfiles -u 2 './src/artifacts/**/*.json' ./lib/src/artifacts && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts",
"build:commonjs":
"tsc && copyfiles -u 2 './src/artifacts/**/*.json' ./lib/src/artifacts && copyfiles -u 3 './lib/src/monorepo_scripts/**/*' ./scripts",
"test:commonjs": "run-s build:commonjs run_mocha",
"run_mocha": "mocha lib/test/**/*_test.js --timeout 10000 --bail --exit",
"manual:postpublish": "yarn build; node ./scripts/postpublish.js",
"docs:stage": "yarn build && node ./scripts/stage_docs.js",
"docs:json": "typedoc --excludePrivate --excludeExternals --target ES5 --json $JSON_FILE_PATH $PROJECT_FILES",
"upload_docs_json": "aws s3 cp generated_docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type application/json"
"upload_docs_json":
"aws s3 cp generated_docs/index.json $S3_URL --profile 0xproject --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers --content-type application/json"
},
"config": {
"artifacts": "TokenTransferProxy Exchange TokenRegistry Token EtherToken",
"postpublish": {
"assets": [
"packages/0x.js/_bundles/index.js",
"packages/0x.js/_bundles/index.min.js"
],
"assets": ["packages/0x.js/_bundles/index.js", "packages/0x.js/_bundles/index.min.js"],
"docPublishConfigs": {
"extraFileIncludes": [
"../types/src/index.ts",

View File

@@ -16,19 +16,19 @@ import { artifacts } from '../artifacts';
import { BalanceAndProxyAllowanceLazyStore } from '../stores/balance_proxy_allowance_lazy_store';
import { OrderFilledCancelledLazyStore } from '../stores/order_filled_cancelled_lazy_store';
import {
BlockRange,
EventCallback,
ExchangeContractErrCodes,
ExchangeContractErrs,
IndexedFilterValues,
MethodOpts,
OrderAddresses,
OrderCancellationRequest,
OrderFillRequest,
OrderState,
OrderTransactionOpts,
OrderValues,
ValidateOrderFillableOpts,
BlockRange,
EventCallback,
ExchangeContractErrCodes,
ExchangeContractErrs,
IndexedFilterValues,
MethodOpts,
OrderAddresses,
OrderCancellationRequest,
OrderFillRequest,
OrderState,
OrderTransactionOpts,
OrderValues,
ValidateOrderFillableOpts,
} from '../types';
import { assert } from '../utils/assert';
import { decorators } from '../utils/decorators';
@@ -39,10 +39,10 @@ import { utils } from '../utils/utils';
import { ContractWrapper } from './contract_wrapper';
import {
ExchangeContract,
ExchangeContractEventArgs,
ExchangeEvents,
LogErrorContractEventArgs,
ExchangeContract,
ExchangeContractEventArgs,
ExchangeEvents,
LogErrorContractEventArgs,
} from './generated/exchange';
import { TokenWrapper } from './token_wrapper';
const SHOULD_VALIDATE_BY_DEFAULT = true;
@@ -886,10 +886,7 @@ export class ExchangeWrapper extends ContractWrapper {
BlockParamLiteral.Latest,
);
const orderFilledCancelledLazyStore = new OrderFilledCancelledLazyStore(this);
const orderStateUtils = new OrderStateUtils(
balanceAndProxyAllowanceLazyStore,
orderFilledCancelledLazyStore,
);
const orderStateUtils = new OrderStateUtils(balanceAndProxyAllowanceLazyStore, orderFilledCancelledLazyStore);
return orderStateUtils.getOrderStateAsync(signedOrder);
}
/**

View File

@@ -14,7 +14,8 @@ import {
LogCancelContractEventArgs,
LogFillContractEventArgs,
OrderCancellationRequest,
OrderFillRequest, OrderState, OrderStateInvalid,
OrderFillRequest,
OrderState,
SignedOrder,
Token,
ZeroEx,
@@ -1156,7 +1157,7 @@ describe('ExchangeWrapper', () => {
expect(args.maker).to.be.equal(differentMakerAddress);
});
});
describe('#getOrderState', () => {
describe('#getOrderStateAsync', () => {
let maker: string;
let taker: string;
let makerToken: Token;