aboutsummaryrefslogtreecommitdiffstats
path: root/packages/web3-wrapper
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-07-04 03:55:05 +0800
committerAlex Browne <stephenalexbrowne@gmail.com>2018-07-04 03:57:11 +0800
commitdc956020ef7c6d3f1880263700422b31253c8da3 (patch)
tree6574a09976cfb5944107b3667748e85520c260a9 /packages/web3-wrapper
parentce1542da4fbab26d589f07f006fb5328a28bb9dd (diff)
downloaddexon-sol-tools-dc956020ef7c6d3f1880263700422b31253c8da3.tar
dexon-sol-tools-dc956020ef7c6d3f1880263700422b31253c8da3.tar.gz
dexon-sol-tools-dc956020ef7c6d3f1880263700422b31253c8da3.tar.bz2
dexon-sol-tools-dc956020ef7c6d3f1880263700422b31253c8da3.tar.lz
dexon-sol-tools-dc956020ef7c6d3f1880263700422b31253c8da3.tar.xz
dexon-sol-tools-dc956020ef7c6d3f1880263700422b31253c8da3.tar.zst
dexon-sol-tools-dc956020ef7c6d3f1880263700422b31253c8da3.zip
Move NodeType caching out of web3-wrapper and into our internal code
Diffstat (limited to 'packages/web3-wrapper')
-rw-r--r--packages/web3-wrapper/src/web3_wrapper.ts9
1 files changed, 1 insertions, 8 deletions
diff --git a/packages/web3-wrapper/src/web3_wrapper.ts b/packages/web3-wrapper/src/web3_wrapper.ts
index c2754a13e..b79ade278 100644
--- a/packages/web3-wrapper/src/web3_wrapper.ts
+++ b/packages/web3-wrapper/src/web3_wrapper.ts
@@ -49,7 +49,6 @@ export class Web3Wrapper {
private _web3: Web3;
private _txDefaults: Partial<TxData>;
private _jsonRpcRequestId: number;
- private _nodeType: NodeType | undefined;
/**
* Check if an address is a valid Ethereum address
* @param address Address to check
@@ -498,19 +497,13 @@ export class Web3Wrapper {
}
/**
* Returns either NodeType.Geth or NodeType.Ganache depending on the type of
- * the backing Ethereum node. Throws for any other type of node. This
- * function caches the result and so subsequent calls are fast.
+ * the backing Ethereum node. Throws for any other type of node.
*/
public async getNodeTypeAsync(): Promise<NodeType> {
- if (!_.isUndefined(this._nodeType)) {
- return this._nodeType;
- }
const version = await this.getNodeVersionAsync();
if (_.includes(version, uniqueVersionIds.geth)) {
- this._nodeType = NodeType.Geth;
return NodeType.Geth;
} else if (_.includes(version, uniqueVersionIds.ganache)) {
- this._nodeType = NodeType.Ganache;
return NodeType.Ganache;
} else {
throw new Error(`Unknown client version: ${version}`);