diff options
author | Fabio Berger <me@fabioberger.com> | 2018-12-19 00:59:15 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-12-19 00:59:15 +0800 |
commit | 622b9f662e74d571da745047ede097c7a392d09e (patch) | |
tree | 68a9517882b04a3d428f6996e0790ceb82e89be4 /contracts/test-utils | |
parent | e295eeb8938468b1527d5d81f212766cef40bc81 (diff) | |
parent | 67df5a433d68a2af1a3a03a8bf431629a534dc97 (diff) | |
download | dexon-sol-tools-622b9f662e74d571da745047ede097c7a392d09e.tar dexon-sol-tools-622b9f662e74d571da745047ede097c7a392d09e.tar.gz dexon-sol-tools-622b9f662e74d571da745047ede097c7a392d09e.tar.bz2 dexon-sol-tools-622b9f662e74d571da745047ede097c7a392d09e.tar.lz dexon-sol-tools-622b9f662e74d571da745047ede097c7a392d09e.tar.xz dexon-sol-tools-622b9f662e74d571da745047ede097c7a392d09e.tar.zst dexon-sol-tools-622b9f662e74d571da745047ede097c7a392d09e.zip |
Merge branch 'development' into features/orderwatcher_ws
* development: (107 commits)
Fix OrderWatcher title to fix sidebar top
Fix version picker so it doesn't overflow onto two lines
Fix bug in pull_missing_blocks with incorrect start block (#1438)
Pull approval events for ZRX and DAI (#1430)
fix semicolon and apply prettier
Fix dex order quote/base asset assigning (#1432)
Apply prettier
Publish
Updated CHANGELOGS
Rename contracts CHANGELOGs to DEPLOYs
Move Forwarder CHANGELOG entries to extensions CHANGELOG
Make contracts packages not private
Publish
Updated CHANGELOGS
Show @ price in light grey
Updated CHANGELOGS
typeof -> isString
add special case to scrape OHLCV for eth/usd (#1428)
run linter
simplify scaling input logic
...
Diffstat (limited to 'contracts/test-utils')
-rw-r--r-- | contracts/test-utils/CHANGELOG.json | 11 | ||||
-rw-r--r-- | contracts/test-utils/CHANGELOG.md | 10 | ||||
-rw-r--r-- | contracts/test-utils/package.json | 36 | ||||
-rw-r--r-- | contracts/test-utils/src/assertions.ts | 14 | ||||
-rw-r--r-- | contracts/test-utils/src/test_with_reference.ts | 6 |
5 files changed, 49 insertions, 28 deletions
diff --git a/contracts/test-utils/CHANGELOG.json b/contracts/test-utils/CHANGELOG.json new file mode 100644 index 000000000..6e4682b7e --- /dev/null +++ b/contracts/test-utils/CHANGELOG.json @@ -0,0 +1,11 @@ +[ + { + "version": "1.0.2", + "changes": [ + { + "note": "Dependencies updated" + } + ], + "timestamp": 1544739608 + } +] diff --git a/contracts/test-utils/CHANGELOG.md b/contracts/test-utils/CHANGELOG.md new file mode 100644 index 000000000..716353d05 --- /dev/null +++ b/contracts/test-utils/CHANGELOG.md @@ -0,0 +1,10 @@ +<!-- +changelogUtils.file is auto-generated using the monorepo-scripts package. Don't edit directly. +Edit the package's CHANGELOG.json file only. +--> + +CHANGELOG + +## v1.0.2 - _December 13, 2018_ + + * Dependencies updated diff --git a/contracts/test-utils/package.json b/contracts/test-utils/package.json index 513cfdc10..18ec8f6a8 100644 --- a/contracts/test-utils/package.json +++ b/contracts/test-utils/package.json @@ -1,6 +1,6 @@ { "name": "@0x/contracts-test-utils", - "version": "1.0.0", + "version": "1.0.2", "engines": { "node": ">=6.12" }, @@ -40,34 +40,34 @@ "typescript": "3.0.1" }, "dependencies": { - "@0x/abi-gen": "^1.0.17", - "@0x/dev-utils": "^1.0.18", - "@0x/sol-compiler": "^1.1.13", - "@0x/subproviders": "^2.1.5", - "@0x/tslint-config": "^1.0.10", + "@0x/abi-gen": "^1.0.19", + "@0x/dev-utils": "^1.0.21", + "@0x/order-utils": "^3.0.7", + "@0x/sol-compiler": "^1.1.16", + "@0x/sol-cov": "^2.1.16", + "@0x/subproviders": "^2.1.8", + "@0x/tslint-config": "^2.0.0", + "@0x/types": "^1.4.1", + "@0x/typescript-typings": "^3.0.6", + "@0x/utils": "^2.0.8", + "@0x/web3-wrapper": "^3.2.1", "@types/bn.js": "^4.11.0", "@types/ethereumjs-abi": "^0.6.0", + "@types/js-combinatorics": "^0.5.29", "@types/lodash": "4.14.104", "@types/node": "*", + "bn.js": "^4.11.8", "chai": "^4.0.1", + "chai-as-promised": "^7.1.0", "chai-bignumber": "^2.0.1", "dirty-chai": "^2.0.1", - "make-promises-safe": "^1.1.0", - "@0x/order-utils": "^3.0.3", - "@0x/types": "^1.3.0", - "@0x/typescript-typings": "^3.0.4", - "@0x/utils": "^2.0.6", - "@0x/sol-cov": "^2.1.13", - "@0x/web3-wrapper": "^3.1.5", - "@types/js-combinatorics": "^0.5.29", - "chai-as-promised": "^7.1.0", - "bn.js": "^4.11.8", - "ethereum-types": "^1.1.2", + "ethereum-types": "^1.1.4", "ethereumjs-abi": "0.6.5", "ethereumjs-util": "^5.1.1", "ethers": "~4.0.4", "js-combinatorics": "^0.5.3", - "lodash": "^4.17.5" + "lodash": "^4.17.5", + "make-promises-safe": "^1.1.0" }, "publishConfig": { "access": "public" diff --git a/contracts/test-utils/src/assertions.ts b/contracts/test-utils/src/assertions.ts index 5b1cedfcc..f31651f4d 100644 --- a/contracts/test-utils/src/assertions.ts +++ b/contracts/test-utils/src/assertions.ts @@ -23,7 +23,7 @@ export type sendTransactionResult = Promise<TransactionReceipt | TransactionRece * @returns either the given ganacheError or gethError depending on the backing * node. */ -async function _getGanacheOrGethError(ganacheError: string, gethError: string): Promise<string> { +async function _getGanacheOrGethErrorAsync(ganacheError: string, gethError: string): Promise<string> { if (_.isUndefined(nodeType)) { nodeType = await web3Wrapper.getNodeTypeAsync(); } @@ -38,15 +38,15 @@ async function _getGanacheOrGethError(ganacheError: string, gethError: string): } async function _getInsufficientFundsErrorMessageAsync(): Promise<string> { - return _getGanacheOrGethError("sender doesn't have enough funds", 'insufficient funds'); + return _getGanacheOrGethErrorAsync("sender doesn't have enough funds", 'insufficient funds'); } async function _getTransactionFailedErrorMessageAsync(): Promise<string> { - return _getGanacheOrGethError('revert', 'always failing transaction'); + return _getGanacheOrGethErrorAsync('revert', 'always failing transaction'); } async function _getContractCallFailedErrorMessageAsync(): Promise<string> { - return _getGanacheOrGethError('revert', 'Contract call failed'); + return _getGanacheOrGethErrorAsync('revert', 'Contract call failed'); } /** @@ -54,7 +54,7 @@ async function _getContractCallFailedErrorMessageAsync(): Promise<string> { * contract call. The exact error message depends on the backing Ethereum node. */ export async function getInvalidOpcodeErrorMessageForCallAsync(): Promise<string> { - return _getGanacheOrGethError('invalid opcode', 'Contract call failed'); + return _getGanacheOrGethErrorAsync('invalid opcode', 'Contract call failed'); } /** @@ -65,7 +65,7 @@ export async function getInvalidOpcodeErrorMessageForCallAsync(): Promise<string * @returns the expected error message. */ export async function getRevertReasonOrErrorMessageForSendTransactionAsync(reason: RevertReason): Promise<string> { - return _getGanacheOrGethError(reason, 'always failing transaction'); + return _getGanacheOrGethErrorAsync(reason, 'always failing transaction'); } /** @@ -137,7 +137,7 @@ export async function expectTransactionFailedWithoutReasonAsync(p: sendTransacti // directly. txReceiptStatus = result.status; } else { - throw new Error('Unexpected result type: ' + typeof result); + throw new Error(`Unexpected result type: ${typeof result}`); } expect(_.toString(txReceiptStatus)).to.equal( '0', diff --git a/contracts/test-utils/src/test_with_reference.ts b/contracts/test-utils/src/test_with_reference.ts index b80be4a6c..75d15b0aa 100644 --- a/contracts/test-utils/src/test_with_reference.ts +++ b/contracts/test-utils/src/test_with_reference.ts @@ -26,7 +26,7 @@ type PromiseResult<T> = Value<T> | ErrorMessage; // TODO(albrow): This seems like a generic utility function that could exist in // lodash. We should replace it by a library implementation, or move it to our // own. -async function evaluatePromise<T>(promise: Promise<T>): Promise<PromiseResult<T>> { +async function evaluatePromiseAsync<T>(promise: Promise<T>): Promise<PromiseResult<T>> { try { return new Value<T>(await promise); } catch (e) { @@ -93,10 +93,10 @@ export async function testWithReferenceFuncAsync( values: any[], ): Promise<void> { // Measure correct behaviour - const expected = await evaluatePromise(referenceFuncAsync(...values)); + const expected = await evaluatePromiseAsync(referenceFuncAsync(...values)); // Measure actual behaviour - const actual = await evaluatePromise(testFuncAsync(...values)); + const actual = await evaluatePromiseAsync(testFuncAsync(...values)); // Compare behaviour if (expected instanceof ErrorMessage) { |