Moved getNetwork to utils.

This commit is contained in:
Richard Moore 2018-07-16 00:48:41 -04:00
parent 3b843a1782
commit e4df325e22
No known key found for this signature in database
GPG Key ID: 525F70A6FCABC295
7 changed files with 10 additions and 17 deletions

@ -6,7 +6,6 @@ import {} from './utils/shims';
import { Contract, Interface } from './contracts'; import { Contract, Interface } from './contracts';
import * as providers from './providers'; import * as providers from './providers';
import { getNetwork } from './providers/networks';
import * as utils from './utils'; import * as utils from './utils';
import { HDNode, SigningKey, Wallet } from './wallet'; import { HDNode, SigningKey, Wallet } from './wallet';
import * as wordlists from './wordlists'; import * as wordlists from './wordlists';
@ -28,7 +27,6 @@ export {
Contract, Contract,
Interface, Interface,
getNetwork,
providers, providers,
types, types,
@ -51,7 +49,6 @@ export const ethers = {
Contract, Contract,
Interface, Interface,
getNetwork,
providers, providers,
types, types,

@ -1,9 +1,10 @@
'use strict'; 'use strict';
import { JsonRpcProvider, JsonRpcSigner } from './json-rpc-provider'; import { JsonRpcProvider, JsonRpcSigner } from './json-rpc-provider';
import { getNetwork } from './networks';
import { getNetwork } from '../utils/networks';
import { defineReadOnly } from '../utils/properties'; import { defineReadOnly } from '../utils/properties';
import { Networkish } from '../utils/types'; import { Networkish } from '../utils/types';
import * as errors from '../utils/errors'; import * as errors from '../utils/errors';

@ -2,17 +2,18 @@
// See: https://github.com/ethereum/wiki/wiki/JSON-RPC // See: https://github.com/ethereum/wiki/wiki/JSON-RPC
import { getNetwork } from './networks';
import { Provider } from './provider'; import { Provider } from './provider';
import { getAddress } from '../utils/address'; import { getAddress } from '../utils/address';
import { BigNumber } from '../utils/bignumber'; import { BigNumber } from '../utils/bignumber';
import { Arrayish, hexlify, hexStripZeros } from '../utils/bytes'; import { Arrayish, hexlify, hexStripZeros } from '../utils/bytes';
import { getNetwork } from '../utils/networks';
import { defineReadOnly, resolveProperties, shallowCopy } from '../utils/properties'; import { defineReadOnly, resolveProperties, shallowCopy } from '../utils/properties';
import { BlockTag, Network, Networkish, Signer, TransactionRequest, TransactionResponse } from '../utils/types';
import { toUtf8Bytes } from '../utils/utf8'; import { toUtf8Bytes } from '../utils/utf8';
import { ConnectionInfo, fetchJson, poll } from '../utils/web'; import { ConnectionInfo, fetchJson, poll } from '../utils/web';
import { BlockTag, Network, Networkish, Signer, TransactionRequest, TransactionResponse } from '../utils/types';
import * as errors from '../utils/errors'; import * as errors from '../utils/errors';
function timer(timeout: number): Promise<any> { function timer(timeout: number): Promise<any> {

@ -1,11 +1,10 @@
'use strict'; 'use strict';
import { getNetwork, Network, Networkish } from './networks';
import { getAddress, getContractAddress } from '../utils/address'; import { getAddress, getContractAddress } from '../utils/address';
import { BigNumber, bigNumberify, BigNumberish } from '../utils/bignumber'; import { BigNumber, bigNumberify, BigNumberish } from '../utils/bignumber';
import { hexDataLength, hexDataSlice, hexlify, hexStripZeros, isHexString, stripZeros } from '../utils/bytes'; import { hexDataLength, hexDataSlice, hexlify, hexStripZeros, isHexString, stripZeros } from '../utils/bytes';
import { namehash } from '../utils/hash'; import { namehash } from '../utils/hash';
import { getNetwork, Network, Networkish } from '../utils/networks';
import { defineReadOnly, resolveProperties, shallowCopy } from '../utils/properties'; import { defineReadOnly, resolveProperties, shallowCopy } from '../utils/properties';
import { encode as rlpEncode } from '../utils/rlp'; import { encode as rlpEncode } from '../utils/rlp';
import { parse as parseTransaction, Transaction } from '../utils/transaction'; import { parse as parseTransaction, Transaction } from '../utils/transaction';

@ -1,11 +1,11 @@
'use strict'; 'use strict';
import { Networkish } from './networks';
import { JsonRpcProvider } from './json-rpc-provider'; import { JsonRpcProvider } from './json-rpc-provider';
import { defineReadOnly } from '../utils/properties'; import { defineReadOnly } from '../utils/properties';
import { AsyncProvider } from '../utils/types'; import { AsyncProvider, Networkish } from '../utils/types';
import * as errors from '../utils/errors'; import * as errors from '../utils/errors';
/* /*
@ -14,13 +14,6 @@ utils.defineProperty(Web3Signer, 'onchange', {
}); });
export type AsyncProvider = {
isMetaMask: boolean;
host?: string;
path?: string;
sendAsync: (request: any, callback: (error: any, response: any) => void) => void
}
*/ */
export class Web3Provider extends JsonRpcProvider { export class Web3Provider extends JsonRpcProvider {

@ -13,6 +13,7 @@ import { keccak256 } from './keccak256';
import { sha256 } from './sha2'; import { sha256 } from './sha2';
import { keccak256 as solidityKeccak256, pack as solidityPack, sha256 as soliditySha256 } from './solidity'; import { keccak256 as solidityKeccak256, pack as solidityPack, sha256 as soliditySha256 } from './solidity';
import { randomBytes } from './random-bytes'; import { randomBytes } from './random-bytes';
import { getNetwork } from './networks';
import { defineFrozen, defineReadOnly, resolveProperties, shallowCopy } from './properties'; import { defineFrozen, defineReadOnly, resolveProperties, shallowCopy } from './properties';
import * as RLP from './rlp'; import * as RLP from './rlp';
import { parse as parseTransaction, serialize as serializeTransaction } from './transaction'; import { parse as parseTransaction, serialize as serializeTransaction } from './transaction';
@ -51,6 +52,7 @@ export {
RLP, RLP,
fetchJson, fetchJson,
getNetwork,
defineReadOnly, defineReadOnly,
defineFrozen, defineFrozen,