aboutsummaryrefslogtreecommitdiffstats
path: root/packages/dev-utils/src
diff options
context:
space:
mode:
Diffstat (limited to 'packages/dev-utils/src')
-rw-r--r--packages/dev-utils/src/blockchain_lifecycle.ts11
1 files changed, 3 insertions, 8 deletions
diff --git a/packages/dev-utils/src/blockchain_lifecycle.ts b/packages/dev-utils/src/blockchain_lifecycle.ts
index 6e7957f10..8e4ad81c7 100644
--- a/packages/dev-utils/src/blockchain_lifecycle.ts
+++ b/packages/dev-utils/src/blockchain_lifecycle.ts
@@ -1,4 +1,4 @@
-import { Web3Wrapper } from '@0xproject/web3-wrapper';
+import { uniqueVersionIds, Web3Wrapper } from '@0xproject/web3-wrapper';
import * as _ from 'lodash';
import * as Web3 from 'web3';
@@ -7,11 +7,6 @@ enum NodeType {
Ganache = 'GANACHE',
}
-// These are unique identifiers contained in the response of the
-// web3_clientVersion call.
-const GETH_VERSION_ID = 'Geth';
-const GANACHE_VERSION_ID = 'EthereumJS TestRPC';
-
export class BlockchainLifecycle {
private _web3Wrapper: Web3Wrapper;
private _snapshotIdsStack: number[];
@@ -54,9 +49,9 @@ export class BlockchainLifecycle {
}
private async _getNodeTypeAsync(): Promise<NodeType> {
const version = await this._web3Wrapper.getNodeVersionAsync();
- if (_.includes(version, GETH_VERSION_ID)) {
+ if (_.includes(version, uniqueVersionIds.geth)) {
return NodeType.Geth;
- } else if (_.includes(version, GANACHE_VERSION_ID)) {
+ } else if (_.includes(version, uniqueVersionIds.ganache)) {
return NodeType.Ganache;
} else {
throw new Error(`Unknown client version: ${version}`);