aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-06-06 06:12:09 +0800
committerAlex Browne <stephenalexbrowne@gmail.com>2018-06-07 03:40:31 +0800
commit63caddea62453863de84a4b53e14fe3e61d3008f (patch)
treef9fa506486272d49e708b44e9f65dc86c196aeea
parent36b01fbdcfcda93d185e018e31a919c36f2848ac (diff)
downloaddexon-sol-tools-63caddea62453863de84a4b53e14fe3e61d3008f.tar.gz
dexon-sol-tools-63caddea62453863de84a4b53e14fe3e61d3008f.tar.zst
dexon-sol-tools-63caddea62453863de84a4b53e14fe3e61d3008f.zip
Small fixes and cleanup
-rw-r--r--packages/0x.js/src/0x.ts3
-rw-r--r--packages/contracts/src/utils/assertions.ts6
-rw-r--r--packages/contracts/src/utils/constants.ts2
-rw-r--r--packages/contracts/test/asset_proxy_owner.ts4
-rw-r--r--packages/web3-wrapper/src/web3_wrapper.ts26
-rw-r--r--packages/web3-wrapper/test/web3_wrapper_test.ts19
6 files changed, 5 insertions, 55 deletions
diff --git a/packages/0x.js/src/0x.ts b/packages/0x.js/src/0x.ts
index d19d04cbe..206954a0b 100644
--- a/packages/0x.js/src/0x.ts
+++ b/packages/0x.js/src/0x.ts
@@ -200,8 +200,7 @@ export class ZeroEx {
*/
public async awaitTransactionMinedAsync(
txHash: string,
- // TODO(albrow): Change this back to 1000
- pollingIntervalMs: number = 100,
+ pollingIntervalMs: number = 1000,
timeoutMs?: number,
): Promise<TransactionReceiptWithDecodedLogs> {
// Hack: Get Web3Wrapper from ContractWrappers
diff --git a/packages/contracts/src/utils/assertions.ts b/packages/contracts/src/utils/assertions.ts
index 4fc410363..1ea071d01 100644
--- a/packages/contracts/src/utils/assertions.ts
+++ b/packages/contracts/src/utils/assertions.ts
@@ -13,8 +13,7 @@ export function expectRevertOrAlwaysFailingTransaction<T>(p: Promise<T>): Promis
.then(e => {
expect(e).to.satisfy(
(err: Error) =>
- _.includes(err.message, constants.REVERT) ||
- _.includes(err.message, constants.ALWAYS_FAILING_TRANSACTION),
+ _.includes(err.message, constants.REVERT) || _.includes(err.message, 'always failing transaction'),
);
});
}
@@ -37,8 +36,7 @@ export function expectRevertOrContractCallFailed<T>(p: Promise<T>): PromiseLike<
.then(e => {
expect(e).to.satisfy(
(err: Error) =>
- _.includes(err.message, constants.REVERT) ||
- _.includes(err.message, constants.CONTRACT_CALL_FAILED),
+ _.includes(err.message, constants.REVERT) || _.includes(err.message, 'Contract call failed'),
);
});
}
diff --git a/packages/contracts/src/utils/constants.ts b/packages/contracts/src/utils/constants.ts
index a21ca29ed..fa2a4af3c 100644
--- a/packages/contracts/src/utils/constants.ts
+++ b/packages/contracts/src/utils/constants.ts
@@ -19,8 +19,6 @@ const TESTRPC_PRIVATE_KEYS_STRINGS = [
export const constants = {
INVALID_OPCODE: 'invalid opcode',
REVERT: 'revert',
- ALWAYS_FAILING_TRANSACTION: 'always failing transaction',
- CONTRACT_CALL_FAILED: 'Contract call failed',
LIB_BYTES_GT_ZERO_LENGTH_REQUIRED: 'Length must be greater than 0.',
LIB_BYTES_GTE_4_LENGTH_REQUIRED: 'Length must be greater than or equal to 4.',
LIB_BYTES_GTE_20_LENGTH_REQUIRED: 'Length must be greater than or equal to 20.',
diff --git a/packages/contracts/test/asset_proxy_owner.ts b/packages/contracts/test/asset_proxy_owner.ts
index c4085cb41..780ba2a4c 100644
--- a/packages/contracts/test/asset_proxy_owner.ts
+++ b/packages/contracts/test/asset_proxy_owner.ts
@@ -30,7 +30,7 @@ describe('AssetProxyOwner', () => {
let owners: string[];
let authorized: string;
const REQUIRED_APPROVALS = new BigNumber(2);
- const SECONDS_TIME_LOCKED = new BigNumber(1000);
+ const SECONDS_TIME_LOCKED = new BigNumber(1000000);
let erc20Proxy: MixinAuthorizableContract;
let erc721Proxy: MixinAuthorizableContract;
@@ -162,7 +162,7 @@ describe('AssetProxyOwner', () => {
const log = submitTxRes.logs[0] as LogWithDecodedArgs<SubmissionContractEventArgs>;
const txId = log.args.transactionId;
- const confirmTxRes = await multiSigWrapper.confirmTransactionAsync(txId, owners[1]);
+ await multiSigWrapper.confirmTransactionAsync(txId, owners[1]);
await increaseTimeAndMineBlockAsync(SECONDS_TIME_LOCKED.toNumber());
const executeTxRes = await multiSigWrapper.executeTransactionAsync(txId, owners[0]);
diff --git a/packages/web3-wrapper/src/web3_wrapper.ts b/packages/web3-wrapper/src/web3_wrapper.ts
index ed2d0a119..a19253449 100644
--- a/packages/web3-wrapper/src/web3_wrapper.ts
+++ b/packages/web3-wrapper/src/web3_wrapper.ts
@@ -407,32 +407,6 @@ export class Web3Wrapper {
return receipt;
}
/**
- * Start the CPU mining process with the given number of threads and
- * generate a new DAG if need be.
- * @param threads The number of threads to mine on.
- */
- public async minerStartAsync(threads: number = 1): Promise<void> {
- await this._sendRawPayloadAsync<boolean>({
- method: 'miner_start',
- params: [threads],
- });
- }
- /**
- * Stop the CPU mining process.
- * @param threads The number of threads to mine on.
- */
- public async minerStopAsync(): Promise<void> {
- await this._sendRawPayloadAsync<boolean>({ method: 'miner_stop', params: [] });
- }
- /**
- * Returns true if client is actively mining new blocks.
- * @returns A boolean indicating whether the node is currently mining.
- */
- public async isMiningAsync(): Promise<boolean> {
- const isMining = await promisify<boolean>(this._web3.eth.getMining)();
- return isMining;
- }
- /**
* Sets the current head of the local chain by block number. Note, this is a
* destructive action and may severely damage your chain. Use with extreme
* caution.
diff --git a/packages/web3-wrapper/test/web3_wrapper_test.ts b/packages/web3-wrapper/test/web3_wrapper_test.ts
index 1843bcf2c..326efe654 100644
--- a/packages/web3-wrapper/test/web3_wrapper_test.ts
+++ b/packages/web3-wrapper/test/web3_wrapper_test.ts
@@ -2,7 +2,6 @@ import * as chai from 'chai';
import * as Ganache from 'ganache-core';
import 'make-promises-safe';
import 'mocha';
-import * as Web3 from 'web3';
import { Web3Wrapper } from '../src';
@@ -38,22 +37,4 @@ describe('Web3Wrapper tests', () => {
expect(networkId).to.be.equal(NETWORK_ID);
});
});
- describe('mining functions', () => {
- it('starts and stops the miner', async () => {
- // Note: depending on our provider, the miner may or may not already
- // be mining. To account for both conditions, we have what might
- // look like too many stops and starts here, but it is necessary.
- await web3Wrapper.minerStopAsync();
- let isMining = await web3Wrapper.isMiningAsync();
- expect(isMining).to.be.false();
- await web3Wrapper.minerStartAsync(1);
- isMining = await web3Wrapper.isMiningAsync();
- expect(isMining).to.be.true();
- isMining = await web3Wrapper.isMiningAsync();
- expect(isMining).to.be.true();
- await web3Wrapper.minerStopAsync();
- isMining = await web3Wrapper.isMiningAsync();
- expect(isMining).to.be.false();
- });
- });
});