diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 64bddedb1b..c29243637f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -47,6 +47,7 @@ jobs: if: startsWith(matrix.os, 'windows-') run: npm config set msvs_version 2015 - run: npm ci + - run: npm run tsc - run: npm test env: FORCE_COLOR: 1 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 7c7cdd8003..43a5ae5abb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -59,10 +59,14 @@ Runs all tests: ## To create a new package -- `npm run create --location ` +- `npm run create -- --location [--folder ]` + +**NOTE:** You must pass the `--` that follows `create`. This will create a new package with Ganache defaults at `src//`. +If you provide the optional `--folder` option, the package will be created at `src//`. + ## To add a module to a package: - `npx lerna add [@version] -E [--dev] [--peer] --scope=` diff --git a/lerna.json b/lerna.json index f53127ee45..f7f4786db2 100644 --- a/lerna.json +++ b/lerna.json @@ -1,4 +1,4 @@ { - "packages": ["src/packages/*", "src/chains/*"], + "packages": ["src/packages/*", "src/chains/*/*"], "version": "independent" } diff --git a/package.json b/package.json index 98fa1d7cdc..f767951002 100644 --- a/package.json +++ b/package.json @@ -48,6 +48,7 @@ "ts-transformer-inline-file": "0.1.1", "ttypescript": "1.5.12", "typescript": "4.1.1-rc", + "validate-npm-package-name": "3.0.0", "yargs": "16.1.0" }, "license": "MIT", diff --git a/scripts/create.ts b/scripts/create.ts index aab83848c2..0743baf1ff 100644 --- a/scripts/create.ts +++ b/scripts/create.ts @@ -5,6 +5,7 @@ import yargs from "yargs"; import prettier from "prettier"; import camelCase from "camelcase"; import npa from "npm-package-arg"; +import npmValiddate from "validate-npm-package-name"; import userName from "git-user-name"; import { join, resolve } from "path"; import { highlight } from "cli-highlight"; @@ -24,32 +25,40 @@ const COLORS = { FgRed: "\x1b[31m" }; -const scopes = getDirectories(join(__dirname, "../src")); +let locations = getDirectories(join(__dirname, "../src")).filter( + d => d !== "chains" +); +const chainLocations = getDirectories(join(__dirname, "../src/chains")).map( + d => `chains/${d}` +); +locations = locations.concat(chainLocations); const argv = yargs .command( - `$0 --location`, + `$0 [options]`, `Create a new package in the given location with the provided name.`, yargs => { return yargs .usage( chalk`{hex("#e4a663").bold Create a new package in the given location with the provided name.}\n\n` + - chalk`{bold Usage}\n {bold $} {dim <}name{dim >} {dim --}location {dim <}${scopes.join( - chalk.dim(" | ") - )}{dim >}` + chalk`{bold Usage}\n {bold $} {dim <}name{dim >} {dim [}options{dim ]}` ) - .positional("", { - describe: ` The name of the new package`, + .positional("name", { + describe: `The name of the new package`, type: "string", demandOption: true }) - .alias("name", "") .option("location", { alias: "l", - default: "packages", describe: `The location for the new package.`, - choices: scopes, + choices: locations, type: "string", demandOption: true + }) + .option("folder", { + alias: "f", + default: null, + describe: `Optional override for the folder name of the package instead of using `, + type: "string" }); } ) @@ -57,8 +66,6 @@ const argv = yargs .version(false) .help(false) .updateStrings({ - "Positionals:": chalk.bold("Options"), - "Options:": ` `, "Not enough non-option arguments: got %s, need at least %s": { one: chalk`{red {bold ERROR! Not enough non-option arguments:}\n got %s, need at least %s}`, other: chalk`{red {bold ERROR! Not enough non-option arguments:}\n got %s, need at least %s}` @@ -78,7 +85,20 @@ process.stdout.write(`${COLORS.Reset}`); (async function () { let name = argv.name; - let location = argv.location; + const location = argv.location; + const folderName = argv.folder as null | string; + console.log(argv); + + const nameValidation = npmValiddate(name); + if (!nameValidation.validForNewPackages) { + throw new Error( + `Name "${name}" is not a valid NPM name:\n${nameValidation.errors}` + ); + } + + // determines how many `../` are needed for package contents + const numDirectoriesAwayFromRoot = 3 + (/\//g.exec(location) || []).length; + const relativePathToRoot = "../".repeat(numDirectoriesAwayFromRoot); try { const workspaceDir = join(__dirname, "../"); @@ -86,6 +106,7 @@ process.stdout.write(`${COLORS.Reset}`); const prettierConfig = await prettier.resolveConfig(process.cwd()); + console.log(npa(name)); name = npa(name).name; const packageName = `@ganache/${name}`; @@ -97,7 +118,9 @@ process.stdout.write(`${COLORS.Reset}`); version, description: "", author: packageAuthor || require("../package.json").author, - homepage: `https://github.com/trufflesuite/ganache-core/tree/develop/src/${location}/${name}#readme`, + homepage: `https://github.com/trufflesuite/ganache-core/tree/develop/src/${location}/${ + folderName || name + }#readme`, license: "MIT", main: "lib/index.js", types: "src/index.ts", @@ -110,7 +133,7 @@ process.stdout.write(`${COLORS.Reset}`); repository: { type: "git", url: "https://github.com/trufflesuite/ganache-core.git", - directory: `src/${location}/${name}` + directory: `src/${location}/${folderName || name}` }, scripts: { tsc: "ttsc", @@ -139,7 +162,7 @@ process.stdout.write(`${COLORS.Reset}`); }; const tsConfig = { - extends: "../../../tsconfig.json", + extends: `${relativePathToRoot}tsconfig.json`, compilerOptions: { outDir: "lib" }, @@ -164,7 +187,7 @@ describe("${packageName}", () => { } `; - const dir = join(workspaceDir, "src", location, name); + const dir = join(workspaceDir, "src", location, folderName || name); const tests = join(dir, "tests"); const src = join(dir, "src"); @@ -263,7 +286,9 @@ typedoc.json ); console.log( - chalk`{green success} {magenta create} New package {bgBlack ${name} } created at ./src/packages/${name}.` + chalk`{green success} {magenta create} New package {bgBlack ${name} } created at ./src/${location}/${ + folderName || name + }.` ); console.log(""); console.log( diff --git a/src/chains/ethereum/.npmignore b/src/chains/ethereum/ethereum/.npmignore similarity index 100% rename from src/chains/ethereum/.npmignore rename to src/chains/ethereum/ethereum/.npmignore diff --git a/src/chains/ethereum/LICENSE b/src/chains/ethereum/ethereum/LICENSE similarity index 100% rename from src/chains/ethereum/LICENSE rename to src/chains/ethereum/ethereum/LICENSE diff --git a/src/chains/ethereum/README.md b/src/chains/ethereum/ethereum/README.md similarity index 100% rename from src/chains/ethereum/README.md rename to src/chains/ethereum/ethereum/README.md diff --git a/src/chains/ethereum/index.ts b/src/chains/ethereum/ethereum/index.ts similarity index 100% rename from src/chains/ethereum/index.ts rename to src/chains/ethereum/ethereum/index.ts diff --git a/src/chains/ethereum/npm-shrinkwrap.json b/src/chains/ethereum/ethereum/npm-shrinkwrap.json similarity index 100% rename from src/chains/ethereum/npm-shrinkwrap.json rename to src/chains/ethereum/ethereum/npm-shrinkwrap.json diff --git a/src/chains/ethereum/package.json b/src/chains/ethereum/ethereum/package.json similarity index 93% rename from src/chains/ethereum/package.json rename to src/chains/ethereum/ethereum/package.json index 990554fcce..6c5a4b5656 100644 --- a/src/chains/ethereum/package.json +++ b/src/chains/ethereum/ethereum/package.json @@ -25,8 +25,8 @@ }, "scripts": { "docs.build": "rm -rf ./lib/docs ./lib/api.json && npm run docs.typedoc", - "docs.typedoc": "typedoc --options ./typedoc.json --readme ./README.md --out ../../../docs/typedoc --json ../../../docs/typedoc/api.json src/api.ts", - "docs.preview": "ws --open --port 3010 --directory ../../../", + "docs.typedoc": "typedoc --options ./typedoc.json --readme ./README.md --out ../../../../docs/typedoc --json ../../../../docs/typedoc/api.json src/api.ts", + "docs.preview": "ws --open --port 3010 --directory ../../../../", "tsc": "ttsc", "test": "nyc --reporter lcov npm run mocha", "mocha": "cross-env TS_NODE_COMPILER=ttypescript TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register 'tests/**/*.test.ts'" @@ -49,6 +49,8 @@ "tooling" ], "dependencies": { + "@ganache/ethereum-options": "^0.1.0", + "@ganache/ethereum-utils": "0.1.0", "@ganache/options": "^0.1.0", "@ganache/promise-queue": "^0.1.0", "@ganache/utils": "^0.1.0", diff --git a/src/chains/ethereum/src/@types/ethereumjs-block/header.d.ts b/src/chains/ethereum/ethereum/src/@types/ethereumjs-block/header.d.ts similarity index 100% rename from src/chains/ethereum/src/@types/ethereumjs-block/header.d.ts rename to src/chains/ethereum/ethereum/src/@types/ethereumjs-block/header.d.ts diff --git a/src/chains/ethereum/src/@types/ethereumjs-block/index.d.ts b/src/chains/ethereum/ethereum/src/@types/ethereumjs-block/index.d.ts similarity index 100% rename from src/chains/ethereum/src/@types/ethereumjs-block/index.d.ts rename to src/chains/ethereum/ethereum/src/@types/ethereumjs-block/index.d.ts diff --git a/src/chains/ethereum/src/@types/ethereumjs-util/index.d.ts b/src/chains/ethereum/ethereum/src/@types/ethereumjs-util/index.d.ts similarity index 100% rename from src/chains/ethereum/src/@types/ethereumjs-util/index.d.ts rename to src/chains/ethereum/ethereum/src/@types/ethereumjs-util/index.d.ts diff --git a/src/chains/ethereum/src/@types/hdkey/index.d.ts b/src/chains/ethereum/ethereum/src/@types/hdkey/index.d.ts similarity index 100% rename from src/chains/ethereum/src/@types/hdkey/index.d.ts rename to src/chains/ethereum/ethereum/src/@types/hdkey/index.d.ts diff --git a/src/chains/ethereum/src/@types/levelup/index.d.ts b/src/chains/ethereum/ethereum/src/@types/levelup/index.d.ts similarity index 100% rename from src/chains/ethereum/src/@types/levelup/index.d.ts rename to src/chains/ethereum/ethereum/src/@types/levelup/index.d.ts diff --git a/src/chains/ethereum/src/@types/merkle-patricia-tree/baseTrie.ts b/src/chains/ethereum/ethereum/src/@types/merkle-patricia-tree/baseTrie.ts similarity index 100% rename from src/chains/ethereum/src/@types/merkle-patricia-tree/baseTrie.ts rename to src/chains/ethereum/ethereum/src/@types/merkle-patricia-tree/baseTrie.ts diff --git a/src/chains/ethereum/src/@types/merkle-patricia-tree/index.d.ts b/src/chains/ethereum/ethereum/src/@types/merkle-patricia-tree/index.d.ts similarity index 100% rename from src/chains/ethereum/src/@types/merkle-patricia-tree/index.d.ts rename to src/chains/ethereum/ethereum/src/@types/merkle-patricia-tree/index.d.ts diff --git a/src/chains/ethereum/src/@types/merkle-patricia-tree/readStream.ts b/src/chains/ethereum/ethereum/src/@types/merkle-patricia-tree/readStream.ts similarity index 100% rename from src/chains/ethereum/src/@types/merkle-patricia-tree/readStream.ts rename to src/chains/ethereum/ethereum/src/@types/merkle-patricia-tree/readStream.ts diff --git a/src/chains/ethereum/src/@types/merkle-patricia-tree/trieNode.ts b/src/chains/ethereum/ethereum/src/@types/merkle-patricia-tree/trieNode.ts similarity index 100% rename from src/chains/ethereum/src/@types/merkle-patricia-tree/trieNode.ts rename to src/chains/ethereum/ethereum/src/@types/merkle-patricia-tree/trieNode.ts diff --git a/src/chains/ethereum/src/api.ts b/src/chains/ethereum/ethereum/src/api.ts similarity index 98% rename from src/chains/ethereum/src/api.ts rename to src/chains/ethereum/ethereum/src/api.ts index 4235a7c156..8d34e08a3c 100644 --- a/src/chains/ethereum/src/api.ts +++ b/src/chains/ethereum/ethereum/src/api.ts @@ -1,5 +1,25 @@ //#region Imports -import { RuntimeBlock, Block } from "./things/runtime-block"; +import { + RuntimeBlock, + Block, + Tag, + Address, + Transaction, + BlockLogs, + Account, + VM_EXCEPTION, + VM_EXCEPTIONS, + CodedError, + ErrorCodes, + WhisperPostObject, + BaseFilterArgs, + Filter, + FilterArgs, + FilterTypes, + RangeFilterArgs, + SubscriptionId, + SubscriptionName +} from "@ganache/ethereum-utils"; import { toRpcSig, KECCAK256_NULL, @@ -7,44 +27,27 @@ import { hashPersonalMessage } from "ethereumjs-util"; import { TypedData as NotTypedData, signTypedData_v4 } from "eth-sig-util"; -import { EthereumInternalOptions } from "./options"; -import { types, Data, Quantity } from "@ganache/utils"; +import { EthereumInternalOptions } from "@ganache/ethereum-options"; +import { types, Data, Quantity, PromiEvent, utils } from "@ganache/utils"; import Blockchain, { TransactionTraceOptions } from "./blockchain"; -import Tag from "./things/tags"; -import { VM_EXCEPTION, VM_EXCEPTIONS } from "./errors/errors"; -import Address from "./things/address"; -import Transaction from "./things/transaction"; import Wallet from "./wallet"; import { decode as rlpDecode } from "rlp"; import { $INLINE_JSON } from "ts-transformer-inline-file"; -import { PromiEvent, utils } from "@ganache/utils"; import Emittery from "emittery"; import Common from "ethereumjs-common"; -import BlockLogs from "./things/blocklogs"; import EthereumAccount from "ethereumjs-account"; import estimateGas from "./helpers/gas-estimator"; -import CodedError, { ErrorCodes } from "./errors/coded-error"; -import { WhisperPostObject } from "./types/shh"; -import { - BaseFilterArgs, - Filter, - FilterArgs, - FilterTypes, - RangeFilterArgs -} from "./types/filters"; import { assertArgLength } from "./helpers/assert-arg-length"; -import Account from "./things/account"; -import { SubscriptionId, SubscriptionName } from "./types/subscriptions"; import { parseFilter, parseFilterDetails, parseFilterRange } from "./helpers/filter-parsing"; -import { Hardfork } from "./options/chain-options"; +import { Hardfork } from "@ganache/ethereum-options"; // Read in the current ganache version from core's package.json -const { version } = $INLINE_JSON("../../../packages/ganache/package.json"); +const { version } = $INLINE_JSON("../../../../packages/ganache/package.json"); const { keccak } = utils; //#endregion diff --git a/src/chains/ethereum/src/blockchain.ts b/src/chains/ethereum/ethereum/src/blockchain.ts similarity index 98% rename from src/chains/ethereum/src/blockchain.ts rename to src/chains/ethereum/ethereum/src/blockchain.ts index d8c181fea6..9ba7c22bf3 100644 --- a/src/chains/ethereum/src/blockchain.ts +++ b/src/chains/ethereum/ethereum/src/blockchain.ts @@ -1,33 +1,37 @@ import { EOL } from "os"; -import RuntimeError, { RETURN_TYPES } from "./errors/runtime-error"; import Miner from "./miner/miner"; import Database from "./database"; import Emittery from "emittery"; import BlockManager from "./data-managers/block-manager"; -import BlockLogs from "./things/blocklogs"; +import { + BlockLogs, + Account, + Transaction, + TransactionReceipt, + Address, + RuntimeBlock, + Block, + ITraceData, + TraceDataFactory, + TraceStorageMap, + RuntimeError, + RETURN_TYPES, + Snapshots +} from "@ganache/ethereum-utils"; import TransactionManager from "./data-managers/transaction-manager"; import SecureTrie from "merkle-patricia-tree/secure"; import { BN, KECCAK256_RLP } from "ethereumjs-util"; -import Account from "./things/account"; import { promisify } from "util"; -import { Quantity, Data } from "@ganache/utils"; +import { Quantity, Data, utils } from "@ganache/utils"; import AccountManager from "./data-managers/account-manager"; -import { utils } from "@ganache/utils"; -import Transaction from "./things/transaction"; import Manager from "./data-managers/manager"; -import TransactionReceipt from "./things/transaction-receipt"; import { encode as rlpEncode } from "rlp"; import Common from "ethereumjs-common"; import VM from "ethereumjs-vm"; -import Address from "./things/address"; import BlockLogManager from "./data-managers/blocklog-manager"; import { EVMResult } from "ethereumjs-vm/dist/evm/evm"; import { VmError, ERROR } from "ethereumjs-vm/dist/exceptions"; -import { EthereumInternalOptions } from "./options"; -import { Snapshots } from "./types/snapshots"; -import { RuntimeBlock, Block } from "./things/runtime-block"; -import { ITraceData, TraceDataFactory } from "./things/trace-data"; -import TraceStorageMap from "./things/trace-storage-map"; +import { EthereumInternalOptions } from "@ganache/ethereum-options"; const { BUFFER_EMPTY, diff --git a/src/chains/ethereum/src/connector.ts b/src/chains/ethereum/ethereum/src/connector.ts similarity index 95% rename from src/chains/ethereum/src/connector.ts rename to src/chains/ethereum/ethereum/src/connector.ts index 49641b1986..8bd6d99a9a 100644 --- a/src/chains/ethereum/src/connector.ts +++ b/src/chains/ethereum/ethereum/src/connector.ts @@ -3,8 +3,11 @@ import EthereumApi from "./api"; import { JsonRpcTypes, types, utils } from "@ganache/utils"; import EthereumProvider from "./provider"; import { RecognizedString, WebSocket, HttpRequest } from "uWebSockets.js"; -import CodedError, { ErrorCodes } from "./errors/coded-error"; -import { EthereumProviderOptions, EthereumLegacyOptions } from "./options"; +import { CodedError, ErrorCodes } from "@ganache/ethereum-utils"; +import { + EthereumProviderOptions, + EthereumLegacyOptions +} from "@ganache/ethereum-options"; export type ProviderOptions = EthereumProviderOptions | EthereumLegacyOptions; export type Provider = EthereumProvider; diff --git a/src/chains/ethereum/src/data-managers/account-manager.ts b/src/chains/ethereum/ethereum/src/data-managers/account-manager.ts similarity index 94% rename from src/chains/ethereum/src/data-managers/account-manager.ts rename to src/chains/ethereum/ethereum/src/data-managers/account-manager.ts index dad21409e4..e1b4462c2a 100644 --- a/src/chains/ethereum/src/data-managers/account-manager.ts +++ b/src/chains/ethereum/ethereum/src/data-managers/account-manager.ts @@ -1,8 +1,6 @@ -import Account from "../things/account"; -import Address from "../things/address"; +import { Account, Address, Tag } from "@ganache/ethereum-utils"; import Trie from "merkle-patricia-tree/baseTrie"; import Blockchain from "../blockchain"; -import Tag from "../things/tags"; import { LevelUp } from "levelup"; import { rlp } from "ethereumjs-util"; import { utils, Quantity } from "@ganache/utils"; diff --git a/src/chains/ethereum/src/data-managers/block-manager.ts b/src/chains/ethereum/ethereum/src/data-managers/block-manager.ts similarity index 98% rename from src/chains/ethereum/src/data-managers/block-manager.ts rename to src/chains/ethereum/ethereum/src/data-managers/block-manager.ts index c05bf9505b..b0438df49b 100644 --- a/src/chains/ethereum/src/data-managers/block-manager.ts +++ b/src/chains/ethereum/ethereum/src/data-managers/block-manager.ts @@ -1,9 +1,8 @@ import Manager from "./manager"; -import Tag from "../things/tags"; +import { Tag, Block } from "@ganache/ethereum-utils"; import { LevelUp } from "levelup"; import { Quantity, Data } from "@ganache/utils"; import Common from "ethereumjs-common"; -import { Block } from "../things/runtime-block"; const NOTFOUND = 404; diff --git a/src/chains/ethereum/src/data-managers/blocklog-manager.ts b/src/chains/ethereum/ethereum/src/data-managers/blocklog-manager.ts similarity index 69% rename from src/chains/ethereum/src/data-managers/blocklog-manager.ts rename to src/chains/ethereum/ethereum/src/data-managers/blocklog-manager.ts index 069151ba03..5462344c79 100644 --- a/src/chains/ethereum/src/data-managers/blocklog-manager.ts +++ b/src/chains/ethereum/ethereum/src/data-managers/blocklog-manager.ts @@ -1,11 +1,11 @@ -import BlockLog from "../things/blocklogs"; +import { BlockLogs } from "@ganache/ethereum-utils"; import { LevelUp } from "levelup"; import Manager from "./manager"; import { Quantity } from "@ganache/utils"; -export default class BlockLogManager extends Manager { +export default class BlockLogManager extends Manager { constructor(base: LevelUp) { - super(base, BlockLog); + super(base, BlockLogs); } async get(key: string | Buffer) { diff --git a/src/chains/ethereum/src/data-managers/manager.ts b/src/chains/ethereum/ethereum/src/data-managers/manager.ts similarity index 95% rename from src/chains/ethereum/src/data-managers/manager.ts rename to src/chains/ethereum/ethereum/src/data-managers/manager.ts index 49c5930334..d1808997bf 100644 --- a/src/chains/ethereum/src/data-managers/manager.ts +++ b/src/chains/ethereum/ethereum/src/data-managers/manager.ts @@ -1,6 +1,6 @@ import { LevelUp } from "levelup"; import { Data } from "@ganache/utils"; -import Tag from "../things/tags"; +import { Tag } from "@ganache/ethereum-utils"; const NOTFOUND = 404; export type Instantiable = { new (...args: any[]): T }; diff --git a/src/chains/ethereum/src/data-managers/transaction-manager.ts b/src/chains/ethereum/ethereum/src/data-managers/transaction-manager.ts similarity index 96% rename from src/chains/ethereum/src/data-managers/transaction-manager.ts rename to src/chains/ethereum/ethereum/src/data-managers/transaction-manager.ts index 8cd74d109d..30778f874d 100644 --- a/src/chains/ethereum/src/data-managers/transaction-manager.ts +++ b/src/chains/ethereum/ethereum/src/data-managers/transaction-manager.ts @@ -1,7 +1,7 @@ -import Transaction from "../things/transaction"; +import { Transaction } from "@ganache/ethereum-utils"; import Manager from "./manager"; import TransactionPool from "../transaction-pool"; -import { EthereumInternalOptions } from "../options"; +import { EthereumInternalOptions } from "@ganache/ethereum-options"; import { LevelUp } from "levelup"; import Blockchain from "../blockchain"; import PromiseQueue from "@ganache/promise-queue"; diff --git a/src/chains/ethereum/src/database.ts b/src/chains/ethereum/ethereum/src/database.ts similarity index 98% rename from src/chains/ethereum/src/database.ts rename to src/chains/ethereum/ethereum/src/database.ts index b20b39026b..fa5da1d176 100644 --- a/src/chains/ethereum/src/database.ts +++ b/src/chains/ethereum/ethereum/src/database.ts @@ -3,7 +3,7 @@ import Emittery from "emittery"; import { dir, setGracefulCleanup } from "tmp-promise"; import levelup, { LevelUp } from "levelup"; import Blockchain from "./blockchain"; -import { EthereumInternalOptions } from "./options"; +import { EthereumInternalOptions } from "@ganache/ethereum-options"; const leveldown = require("leveldown"); const sub = require("subleveldown"); const encode = require("encoding-down"); diff --git a/src/chains/ethereum/src/helpers/assert-arg-length.ts b/src/chains/ethereum/ethereum/src/helpers/assert-arg-length.ts similarity index 100% rename from src/chains/ethereum/src/helpers/assert-arg-length.ts rename to src/chains/ethereum/ethereum/src/helpers/assert-arg-length.ts diff --git a/src/chains/ethereum/src/helpers/filter-parsing.ts b/src/chains/ethereum/ethereum/src/helpers/filter-parsing.ts similarity index 93% rename from src/chains/ethereum/src/helpers/filter-parsing.ts rename to src/chains/ethereum/ethereum/src/helpers/filter-parsing.ts index e9f2f82d15..bc504c9c42 100644 --- a/src/chains/ethereum/src/helpers/filter-parsing.ts +++ b/src/chains/ethereum/ethereum/src/helpers/filter-parsing.ts @@ -1,7 +1,6 @@ import { Quantity } from "@ganache/utils"; import Blockchain from "../blockchain"; -import Address from "../things/address"; -import { FilterArgs, RangeFilterArgs } from "../types/filters"; +import { Address, FilterArgs, RangeFilterArgs } from "@ganache/ethereum-utils"; export function parseFilterDetails( filter: Pick diff --git a/src/chains/ethereum/src/helpers/gas-estimator.ts b/src/chains/ethereum/ethereum/src/helpers/gas-estimator.ts similarity index 99% rename from src/chains/ethereum/src/helpers/gas-estimator.ts rename to src/chains/ethereum/ethereum/src/helpers/gas-estimator.ts index 9372cc2bb9..c7d3a147b0 100644 --- a/src/chains/ethereum/src/helpers/gas-estimator.ts +++ b/src/chains/ethereum/ethereum/src/helpers/gas-estimator.ts @@ -1,6 +1,6 @@ import { Quantity } from "@ganache/utils"; import { BN } from "ethereumjs-util"; -import RuntimeError, { RETURN_TYPES } from "../errors/runtime-error"; +import { RuntimeError, RETURN_TYPES } from "@ganache/ethereum-utils"; const bn = (val = 0) => new (BN as any)(val); const STIPEND = bn(2300); diff --git a/src/chains/ethereum/src/miner/miner.ts b/src/chains/ethereum/ethereum/src/miner/miner.ts similarity index 97% rename from src/chains/ethereum/src/miner/miner.ts rename to src/chains/ethereum/ethereum/src/miner/miner.ts index 26f8526f70..648cff7545 100644 --- a/src/chains/ethereum/src/miner/miner.ts +++ b/src/chains/ethereum/ethereum/src/miner/miner.ts @@ -1,16 +1,20 @@ -import params from "../things/params"; -import Transaction from "../things/transaction"; +import { + params, + Transaction, + Block, + RuntimeBlock, + RuntimeError, + RETURN_TYPES, + Executables +} from "@ganache/ethereum-utils"; import { utils, Quantity, Data } from "@ganache/utils"; import { promisify } from "util"; import Trie from "merkle-patricia-tree"; import Emittery from "emittery"; import VM from "ethereumjs-vm"; import { encode as rlpEncode } from "rlp"; -import { EthereumInternalOptions } from "../options"; -import RuntimeError, { RETURN_TYPES } from "../errors/runtime-error"; -import { Executables } from "../types/executables"; +import { EthereumInternalOptions } from "@ganache/ethereum-options"; import replaceFromHeap from "./replace-from-heap"; -import { Block, RuntimeBlock } from "../things/runtime-block"; const { BUFFER_EMPTY, BUFFER_256_ZERO } = utils; export type BlockData = { diff --git a/src/chains/ethereum/src/miner/replace-from-heap.ts b/src/chains/ethereum/ethereum/src/miner/replace-from-heap.ts similarity index 91% rename from src/chains/ethereum/src/miner/replace-from-heap.ts rename to src/chains/ethereum/ethereum/src/miner/replace-from-heap.ts index fe93e2f0c5..5247d86744 100644 --- a/src/chains/ethereum/src/miner/replace-from-heap.ts +++ b/src/chains/ethereum/ethereum/src/miner/replace-from-heap.ts @@ -1,5 +1,5 @@ import { utils } from "@ganache/utils"; -import Transaction from "../things/transaction"; +import { Transaction } from "@ganache/ethereum-utils"; export default function replaceFromHeap( priced: utils.Heap, diff --git a/src/chains/ethereum/src/provider.ts b/src/chains/ethereum/ethereum/src/provider.ts similarity index 99% rename from src/chains/ethereum/src/provider.ts rename to src/chains/ethereum/ethereum/src/provider.ts index bf93ec242c..559bd62c3e 100644 --- a/src/chains/ethereum/src/provider.ts +++ b/src/chains/ethereum/ethereum/src/provider.ts @@ -6,7 +6,7 @@ import { EthereumInternalOptions, EthereumOptionsConfig, EthereumLegacyOptions -} from "./options"; +} from "@ganache/ethereum-options"; import cloneDeep from "lodash.clonedeep"; import { PromiEvent, types, utils } from "@ganache/utils"; import Wallet from "./wallet"; diff --git a/src/chains/ethereum/src/transaction-pool.ts b/src/chains/ethereum/ethereum/src/transaction-pool.ts similarity index 97% rename from src/chains/ethereum/src/transaction-pool.ts rename to src/chains/ethereum/ethereum/src/transaction-pool.ts index e34a4bb2fa..1143e372ef 100644 --- a/src/chains/ethereum/src/transaction-pool.ts +++ b/src/chains/ethereum/ethereum/src/transaction-pool.ts @@ -1,16 +1,17 @@ import Emittery from "emittery"; import Blockchain from "./blockchain"; import { utils } from "@ganache/utils"; -import Transaction from "./things/transaction"; import { Data, Quantity } from "@ganache/utils"; import { + Transaction, GAS_LIMIT, INTRINSIC_GAS_TOO_LOW, - NONCE_TOO_LOW -} from "./errors/errors"; -import CodedError, { ErrorCodes } from "./errors/coded-error"; -import { EthereumInternalOptions } from "./options"; -import { Executables } from "./types/executables"; + NONCE_TOO_LOW, + CodedError, + ErrorCodes, + Executables +} from "@ganache/ethereum-utils"; +import { EthereumInternalOptions } from "@ganache/ethereum-options"; function byNonce(values: Transaction[], a: number, b: number) { return ( diff --git a/src/chains/ethereum/src/wallet.ts b/src/chains/ethereum/ethereum/src/wallet.ts similarity index 98% rename from src/chains/ethereum/src/wallet.ts rename to src/chains/ethereum/ethereum/src/wallet.ts index 64d5f1106d..edb58c5c67 100644 --- a/src/chains/ethereum/src/wallet.ts +++ b/src/chains/ethereum/ethereum/src/wallet.ts @@ -1,8 +1,6 @@ -import { utils } from "@ganache/utils"; -import { Data, Quantity } from "@ganache/utils"; -import Address from "./things/address"; +import { Address, Account } from "@ganache/ethereum-utils"; +import { Data, Quantity, utils } from "@ganache/utils"; import { privateToAddress } from "ethereumjs-util"; -import Account from "./things/account"; import secp256k1 from "secp256k1"; import { mnemonicToSeedSync } from "bip39"; import HDKey from "hdkey"; @@ -10,7 +8,7 @@ import { alea as rng } from "seedrandom"; import crypto from "crypto"; import createKeccakHash from "keccak"; import { writeFileSync } from "fs"; -import { EthereumInternalOptions } from "./options"; +import { EthereumInternalOptions } from "@ganache/ethereum-options"; //#region Constants const SCRYPT_PARAMS = { diff --git a/src/chains/ethereum/tests/@types/solc/index.d.ts b/src/chains/ethereum/ethereum/tests/@types/solc/index.d.ts similarity index 100% rename from src/chains/ethereum/tests/@types/solc/index.d.ts rename to src/chains/ethereum/ethereum/tests/@types/solc/index.d.ts diff --git a/src/chains/ethereum/tests/api/bzz/bzz.test.ts b/src/chains/ethereum/ethereum/tests/api/bzz/bzz.test.ts similarity index 100% rename from src/chains/ethereum/tests/api/bzz/bzz.test.ts rename to src/chains/ethereum/ethereum/tests/api/bzz/bzz.test.ts diff --git a/src/chains/ethereum/tests/api/db/db.test.ts b/src/chains/ethereum/ethereum/tests/api/db/db.test.ts similarity index 100% rename from src/chains/ethereum/tests/api/db/db.test.ts rename to src/chains/ethereum/ethereum/tests/api/db/db.test.ts diff --git a/src/chains/ethereum/tests/api/debug/debug.test.ts b/src/chains/ethereum/ethereum/tests/api/debug/debug.test.ts similarity index 97% rename from src/chains/ethereum/tests/api/debug/debug.test.ts rename to src/chains/ethereum/ethereum/tests/api/debug/debug.test.ts index ed7d639cc3..221d5a8cef 100644 --- a/src/chains/ethereum/tests/api/debug/debug.test.ts +++ b/src/chains/ethereum/ethereum/tests/api/debug/debug.test.ts @@ -5,12 +5,14 @@ import EthereumProvider from "../../../src/provider"; import path from "path"; import { Quantity, Data } from "@ganache/utils"; import Blockchain from "../../../src/blockchain"; -import Account from "../../../src/things/account"; -import Address from "../../../src/things/address"; +import { + Account, + Address, + Transaction, + TraceStorageMap +} from "@ganache/ethereum-utils"; import Common from "ethereumjs-common"; -import Transaction from "../../../src/things/transaction"; -import { EthereumOptionsConfig } from "../../../src/options/index"; -import TraceStorageMap from "../../../src/things/trace-storage-map"; +import { EthereumOptionsConfig } from "@ganache/ethereum-options"; describe("api", () => { describe("debug", () => { diff --git a/src/chains/ethereum/tests/api/eth/contracts/GetCode.sol b/src/chains/ethereum/ethereum/tests/api/eth/contracts/GetCode.sol similarity index 100% rename from src/chains/ethereum/tests/api/eth/contracts/GetCode.sol rename to src/chains/ethereum/ethereum/tests/api/eth/contracts/GetCode.sol diff --git a/src/chains/ethereum/tests/api/eth/contracts/GetStorageAt.sol b/src/chains/ethereum/ethereum/tests/api/eth/contracts/GetStorageAt.sol similarity index 100% rename from src/chains/ethereum/tests/api/eth/contracts/GetStorageAt.sol rename to src/chains/ethereum/ethereum/tests/api/eth/contracts/GetStorageAt.sol diff --git a/src/chains/ethereum/tests/api/eth/contracts/Logs.sol b/src/chains/ethereum/ethereum/tests/api/eth/contracts/Logs.sol similarity index 100% rename from src/chains/ethereum/tests/api/eth/contracts/Logs.sol rename to src/chains/ethereum/ethereum/tests/api/eth/contracts/Logs.sol diff --git a/src/chains/ethereum/tests/api/eth/contracts/NoOp.sol b/src/chains/ethereum/ethereum/tests/api/eth/contracts/NoOp.sol similarity index 100% rename from src/chains/ethereum/tests/api/eth/contracts/NoOp.sol rename to src/chains/ethereum/ethereum/tests/api/eth/contracts/NoOp.sol diff --git a/src/chains/ethereum/tests/api/eth/contracts/Reverts.sol b/src/chains/ethereum/ethereum/tests/api/eth/contracts/Reverts.sol similarity index 100% rename from src/chains/ethereum/tests/api/eth/contracts/Reverts.sol rename to src/chains/ethereum/ethereum/tests/api/eth/contracts/Reverts.sol diff --git a/src/chains/ethereum/tests/api/eth/eth.test.ts b/src/chains/ethereum/ethereum/tests/api/eth/eth.test.ts similarity index 100% rename from src/chains/ethereum/tests/api/eth/eth.test.ts rename to src/chains/ethereum/ethereum/tests/api/eth/eth.test.ts diff --git a/src/chains/ethereum/tests/api/eth/getCode.test.ts b/src/chains/ethereum/ethereum/tests/api/eth/getCode.test.ts similarity index 100% rename from src/chains/ethereum/tests/api/eth/getCode.test.ts rename to src/chains/ethereum/ethereum/tests/api/eth/getCode.test.ts diff --git a/src/chains/ethereum/tests/api/eth/getStorageAt.test.ts b/src/chains/ethereum/ethereum/tests/api/eth/getStorageAt.test.ts similarity index 100% rename from src/chains/ethereum/tests/api/eth/getStorageAt.test.ts rename to src/chains/ethereum/ethereum/tests/api/eth/getStorageAt.test.ts diff --git a/src/chains/ethereum/tests/api/eth/legacyInstamining.test.ts b/src/chains/ethereum/ethereum/tests/api/eth/legacyInstamining.test.ts similarity index 100% rename from src/chains/ethereum/tests/api/eth/legacyInstamining.test.ts rename to src/chains/ethereum/ethereum/tests/api/eth/legacyInstamining.test.ts diff --git a/src/chains/ethereum/tests/api/eth/logs.test.ts b/src/chains/ethereum/ethereum/tests/api/eth/logs.test.ts similarity index 100% rename from src/chains/ethereum/tests/api/eth/logs.test.ts rename to src/chains/ethereum/ethereum/tests/api/eth/logs.test.ts diff --git a/src/chains/ethereum/tests/api/eth/sendRawTransaction.test.ts b/src/chains/ethereum/ethereum/tests/api/eth/sendRawTransaction.test.ts similarity index 100% rename from src/chains/ethereum/tests/api/eth/sendRawTransaction.test.ts rename to src/chains/ethereum/ethereum/tests/api/eth/sendRawTransaction.test.ts diff --git a/src/chains/ethereum/tests/api/eth/sendTransaction.test.ts b/src/chains/ethereum/ethereum/tests/api/eth/sendTransaction.test.ts similarity index 98% rename from src/chains/ethereum/tests/api/eth/sendTransaction.test.ts rename to src/chains/ethereum/ethereum/tests/api/eth/sendTransaction.test.ts index 92971f87e8..f95bbe2d4f 100644 --- a/src/chains/ethereum/tests/api/eth/sendTransaction.test.ts +++ b/src/chains/ethereum/ethereum/tests/api/eth/sendTransaction.test.ts @@ -3,7 +3,7 @@ import getProvider from "../../helpers/getProvider"; import compile from "../../helpers/compile"; import { join } from "path"; import EthereumProvider from "../../../src/provider"; -import { EthereumProviderOptions } from "../../../src/options"; +import { EthereumProviderOptions } from "@ganache/ethereum-options"; describe("api", () => { describe("eth", () => { diff --git a/src/chains/ethereum/tests/api/eth/sign.test.ts b/src/chains/ethereum/ethereum/tests/api/eth/sign.test.ts similarity index 100% rename from src/chains/ethereum/tests/api/eth/sign.test.ts rename to src/chains/ethereum/ethereum/tests/api/eth/sign.test.ts diff --git a/src/chains/ethereum/tests/api/eth/signTypedData.test.ts b/src/chains/ethereum/ethereum/tests/api/eth/signTypedData.test.ts similarity index 100% rename from src/chains/ethereum/tests/api/eth/signTypedData.test.ts rename to src/chains/ethereum/ethereum/tests/api/eth/signTypedData.test.ts diff --git a/src/chains/ethereum/tests/api/eth/subscribe.test.ts b/src/chains/ethereum/ethereum/tests/api/eth/subscribe.test.ts similarity index 100% rename from src/chains/ethereum/tests/api/eth/subscribe.test.ts rename to src/chains/ethereum/ethereum/tests/api/eth/subscribe.test.ts diff --git a/src/chains/ethereum/tests/api/eth/uncles.test.ts b/src/chains/ethereum/ethereum/tests/api/eth/uncles.test.ts similarity index 100% rename from src/chains/ethereum/tests/api/eth/uncles.test.ts rename to src/chains/ethereum/ethereum/tests/api/eth/uncles.test.ts diff --git a/src/chains/ethereum/tests/api/evm/evm.test.ts b/src/chains/ethereum/ethereum/tests/api/evm/evm.test.ts similarity index 100% rename from src/chains/ethereum/tests/api/evm/evm.test.ts rename to src/chains/ethereum/ethereum/tests/api/evm/evm.test.ts diff --git a/src/chains/ethereum/tests/api/evm/snapshot.sol b/src/chains/ethereum/ethereum/tests/api/evm/snapshot.sol similarity index 100% rename from src/chains/ethereum/tests/api/evm/snapshot.sol rename to src/chains/ethereum/ethereum/tests/api/evm/snapshot.sol diff --git a/src/chains/ethereum/tests/api/evm/snapshot.test.ts b/src/chains/ethereum/ethereum/tests/api/evm/snapshot.test.ts similarity index 100% rename from src/chains/ethereum/tests/api/evm/snapshot.test.ts rename to src/chains/ethereum/ethereum/tests/api/evm/snapshot.test.ts diff --git a/src/chains/ethereum/tests/api/miner/miner.test.ts b/src/chains/ethereum/ethereum/tests/api/miner/miner.test.ts similarity index 100% rename from src/chains/ethereum/tests/api/miner/miner.test.ts rename to src/chains/ethereum/ethereum/tests/api/miner/miner.test.ts diff --git a/src/chains/ethereum/tests/api/net/net.test.ts b/src/chains/ethereum/ethereum/tests/api/net/net.test.ts similarity index 100% rename from src/chains/ethereum/tests/api/net/net.test.ts rename to src/chains/ethereum/ethereum/tests/api/net/net.test.ts diff --git a/src/chains/ethereum/tests/api/personal/personal.test.ts b/src/chains/ethereum/ethereum/tests/api/personal/personal.test.ts similarity index 100% rename from src/chains/ethereum/tests/api/personal/personal.test.ts rename to src/chains/ethereum/ethereum/tests/api/personal/personal.test.ts diff --git a/src/chains/ethereum/tests/api/rpc/modules.test.ts b/src/chains/ethereum/ethereum/tests/api/rpc/modules.test.ts similarity index 100% rename from src/chains/ethereum/tests/api/rpc/modules.test.ts rename to src/chains/ethereum/ethereum/tests/api/rpc/modules.test.ts diff --git a/src/chains/ethereum/tests/api/shh/shh.test.ts b/src/chains/ethereum/ethereum/tests/api/shh/shh.test.ts similarity index 100% rename from src/chains/ethereum/tests/api/shh/shh.test.ts rename to src/chains/ethereum/ethereum/tests/api/shh/shh.test.ts diff --git a/src/chains/ethereum/tests/api/web3/web3.test.ts b/src/chains/ethereum/ethereum/tests/api/web3/web3.test.ts similarity index 91% rename from src/chains/ethereum/tests/api/web3/web3.test.ts rename to src/chains/ethereum/ethereum/tests/api/web3/web3.test.ts index a87f8949dd..8ac8da5260 100644 --- a/src/chains/ethereum/tests/api/web3/web3.test.ts +++ b/src/chains/ethereum/ethereum/tests/api/web3/web3.test.ts @@ -1,7 +1,7 @@ import getProvider from "../../helpers/getProvider"; import assert from "assert"; import EthereumProvider from "../../../src/provider"; -const { version } = require("../../../../../packages/ganache/package.json"); +const { version } = require("../../../../../../packages/ganache/package.json"); describe("api", () => { describe("web3", () => { diff --git a/src/chains/ethereum/tests/contracts/Debug.sol b/src/chains/ethereum/ethereum/tests/contracts/Debug.sol similarity index 100% rename from src/chains/ethereum/tests/contracts/Debug.sol rename to src/chains/ethereum/ethereum/tests/contracts/Debug.sol diff --git a/src/chains/ethereum/tests/contracts/HelloWorld.sol b/src/chains/ethereum/ethereum/tests/contracts/HelloWorld.sol similarity index 100% rename from src/chains/ethereum/tests/contracts/HelloWorld.sol rename to src/chains/ethereum/ethereum/tests/contracts/HelloWorld.sol diff --git a/src/chains/ethereum/tests/helpers/compile.ts b/src/chains/ethereum/ethereum/tests/helpers/compile.ts similarity index 100% rename from src/chains/ethereum/tests/helpers/compile.ts rename to src/chains/ethereum/ethereum/tests/helpers/compile.ts diff --git a/src/chains/ethereum/tests/helpers/getProvider.ts b/src/chains/ethereum/ethereum/tests/helpers/getProvider.ts similarity index 94% rename from src/chains/ethereum/tests/helpers/getProvider.ts rename to src/chains/ethereum/ethereum/tests/helpers/getProvider.ts index 1814c4f8a3..486311c0a1 100644 --- a/src/chains/ethereum/tests/helpers/getProvider.ts +++ b/src/chains/ethereum/ethereum/tests/helpers/getProvider.ts @@ -1,6 +1,6 @@ import { utils } from "@ganache/utils"; import EthereumProvider from "../../src/provider"; -import { EthereumProviderOptions } from "../../src/options"; +import { EthereumProviderOptions } from "@ganache/ethereum-options"; const { RequestCoordinator, Executor } = utils; const mnemonic = diff --git a/src/chains/ethereum/tests/provider.test.ts b/src/chains/ethereum/ethereum/tests/provider.test.ts similarity index 100% rename from src/chains/ethereum/tests/provider.test.ts rename to src/chains/ethereum/ethereum/tests/provider.test.ts diff --git a/src/chains/ethereum/tests/temp-tests.test.ts b/src/chains/ethereum/ethereum/tests/temp-tests.test.ts similarity index 100% rename from src/chains/ethereum/tests/temp-tests.test.ts rename to src/chains/ethereum/ethereum/tests/temp-tests.test.ts diff --git a/src/chains/ethereum/tests/tsconfig.json b/src/chains/ethereum/ethereum/tests/tsconfig.json similarity index 100% rename from src/chains/ethereum/tests/tsconfig.json rename to src/chains/ethereum/ethereum/tests/tsconfig.json diff --git a/src/chains/ethereum/tsconfig.json b/src/chains/ethereum/ethereum/tsconfig.json similarity index 76% rename from src/chains/ethereum/tsconfig.json rename to src/chains/ethereum/ethereum/tsconfig.json index 0c41d652c6..c6014edc08 100644 --- a/src/chains/ethereum/tsconfig.json +++ b/src/chains/ethereum/ethereum/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.json", + "extends": "../../../../tsconfig.json", "compilerOptions": { "outDir": "lib" }, diff --git a/src/chains/ethereum/typedoc.json b/src/chains/ethereum/ethereum/typedoc.json similarity index 75% rename from src/chains/ethereum/typedoc.json rename to src/chains/ethereum/ethereum/typedoc.json index 2b106fd177..5d04fb7675 100644 --- a/src/chains/ethereum/typedoc.json +++ b/src/chains/ethereum/ethereum/typedoc.json @@ -2,7 +2,7 @@ "name": "@ganache/ethereum", "mode": "modules", "module": "commonjs", - "theme": "../../../node_modules/@trufflesuite/typedoc-default-themes/bin/default/", + "theme": "../../../../node_modules/@trufflesuite/typedoc-default-themes/bin/default/", "includeDeclarations": false, "ignoreCompilerErrors": true, "preserveConstEnums": true, diff --git a/src/chains/tezos/.npmignore b/src/chains/ethereum/options/.npmignore similarity index 100% rename from src/chains/tezos/.npmignore rename to src/chains/ethereum/options/.npmignore diff --git a/src/chains/tezos/LICENSE b/src/chains/ethereum/options/LICENSE similarity index 100% rename from src/chains/tezos/LICENSE rename to src/chains/ethereum/options/LICENSE diff --git a/src/chains/ethereum/options/README.md b/src/chains/ethereum/options/README.md new file mode 100644 index 0000000000..c8d2b4dd52 --- /dev/null +++ b/src/chains/ethereum/options/README.md @@ -0,0 +1,3 @@ +# `@ganache/ethereum-options` + +> TODO: description diff --git a/src/chains/ethereum/options/index.ts b/src/chains/ethereum/options/index.ts new file mode 100644 index 0000000000..d7b3e988ce --- /dev/null +++ b/src/chains/ethereum/options/index.ts @@ -0,0 +1,11 @@ +/*! + * @ganache/ethereum-options + * + * @copyright Truffle Blockchain Group + * @author Mike Seese + * @license MIT + */ + +export default { + // TODO +}; diff --git a/src/chains/ethereum/options/npm-shrinkwrap.json b/src/chains/ethereum/options/npm-shrinkwrap.json new file mode 100644 index 0000000000..cfd5046fc0 --- /dev/null +++ b/src/chains/ethereum/options/npm-shrinkwrap.json @@ -0,0 +1,154 @@ +{ + "name": "@ganache/ethereum-options", + "version": "0.1.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/node": { + "version": "11.11.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-11.11.6.tgz", + "integrity": "sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ==" + }, + "bip39": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.0.3.tgz", + "integrity": "sha512-P0dKrz4g0V0BjXfx7d9QNkJ/Txcz/k+hM9TnjqjUaXtuOfAvxXSw2rJw8DX0e3ZPwnK/IgDxoRqf0bvoVCqbMg==", + "requires": { + "@types/node": "11.11.6", + "create-hash": "^1.1.0", + "pbkdf2": "^3.0.9", + "randombytes": "^2.0.1" + } + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "pbkdf2": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", + "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, + "seedrandom": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz", + "integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==" + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + } + } +} diff --git a/src/chains/ethereum/options/package.json b/src/chains/ethereum/options/package.json new file mode 100644 index 0000000000..d29468efcd --- /dev/null +++ b/src/chains/ethereum/options/package.json @@ -0,0 +1,53 @@ +{ + "name": "@ganache/ethereum-options", + "version": "0.1.0", + "description": "", + "author": "ConsenSys", + "homepage": "https://github.com/trufflesuite/ganache-core/tree/develop/src/chains/ethereum/options#readme", + "license": "MIT", + "main": "lib/index.js", + "types": "src/index.ts", + "source": "index.ts", + "directories": { + "lib": "lib", + "test": "test" + }, + "files": [ + "lib" + ], + "repository": { + "type": "git", + "url": "https://github.com/trufflesuite/ganache-core.git", + "directory": "src/chains/ethereum/options" + }, + "scripts": { + "tsc": "ttsc", + "test": "nyc npm run mocha", + "mocha": "cross-env TS_NODE_COMPILER=ttypescript TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register 'tests/**/*.test.ts'" + }, + "bugs": { + "url": "https://github.com/trufflesuite/ganache-core/issues" + }, + "keywords": [ + "ganache", + "ganache-ethereum-options", + "ethereum", + "evm", + "blockchain", + "smart contracts", + "dapps", + "solidity", + "vyper", + "fe", + "web3", + "tooling", + "truffle" + ], + "dependencies": { + "@ganache/ethereum-utils": "0.1.0", + "@ganache/options": "0.1.0", + "@ganache/utils": "0.1.0", + "bip39": "3.0.3", + "seedrandom": "3.0.5" + } +} diff --git a/src/chains/ethereum/src/options/chain-options.ts b/src/chains/ethereum/options/src/chain-options.ts similarity index 100% rename from src/chains/ethereum/src/options/chain-options.ts rename to src/chains/ethereum/options/src/chain-options.ts diff --git a/src/chains/ethereum/src/options/database-options.ts b/src/chains/ethereum/options/src/database-options.ts similarity index 100% rename from src/chains/ethereum/src/options/database-options.ts rename to src/chains/ethereum/options/src/database-options.ts diff --git a/src/chains/ethereum/src/options/helpers.ts b/src/chains/ethereum/options/src/helpers.ts similarity index 100% rename from src/chains/ethereum/src/options/helpers.ts rename to src/chains/ethereum/options/src/helpers.ts diff --git a/src/chains/ethereum/src/options/index.ts b/src/chains/ethereum/options/src/index.ts similarity index 88% rename from src/chains/ethereum/src/options/index.ts rename to src/chains/ethereum/options/src/index.ts index 0878c92358..0300ec55de 100644 --- a/src/chains/ethereum/src/options/index.ts +++ b/src/chains/ethereum/options/src/index.ts @@ -70,3 +70,11 @@ export const ethereumDefaults: Defaults = { }; export const EthereumOptionsConfig = new OptionsConfig(ethereumDefaults); + +export * from "./chain-options"; +export * from "./database-options"; +export * from "./helpers"; +// export * from "./legacy-options"; +export * from "./logging-options"; +export * from "./miner-options"; +export * from "./wallet-options"; diff --git a/src/chains/ethereum/src/options/legacy-options.ts b/src/chains/ethereum/options/src/legacy-options.ts similarity index 100% rename from src/chains/ethereum/src/options/legacy-options.ts rename to src/chains/ethereum/options/src/legacy-options.ts diff --git a/src/chains/ethereum/src/options/logging-options.ts b/src/chains/ethereum/options/src/logging-options.ts similarity index 100% rename from src/chains/ethereum/src/options/logging-options.ts rename to src/chains/ethereum/options/src/logging-options.ts diff --git a/src/chains/ethereum/src/options/miner-options.ts b/src/chains/ethereum/options/src/miner-options.ts similarity index 98% rename from src/chains/ethereum/src/options/miner-options.ts rename to src/chains/ethereum/options/src/miner-options.ts index de0830d569..e88109fc4e 100644 --- a/src/chains/ethereum/src/options/miner-options.ts +++ b/src/chains/ethereum/options/src/miner-options.ts @@ -1,7 +1,7 @@ import { normalize } from "./helpers"; import { Data, Quantity, utils } from "@ganache/utils"; +import { Address } from "@ganache/ethereum-utils"; import { Definitions } from "@ganache/options"; -import Address from "../things/address"; export type MinerConfig = { options: { diff --git a/src/chains/ethereum/src/options/wallet-options.ts b/src/chains/ethereum/options/src/wallet-options.ts similarity index 100% rename from src/chains/ethereum/src/options/wallet-options.ts rename to src/chains/ethereum/options/src/wallet-options.ts diff --git a/src/chains/ethereum/options/tests/index.test.ts b/src/chains/ethereum/options/tests/index.test.ts new file mode 100644 index 0000000000..9d309a6839 --- /dev/null +++ b/src/chains/ethereum/options/tests/index.test.ts @@ -0,0 +1,5 @@ +import assert from "assert"; + +describe("@ganache/ethereum-options", () => { + it("needs tests"); +}); diff --git a/src/chains/ethereum/options/tsconfig.json b/src/chains/ethereum/options/tsconfig.json new file mode 100644 index 0000000000..d36c0eb3ae --- /dev/null +++ b/src/chains/ethereum/options/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "outDir": "lib" + }, + "include": ["src"] +} diff --git a/src/chains/ethereum/src/things/address.ts b/src/chains/ethereum/src/things/address.ts deleted file mode 100644 index 57576409b1..0000000000 --- a/src/chains/ethereum/src/things/address.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { Data } from "@ganache/utils"; - -class Address extends Data { - /** - * - * @param value - * @param byteLength the exact length the value represents when encoded as - * Ethereum JSON-RPC DATA. - */ - constructor(value: string | Buffer, byteLength: number = 20) { - super(value, byteLength); - } -} - -export default Address; diff --git a/src/chains/ethereum/utils/.npmignore b/src/chains/ethereum/utils/.npmignore new file mode 100644 index 0000000000..115ab4f024 --- /dev/null +++ b/src/chains/ethereum/utils/.npmignore @@ -0,0 +1,8 @@ +./index.ts +tests +.nyc_output +coverage +scripts +src +tsconfig.json +typedoc.json diff --git a/src/chains/ethereum/utils/LICENSE b/src/chains/ethereum/utils/LICENSE new file mode 100644 index 0000000000..39f3b14498 --- /dev/null +++ b/src/chains/ethereum/utils/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2019-2020 Truffle Blockchain Group + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/chains/ethereum/utils/README.md b/src/chains/ethereum/utils/README.md new file mode 100644 index 0000000000..b0209f7055 --- /dev/null +++ b/src/chains/ethereum/utils/README.md @@ -0,0 +1,3 @@ +# `@ganache/ethereum-utils` + +> TODO: description diff --git a/src/chains/ethereum/utils/index.ts b/src/chains/ethereum/utils/index.ts new file mode 100644 index 0000000000..e1ea78e8e9 --- /dev/null +++ b/src/chains/ethereum/utils/index.ts @@ -0,0 +1,11 @@ +/*! + * @ganache/ethereum-utils + * + * @copyright Truffle Blockchain Group + * @author Mike Seese + * @license MIT + */ + +export default { + // TODO +}; diff --git a/src/chains/ethereum/utils/npm-shrinkwrap.json b/src/chains/ethereum/utils/npm-shrinkwrap.json new file mode 100644 index 0000000000..89a03d7243 --- /dev/null +++ b/src/chains/ethereum/utils/npm-shrinkwrap.json @@ -0,0 +1,1367 @@ +{ + "name": "@ganache/ethereum-utils", + "version": "0.1.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", + "requires": { + "@types/node": "*" + } + }, + "@types/node": { + "version": "14.14.20", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.20.tgz", + "integrity": "sha512-Y93R97Ouif9JEOWPIUyU+eyIdyRqQR0I8Ez1dzku4hDx34NWh4HbtIc3WNzwB1Y9ULvNGeu5B8h8bVL5cAk4/A==" + }, + "@types/pbkdf2": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.0.tgz", + "integrity": "sha512-Cf63Rv7jCQ0LaL8tNXmEyqTHuIJxRdlS5vMh1mj5voN4+QFhVZnlZruezqpWYDiJ8UTzhP0VmeLXCmBk66YrMQ==", + "requires": { + "@types/node": "*" + } + }, + "@types/secp256k1": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.1.tgz", + "integrity": "sha512-+ZjSA8ELlOp8SlKi0YLB2tz9d5iPNEmOBd+8Rz21wTMdaXQIa9b6TEnD6l5qKOCypE7FSyPyck12qZJxSDNoog==", + "requires": { + "@types/node": "*" + } + }, + "abstract-leveldown": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.6.3.tgz", + "integrity": "sha512-2++wDf/DYqkPR3o5tbfdhF96EfMApo1GpPfzOsR/ZYXdkSmELlvOOEAl9iKkRsktMPHdGjO4rtkBpf2I7TiTeA==", + "requires": { + "xtend": "~4.0.0" + }, + "dependencies": { + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "async": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", + "requires": { + "lodash": "^4.17.14" + } + }, + "async-eventemitter": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz", + "integrity": "sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==", + "requires": { + "async": "^2.4.0" + } + }, + "base-x": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.8.tgz", + "integrity": "sha512-Rl/1AWP4J/zRrk54hhlxH4drNxPJXYUaKffODVI53/dAsV4t9fBxyxYKAVPU1XBHxYwOWP9h9H0hM2MVw4YfJA==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + }, + "blakejs": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.1.0.tgz", + "integrity": "sha1-ad+S75U6qIylGjLfarHFShVfx6U=" + }, + "bn.js": { + "version": "4.11.9", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.9.tgz", + "integrity": "sha512-E6QoYqCKZfgatHTdHzs1RRKP7ip4vvm+EyRUeE2RF0NblwVvb0p6jSVeNTOFxPn26QXN2o6SMfNxKp6kU8zQaw==" + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha1-vhYedsNU9veIrkBx9j806MTwpCo=", + "requires": { + "base-x": "^3.0.2" + } + }, + "bs58check": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", + "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", + "requires": { + "bs58": "^4.0.0", + "create-hash": "^1.1.0", + "safe-buffer": "^5.1.2" + } + }, + "buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" + }, + "call-bind": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.0.tgz", + "integrity": "sha512-AEXsYIyyDY3MCzbwdhzG3Jx1R0J2wetQyUynn6dYHAO+bg8l1k7jwZtRv4ryryFs7EP+NDlikJlVe59jr0cM2w==", + "requires": { + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.0" + } + }, + "checkpoint-store": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/checkpoint-store/-/checkpoint-store-1.1.0.tgz", + "integrity": "sha1-BOTLUWuRQziTWB5tRgGnjpVS6gY=", + "requires": { + "functional-red-black-tree": "^1.0.1" + } + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "core-js-pure": { + "version": "3.8.2", + "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.8.2.tgz", + "integrity": "sha512-v6zfIQqL/pzTVAbZvYUozsxNfxcFb6Ks3ZfEbuneJl3FW9Jb8F6vLWB6f+qTmAu72msUdyb84V8d/yBFf7FNnw==" + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "deferred-leveldown": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-1.2.2.tgz", + "integrity": "sha512-uukrWD2bguRtXilKt6cAWKyoXrTSMo5m7crUdLfWQmu8kIm88w3QZoUL+6nhpfKVmhHANER6Re3sKoNoZ3IKMA==", + "requires": { + "abstract-leveldown": "~2.6.0" + } + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "requires": { + "object-keys": "^1.0.12" + }, + "dependencies": { + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + } + } + }, + "elliptic": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.3.tgz", + "integrity": "sha512-IMqzv5wNQf+E6aHeIqATs0tOLeOTwj1QKbRcS3jBbYkl5oLAserA8yJTT7/VyHUYG91PRmPyeQDObKLPpeS4dw==", + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + } + }, + "emittery": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.8.1.tgz", + "integrity": "sha512-uDfvUjVrfGJJhymx/kz6prltenw1u7WrCg1oa94zYY8xxVpLLUu045LAT0dhDZdXG58/EpPL/5kA180fQ/qudg==" + }, + "encoding-down": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-5.0.4.tgz", + "integrity": "sha512-8CIZLDcSKxgzT+zX8ZVfgNbu8Md2wq/iqa1Y7zyVR18QBEAc0Nmzuvj/N5ykSKpfGzjM8qxbaFntLPwnVoUhZw==", + "requires": { + "abstract-leveldown": "^5.0.0", + "inherits": "^2.0.3", + "level-codec": "^9.0.0", + "level-errors": "^2.0.0", + "xtend": "^4.0.1" + }, + "dependencies": { + "abstract-leveldown": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", + "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", + "requires": { + "xtend": "~4.0.0" + } + }, + "level-codec": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz", + "integrity": "sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==", + "requires": { + "buffer": "^5.6.0" + } + }, + "level-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", + "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", + "requires": { + "errno": "~0.1.1" + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "errno": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", + "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", + "requires": { + "prr": "~1.0.1" + } + }, + "es-abstract": { + "version": "1.17.7", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.7.tgz", + "integrity": "sha512-VBl/gnfcJ7OercKA9MVaegWsBHFjV492syMudcnQZvt/Dw8ezpcOHYZXa/J96O8vx+g4x65YKhxOwDUh63aS5g==", + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + }, + "dependencies": { + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + } + } + }, + "es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, + "ethashjs": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/ethashjs/-/ethashjs-0.0.8.tgz", + "integrity": "sha512-/MSbf/r2/Ld8o0l15AymjOTlPqpN8Cr4ByUEA9GtR4x0yAh3TdtDzEg29zMjXCNPI7u6E5fOQdj/Cf9Tc7oVNw==", + "requires": { + "async": "^2.1.2", + "buffer-xor": "^2.0.1", + "ethereumjs-util": "^7.0.2", + "miller-rabin": "^4.0.0" + }, + "dependencies": { + "buffer-xor": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-2.0.2.tgz", + "integrity": "sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ==", + "requires": { + "safe-buffer": "^5.1.1" + } + } + } + }, + "ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "requires": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, + "ethereumjs-abi": { + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz", + "integrity": "sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==", + "requires": { + "bn.js": "^4.11.8", + "ethereumjs-util": "^6.0.0" + }, + "dependencies": { + "ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + } + } + }, + "ethereumjs-account": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ethereumjs-account/-/ethereumjs-account-3.0.0.tgz", + "integrity": "sha512-WP6BdscjiiPkQfF9PVfMcwx/rDvfZTjFKY0Uwc09zSQr9JfIVH87dYIJu0gNhBhpmovV4yq295fdllS925fnBA==", + "requires": { + "ethereumjs-util": "^6.0.0", + "rlp": "^2.2.1", + "safe-buffer": "^5.1.1" + }, + "dependencies": { + "ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + } + } + }, + "ethereumjs-block": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/ethereumjs-block/-/ethereumjs-block-2.2.2.tgz", + "integrity": "sha512-2p49ifhek3h2zeg/+da6XpdFR3GlqY3BIEiqxGF8j9aSRIgkb7M1Ky+yULBKJOu8PAZxfhsYA+HxUk2aCQp3vg==", + "requires": { + "async": "^2.0.1", + "ethereumjs-common": "^1.5.0", + "ethereumjs-tx": "^2.1.1", + "ethereumjs-util": "^5.0.0", + "merkle-patricia-tree": "^2.1.2" + }, + "dependencies": { + "ethereumjs-util": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", + "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "^0.1.3", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + } + } + } + }, + "ethereumjs-blockchain": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/ethereumjs-blockchain/-/ethereumjs-blockchain-4.0.4.tgz", + "integrity": "sha512-zCxaRMUOzzjvX78DTGiKjA+4h2/sF0OYL1QuPux0DHpyq8XiNoF5GYHtb++GUxVlMsMfZV7AVyzbtgcRdIcEPQ==", + "requires": { + "async": "^2.6.1", + "ethashjs": "~0.0.7", + "ethereumjs-block": "~2.2.2", + "ethereumjs-common": "^1.5.0", + "ethereumjs-util": "^6.1.0", + "flow-stoplight": "^1.0.0", + "level-mem": "^3.0.1", + "lru-cache": "^5.1.1", + "rlp": "^2.2.2", + "semaphore": "^1.1.0" + }, + "dependencies": { + "ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + } + } + }, + "ethereumjs-common": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/ethereumjs-common/-/ethereumjs-common-1.5.2.tgz", + "integrity": "sha512-hTfZjwGX52GS2jcVO6E2sx4YuFnf0Fhp5ylo4pEPhEffNln7vS59Hr5sLnp3/QCazFLluuBZ+FZ6J5HTp0EqCA==" + }, + "ethereumjs-tx": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ethereumjs-tx/-/ethereumjs-tx-2.1.2.tgz", + "integrity": "sha512-zZEK1onCeiORb0wyCXUvg94Ve5It/K6GD1K+26KfFKodiBiS6d9lfCXlUKGBBdQ+bv7Day+JK0tj1K+BeNFRAw==", + "requires": { + "ethereumjs-common": "^1.5.0", + "ethereumjs-util": "^6.0.0" + }, + "dependencies": { + "ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + } + } + }, + "ethereumjs-util": { + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.0.7.tgz", + "integrity": "sha512-vU5rtZBlZsgkTw3o6PDKyB8li2EgLavnAbsKcfsH2YhHH1Le+PP8vEiMnAnvgc1B6uMoaM5GDCrVztBw0Q5K9g==", + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^5.1.2", + "create-hash": "^1.1.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.4" + }, + "dependencies": { + "bn.js": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.1.3.tgz", + "integrity": "sha512-GkTiFpjFtUzU9CbMeJ5iazkCzGL3jrhzerzZIuqLABjbwRaFt33I9tUdSNryIptM+RxDet6OKm2WnLXzW51KsQ==" + } + } + }, + "ethereumjs-vm": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/ethereumjs-vm/-/ethereumjs-vm-4.2.0.tgz", + "integrity": "sha512-X6qqZbsY33p5FTuZqCnQ4+lo957iUJMM6Mpa6bL4UW0dxM6WmDSHuI4j/zOp1E2TDKImBGCJA9QPfc08PaNubA==", + "requires": { + "async": "^2.1.2", + "async-eventemitter": "^0.2.2", + "core-js-pure": "^3.0.1", + "ethereumjs-account": "^3.0.0", + "ethereumjs-block": "^2.2.2", + "ethereumjs-blockchain": "^4.0.3", + "ethereumjs-common": "^1.5.0", + "ethereumjs-tx": "^2.1.2", + "ethereumjs-util": "^6.2.0", + "fake-merkle-patricia-tree": "^1.0.1", + "functional-red-black-tree": "^1.0.1", + "merkle-patricia-tree": "^2.3.2", + "rustbn.js": "~0.2.0", + "safe-buffer": "^5.1.1", + "util.promisify": "^1.0.0" + }, + "dependencies": { + "ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "requires": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + } + } + }, + "ethjs-util": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", + "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", + "requires": { + "is-hex-prefixed": "1.0.0", + "strip-hex-prefix": "1.0.0" + } + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "fake-merkle-patricia-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/fake-merkle-patricia-tree/-/fake-merkle-patricia-tree-1.0.1.tgz", + "integrity": "sha1-S4w6z7Ugr635hgsfFM2M40As3dM=", + "requires": { + "checkpoint-store": "^1.1.0" + } + }, + "flow-stoplight": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/flow-stoplight/-/flow-stoplight-1.0.0.tgz", + "integrity": "sha1-SiksW8/4s5+mzAyxqFPYbyfu/3s=" + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=" + }, + "get-intrinsic": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.0.2.tgz", + "integrity": "sha512-aeX0vrFm21ILl3+JpFFRNe9aUvp6VFZb2/CTbgLb8j75kOhvoNYjt9d8KA/tJG4gSo8nzEDedRl0h7vDmBYRVg==", + "requires": { + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1" + } + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-symbols": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==" + }, + "hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "requires": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + } + }, + "hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + }, + "immediate": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz", + "integrity": "sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==" + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "is-callable": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.2.tgz", + "integrity": "sha512-dnMqspv5nU3LoewK2N/y7KLtxtakvTuaCsU9FU50/QDmdbHNy/4/JuRtMHqRU22o3q+W89YQndQEeCVwK+3qrA==" + }, + "is-date-object": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", + "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==" + }, + "is-hex-prefixed": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", + "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" + }, + "is-negative-zero": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.1.tgz", + "integrity": "sha512-2z6JzQvZRa9A2Y7xC6dQQm4FSTSTNWjKIYYTt4246eMTJmIo0Q+ZyOsU66X8lxK1AbB92dFeglPLrhwpeRKO6w==" + }, + "is-regex": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.1.tgz", + "integrity": "sha512-1+QkEcxiLlB7VEyFtyBg94e08OAsvq7FUBgApTq/w2ymCLyKJgDPsybBENVtA7XCQEgEXxKPonG+mvYRxh/LIg==", + "requires": { + "has-symbols": "^1.0.1" + } + }, + "is-symbol": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz", + "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==", + "requires": { + "has-symbols": "^1.0.1" + } + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "keccak": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.1.tgz", + "integrity": "sha512-epq90L9jlFWCW7+pQa6JOnKn2Xgl2mtI664seYR6MHskvI9agt7AnDqmAlp9TqU4/caMYbA08Hi5DMZAl5zdkA==", + "requires": { + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + } + }, + "level-codec": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-7.0.1.tgz", + "integrity": "sha512-Ua/R9B9r3RasXdRmOtd+t9TCOEIIlts+TN/7XTT2unhDaL6sJn83S3rUyljbr6lVtw49N3/yA0HHjpV6Kzb2aQ==" + }, + "level-errors": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-1.0.5.tgz", + "integrity": "sha512-/cLUpQduF6bNrWuAC4pwtUKA5t669pCsCi2XbmojG2tFeOr9j6ShtdDCtFFQO1DRt+EVZhx9gPzP9G2bUaG4ig==", + "requires": { + "errno": "~0.1.1" + } + }, + "level-iterator-stream": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-1.3.1.tgz", + "integrity": "sha1-5Dt4sagUPm+pek9IXrjqUwNS8u0=", + "requires": { + "inherits": "^2.0.1", + "level-errors": "^1.0.3", + "readable-stream": "^1.0.33", + "xtend": "^4.0.0" + }, + "dependencies": { + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "level-mem": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/level-mem/-/level-mem-3.0.1.tgz", + "integrity": "sha512-LbtfK9+3Ug1UmvvhR2DqLqXiPW1OJ5jEh0a3m9ZgAipiwpSxGj/qaVVy54RG5vAQN1nCuXqjvprCuKSCxcJHBg==", + "requires": { + "level-packager": "~4.0.0", + "memdown": "~3.0.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", + "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", + "requires": { + "xtend": "~4.0.0" + } + }, + "immediate": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", + "integrity": "sha1-0UD6j2FGWb1lQSMwl92qwlzdmRw=" + }, + "memdown": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-3.0.0.tgz", + "integrity": "sha512-tbV02LfZMWLcHcq4tw++NuqMO+FZX8tNJEiD2aNRm48ZZusVg5N8NART+dmBkepJVye986oixErf7jfXboMGMA==", + "requires": { + "abstract-leveldown": "~5.0.0", + "functional-red-black-tree": "~1.0.1", + "immediate": "~3.2.3", + "inherits": "~2.0.1", + "ltgt": "~2.2.0", + "safe-buffer": "~5.1.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "level-packager": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/level-packager/-/level-packager-4.0.1.tgz", + "integrity": "sha512-svCRKfYLn9/4CoFfi+d8krOtrp6RoX8+xm0Na5cgXMqSyRru0AnDYdLl+YI8u1FyS6gGZ94ILLZDE5dh2but3Q==", + "requires": { + "encoding-down": "~5.0.0", + "levelup": "^3.0.0" + }, + "dependencies": { + "abstract-leveldown": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-5.0.0.tgz", + "integrity": "sha512-5mU5P1gXtsMIXg65/rsYGsi93+MlogXZ9FA8JnwKurHQg64bfXwGYVdVdijNTVNOlAsuIiOwHdvFFD5JqCJQ7A==", + "requires": { + "xtend": "~4.0.0" + } + }, + "deferred-leveldown": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-4.0.2.tgz", + "integrity": "sha512-5fMC8ek8alH16QiV0lTCis610D1Zt1+LA4MS4d63JgS32lrCjTFDUFz2ao09/j2I4Bqb5jL4FZYwu7Jz0XO1ww==", + "requires": { + "abstract-leveldown": "~5.0.0", + "inherits": "^2.0.3" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "level-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", + "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", + "requires": { + "errno": "~0.1.1" + } + }, + "level-iterator-stream": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-3.0.1.tgz", + "integrity": "sha512-nEIQvxEED9yRThxvOrq8Aqziy4EGzrxSZK+QzEFAVuJvQ8glfyZ96GB6BoI4sBbLfjMXm2w4vu3Tkcm9obcY0g==", + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "xtend": "^4.0.0" + } + }, + "levelup": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-3.1.1.tgz", + "integrity": "sha512-9N10xRkUU4dShSRRFTBdNaBxofz+PGaIZO962ckboJZiNmLuhVT6FZ6ZKAsICKfUBO76ySaYU6fJWX/jnj3Lcg==", + "requires": { + "deferred-leveldown": "~4.0.0", + "level-errors": "~2.0.0", + "level-iterator-stream": "~3.0.0", + "xtend": "~4.0.0" + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "level-ws": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-0.0.0.tgz", + "integrity": "sha1-Ny5RIXeSSgBCSwtDrvK7QkltIos=", + "requires": { + "readable-stream": "~1.0.15", + "xtend": "~2.1.1" + }, + "dependencies": { + "readable-stream": { + "version": "1.0.34", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", + "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + } + } + }, + "levelup": { + "version": "1.3.9", + "resolved": "https://registry.npmjs.org/levelup/-/levelup-1.3.9.tgz", + "integrity": "sha512-VVGHfKIlmw8w1XqpGOAGwq6sZm2WwWLmlDcULkKWQXEA5EopA8OBNJ2Ck2v6bdk8HeEZSbCSEgzXadyQFm76sQ==", + "requires": { + "deferred-leveldown": "~1.2.1", + "level-codec": "~7.0.0", + "level-errors": "~1.0.3", + "level-iterator-stream": "~1.3.0", + "prr": "~1.0.1", + "semver": "~5.4.1", + "xtend": "~4.0.0" + }, + "dependencies": { + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + }, + "lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", + "requires": { + "yallist": "^3.0.2" + } + }, + "ltgt": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", + "integrity": "sha1-81ypHEk/e3PaDgdJUwTxezH4fuU=" + }, + "md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "memdown": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/memdown/-/memdown-1.4.1.tgz", + "integrity": "sha1-tOThkhdGZP+65BNhqlAPMRnv4hU=", + "requires": { + "abstract-leveldown": "~2.7.1", + "functional-red-black-tree": "^1.0.1", + "immediate": "^3.2.3", + "inherits": "~2.0.1", + "ltgt": "~2.2.0", + "safe-buffer": "~5.1.1" + }, + "dependencies": { + "abstract-leveldown": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-2.7.2.tgz", + "integrity": "sha512-+OVvxH2rHVEhWLdbudP6p0+dNMXu8JA1CbhP19T8paTYAcX7oJ4OVjT+ZUVpv7mITxXHqDMej+GdqXBmXkw09w==", + "requires": { + "xtend": "~4.0.0" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + } + } + }, + "merkle-patricia-tree": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-2.3.2.tgz", + "integrity": "sha512-81PW5m8oz/pz3GvsAwbauj7Y00rqm81Tzad77tHBwU7pIAtN+TJnMSOJhxBKflSVYhptMMb9RskhqHqrSm1V+g==", + "requires": { + "async": "^1.4.2", + "ethereumjs-util": "^5.0.0", + "level-ws": "0.0.0", + "levelup": "^1.2.1", + "memdown": "^1.0.0", + "readable-stream": "^2.0.0", + "rlp": "^2.0.0", + "semaphore": ">=1.0.1" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + }, + "ethereumjs-util": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-5.2.1.tgz", + "integrity": "sha512-v3kT+7zdyCm1HIqWlLNrHGqHGLpGYIhjeHxQjnDXjLT2FyGJDsd3LWMYUo7pAFRrk86CR3nUJfhC81CCoJNNGQ==", + "requires": { + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "^0.1.3", + "rlp": "^2.0.0", + "safe-buffer": "^5.1.1" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + } + } + } + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + } + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" + }, + "node-addon-api": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" + }, + "node-gyp-build": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", + "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==" + }, + "object-inspect": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz", + "integrity": "sha512-i3Bp9iTqwhaLZBxGkRfo5ZbE07BQRT7MGu8+nNgwW9ItGp1TzCTw2DLEoWwjClxBjOFI/hWljTAmYGCEwmtnOw==" + }, + "object-keys": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", + "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=" + }, + "object.assign": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", + "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "has-symbols": "^1.0.1", + "object-keys": "^1.1.1" + }, + "dependencies": { + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + } + } + }, + "object.getownpropertydescriptors": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.1.1.tgz", + "integrity": "sha512-6DtXgZ/lIZ9hqx4GtZETobXLR/ZLaa0aqV0kzbn80Rf8Z2e/XFnhA0I7p07N2wH8bBBltr2xQPi6sbKWAY2Eng==", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3", + "es-abstract": "^1.18.0-next.1" + }, + "dependencies": { + "es-abstract": { + "version": "1.18.0-next.1", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.0-next.1.tgz", + "integrity": "sha512-I4UGspA0wpZXWENrdA0uHbnhte683t3qT/1VFH9aX2dA5PPSf6QW5HHXf5HImaqPmjXaVeVk4RGWnaylmV7uAA==", + "requires": { + "es-to-primitive": "^1.2.1", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.1", + "is-callable": "^1.2.2", + "is-negative-zero": "^2.0.0", + "is-regex": "^1.1.1", + "object-inspect": "^1.8.0", + "object-keys": "^1.1.1", + "object.assign": "^4.1.1", + "string.prototype.trimend": "^1.0.1", + "string.prototype.trimstart": "^1.0.1" + } + }, + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==" + } + } + }, + "pbkdf2": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.1.tgz", + "integrity": "sha512-4Ejy1OPxi9f2tt1rRV7Go7zmfDQ+ZectEQz3VGUQhgq62HtIRPDyG/JtnwIxs6x3uNMwo2V7q1fMvKjb+Tnpqg==", + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" + }, + "randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "rlp": { + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.6.tgz", + "integrity": "sha512-HAfAmL6SDYNWPUOJNrM500x4Thn4PZsEy5pijPh40U9WfNk0z15hUYzO9xVIMAdIHdFtD8CBDHd75Td1g36Mjg==", + "requires": { + "bn.js": "^4.11.1" + } + }, + "rustbn.js": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz", + "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==" + }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, + "scrypt-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" + }, + "secp256k1": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.2.tgz", + "integrity": "sha512-UDar4sKvWAksIlfX3xIaQReADn+WFnHvbVujpcbr+9Sf/69odMwy2MUsz5CKLQgX9nsIyrjuxL2imVyoNHa3fg==", + "requires": { + "elliptic": "^6.5.2", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + } + }, + "semaphore": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/semaphore/-/semaphore-1.1.0.tgz", + "integrity": "sha512-O4OZEaNtkMd/K0i6js9SL+gqy0ZCBMgUvlSqHKi4IBdjhe7wB8pwztUk1BbZ1fmrvpwFrPbHzqd2w5pTcJH6LA==" + }, + "semver": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.4.1.tgz", + "integrity": "sha512-WfG/X9+oATh81XtllIo/I8gOiY9EXRdv1cQdyykeXK17YcUW3EXUAi2To4pcH6nZtJPr7ZOpM5OMyWJZm+8Rsg==" + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "string.prototype.trimend": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.3.tgz", + "integrity": "sha512-ayH0pB+uf0U28CtjlLvL7NaohvR1amUvVZk+y3DYb0Ey2PUV5zPkkKy9+U1ndVEIXO8hNg18eIv9Jntbii+dKw==", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + } + }, + "string.prototype.trimstart": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.3.tgz", + "integrity": "sha512-oBIBUy5lea5tt0ovtOFiEQaBkoBBkyJhZXzJYrSmDo5IUUqbOPvVezuRs/agBIdZ2p2Eo1FD6bD9USyBLfl3xg==", + "requires": { + "call-bind": "^1.0.0", + "define-properties": "^1.1.3" + } + }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "requires": { + "safe-buffer": "~5.2.0" + } + }, + "strip-hex-prefix": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", + "integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=", + "requires": { + "is-hex-prefixed": "1.0.0" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "util.promisify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.1.tgz", + "integrity": "sha512-g9JpC/3He3bm38zsLupWryXHoEcS22YHthuPQSJdMy6KNrzIRzWqcsHzD/WUnqe45whVou4VIsPew37DoXWNrA==", + "requires": { + "define-properties": "^1.1.3", + "es-abstract": "^1.17.2", + "has-symbols": "^1.0.1", + "object.getownpropertydescriptors": "^2.1.0" + } + }, + "xtend": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", + "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", + "requires": { + "object-keys": "~0.4.0" + } + }, + "yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" + } + } +} diff --git a/src/chains/ethereum/utils/package.json b/src/chains/ethereum/utils/package.json new file mode 100644 index 0000000000..412b3227a0 --- /dev/null +++ b/src/chains/ethereum/utils/package.json @@ -0,0 +1,55 @@ +{ + "name": "@ganache/ethereum-utils", + "version": "0.1.0", + "description": "", + "author": "Mike Seese", + "homepage": "https://github.com/trufflesuite/ganache-core/tree/develop/src/chains/ethereum/utils#readme", + "license": "MIT", + "main": "lib/index.js", + "types": "src/index.ts", + "source": "index.ts", + "directories": { + "lib": "lib", + "test": "test" + }, + "files": [ + "lib" + ], + "repository": { + "type": "git", + "url": "https://github.com/trufflesuite/ganache-core.git", + "directory": "src/chains/ethereum/utils" + }, + "scripts": { + "tsc": "ttsc", + "test": "nyc npm run mocha", + "mocha": "cross-env TS_NODE_COMPILER=ttypescript TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register 'tests/**/*.test.ts'" + }, + "bugs": { + "url": "https://github.com/trufflesuite/ganache-core/issues" + }, + "keywords": [ + "ganache", + "ganache-ethereum-utils", + "ethereum", + "evm", + "blockchain", + "smart contracts", + "dapps", + "solidity", + "vyper", + "fe", + "web3", + "tooling", + "truffle" + ], + "dependencies": { + "@ganache/utils": "0.1.0", + "emittery": "0.8.1", + "ethereumjs-abi": "0.6.8", + "ethereumjs-tx": "2.1.2", + "ethereumjs-util": "7.0.7", + "ethereumjs-vm": "4.2.0", + "rlp": "2.2.6" + } +} diff --git a/src/chains/ethereum/src/errors/coded-error.ts b/src/chains/ethereum/utils/src/errors/coded-error.ts similarity index 96% rename from src/chains/ethereum/src/errors/coded-error.ts rename to src/chains/ethereum/utils/src/errors/coded-error.ts index 569f924155..3337f7c2ee 100644 --- a/src/chains/ethereum/src/errors/coded-error.ts +++ b/src/chains/ethereum/utils/src/errors/coded-error.ts @@ -46,7 +46,7 @@ export const ErrorCodes = { JSON_RPC_VERSION_NOT_SUPPORTED: -32006 } as const; -export default class CodedError extends Error { +export class CodedError extends Error { code: number; constructor(message: string, code: number) { super(message); diff --git a/src/chains/ethereum/src/errors/errors.ts b/src/chains/ethereum/utils/src/errors/errors.ts similarity index 100% rename from src/chains/ethereum/src/errors/errors.ts rename to src/chains/ethereum/utils/src/errors/errors.ts diff --git a/src/chains/ethereum/src/errors/runtime-error.ts b/src/chains/ethereum/utils/src/errors/runtime-error.ts similarity index 94% rename from src/chains/ethereum/src/errors/runtime-error.ts rename to src/chains/ethereum/utils/src/errors/runtime-error.ts index 47d16569cd..8b1ea74355 100644 --- a/src/chains/ethereum/src/errors/runtime-error.ts +++ b/src/chains/ethereum/utils/src/errors/runtime-error.ts @@ -2,7 +2,7 @@ import { EVMResult } from "ethereumjs-vm/dist/evm/evm"; import { VM_EXCEPTION } from "./errors"; import { Data } from "@ganache/utils"; import { rawDecode } from "ethereumjs-abi"; -import CodedError, { ErrorCodes } from "./coded-error"; +import { CodedError, ErrorCodes } from "./coded-error"; const REVERT_REASON = Buffer.from("08c379a0", "hex"); // keccak("Error(string)").slice(0, 4) @@ -11,7 +11,7 @@ export enum RETURN_TYPES { RETURN_VALUE } -export default class RuntimeError extends CodedError { +export class RuntimeError extends CodedError { public code: typeof ErrorCodes.INVALID_INPUT; public data: { hash: string; diff --git a/src/chains/ethereum/utils/src/index.ts b/src/chains/ethereum/utils/src/index.ts new file mode 100644 index 0000000000..567f4a34ea --- /dev/null +++ b/src/chains/ethereum/utils/src/index.ts @@ -0,0 +1,22 @@ +export * from "./errors/coded-error"; +export * from "./errors/errors"; +export * from "./errors/runtime-error"; + +export * from "./things/account"; +export * from "./things/address"; +export * from "./things/blocklogs"; +export * from "./things/params"; +export * from "./things/runtime-block"; +export * from "./things/tags"; +export * from "./things/trace-data"; +export * from "./things/trace-storage-map"; +export * from "./things/transaction-receipt"; +export * from "./things/transaction"; + +export * from "./types/executables"; +export * from "./types/extract-values-from-types"; +export * from "./types/filters"; +export * from "./types/shh"; +export * from "./types/snapshots"; +export * from "./types/subscriptions"; +export * from "./types/tuple-from-union"; diff --git a/src/chains/ethereum/src/things/account.ts b/src/chains/ethereum/utils/src/things/account.ts similarity index 94% rename from src/chains/ethereum/src/things/account.ts rename to src/chains/ethereum/utils/src/things/account.ts index 5e0eefdcf8..9f29de69b9 100644 --- a/src/chains/ethereum/src/things/account.ts +++ b/src/chains/ethereum/utils/src/things/account.ts @@ -1,11 +1,11 @@ import { Data, Quantity } from "@ganache/utils"; -import Address from "./address"; +import { Address } from "./address"; import { rlp, KECCAK256_RLP, KECCAK256_NULL } from "ethereumjs-util"; import { utils } from "@ganache/utils"; const RPCQUANTITY_ZERO = utils.RPCQUANTITY_ZERO; -export default class Account { +export class Account { public address: Address; public balance: Quantity; public privateKey: Data; diff --git a/src/chains/ethereum/utils/src/things/address.ts b/src/chains/ethereum/utils/src/things/address.ts new file mode 100644 index 0000000000..0aa6277819 --- /dev/null +++ b/src/chains/ethereum/utils/src/things/address.ts @@ -0,0 +1,18 @@ +import { Data } from "@ganache/utils"; + +export class Address extends Data { + static ByteLength = 20; + + /** + * + * @param value + * @param byteLength the exact length the value represents when encoded as + * Ethereum JSON-RPC DATA. + */ + constructor(value: string | Buffer) { + super(value, Address.ByteLength); + } + public static from(value: T) { + return new Address(value); + } +} diff --git a/src/chains/ethereum/src/things/blocklogs.ts b/src/chains/ethereum/utils/src/things/blocklogs.ts similarity index 98% rename from src/chains/ethereum/src/things/blocklogs.ts rename to src/chains/ethereum/utils/src/things/blocklogs.ts index f71b435b47..1f5919ddf3 100644 --- a/src/chains/ethereum/src/things/blocklogs.ts +++ b/src/chains/ethereum/utils/src/things/blocklogs.ts @@ -1,6 +1,6 @@ import { encode as rlpEncode, decode as rlpDecode } from "rlp"; import { Data, Quantity } from "@ganache/utils"; -import Address from "./address"; +import { Address } from "./address"; import { utils } from "@ganache/utils"; export type TransactionLog = [ @@ -48,7 +48,7 @@ const filterByTopic = ( }); }; -export default class BlockLogs { +export class BlockLogs { [_raw]: [blockHash: Buffer, blockLog: BlockLog[]]; constructor(data: Buffer) { diff --git a/src/chains/ethereum/src/things/params.ts b/src/chains/ethereum/utils/src/things/params.ts similarity index 97% rename from src/chains/ethereum/src/things/params.ts rename to src/chains/ethereum/utils/src/things/params.ts index 728ba674ea..c2db3d9d08 100644 --- a/src/chains/ethereum/src/things/params.ts +++ b/src/chains/ethereum/utils/src/things/params.ts @@ -1,7 +1,7 @@ // NOTE these params may need to be changed at each hardfork // they can be tracked here: https://github.com/ethereumjs/ethereumjs-vm/blob/master/packages/common/src/hardforks/ -export default { +export const params = { /** * Per transaction not creating a contract. NOTE: Not payable on data of calls between transactions. */ diff --git a/src/chains/ethereum/src/things/runtime-block.ts b/src/chains/ethereum/utils/src/things/runtime-block.ts similarity index 98% rename from src/chains/ethereum/src/things/runtime-block.ts rename to src/chains/ethereum/utils/src/things/runtime-block.ts index 95aa14a3d9..a10a7721da 100644 --- a/src/chains/ethereum/src/things/runtime-block.ts +++ b/src/chains/ethereum/utils/src/things/runtime-block.ts @@ -3,8 +3,8 @@ import { utils } from "@ganache/utils"; import Common from "ethereumjs-common"; import keccak from "keccak"; import { encode as rlpEncode, decode as rlpDecode } from "rlp"; -import Transaction from "../things/transaction"; -import Address from "./address"; +import { Transaction } from "./transaction"; +import { Address } from "./address"; import { KECCAK256_RLP_ARRAY } from "ethereumjs-util"; const { BUFFER_EMPTY, RPCQUANTITY_ZERO } = utils; diff --git a/src/chains/ethereum/src/things/tags.ts b/src/chains/ethereum/utils/src/things/tags.ts similarity index 91% rename from src/chains/ethereum/src/things/tags.ts rename to src/chains/ethereum/utils/src/things/tags.ts index 2a7963a2e2..b879c56d0b 100644 --- a/src/chains/ethereum/src/things/tags.ts +++ b/src/chains/ethereum/utils/src/things/tags.ts @@ -1,4 +1,4 @@ -enum Tag { +export enum Tag { EARLIEST = "earliest", LATEST = "latest", PENDING = "pending" @@ -9,7 +9,7 @@ enum _Tag { pending } -namespace Tag { +export namespace Tag { export function normalize(tag: keyof typeof _Tag | Tag): Tag { if (typeof tag === "string") { return (Tag)[tag.toUpperCase()]; @@ -25,5 +25,3 @@ namespace Tag { } } } - -export default Tag; diff --git a/src/chains/ethereum/src/things/trace-data.ts b/src/chains/ethereum/utils/src/things/trace-data.ts similarity index 98% rename from src/chains/ethereum/src/things/trace-data.ts rename to src/chains/ethereum/utils/src/things/trace-data.ts index d52ebc439b..93c757ed54 100644 --- a/src/chains/ethereum/src/things/trace-data.ts +++ b/src/chains/ethereum/utils/src/things/trace-data.ts @@ -102,5 +102,3 @@ export const TraceDataFactory = () => { return TraceData; }; - -export default TraceDataFactory; diff --git a/src/chains/ethereum/src/things/trace-storage-map.ts b/src/chains/ethereum/utils/src/things/trace-storage-map.ts similarity index 71% rename from src/chains/ethereum/src/things/trace-storage-map.ts rename to src/chains/ethereum/utils/src/things/trace-storage-map.ts index a41a2ce720..bbd27e14cf 100644 --- a/src/chains/ethereum/src/things/trace-storage-map.ts +++ b/src/chains/ethereum/utils/src/things/trace-storage-map.ts @@ -1,6 +1,6 @@ import { ITraceData } from "./trace-data"; -class TraceStorageMap extends Map { +export class TraceStorageMap extends Map { toJSON(): Record { const obj: Record = {}; @@ -11,5 +11,3 @@ class TraceStorageMap extends Map { return obj; } } - -export default TraceStorageMap; diff --git a/src/chains/ethereum/src/things/transaction-receipt.ts b/src/chains/ethereum/utils/src/things/transaction-receipt.ts similarity index 95% rename from src/chains/ethereum/src/things/transaction-receipt.ts rename to src/chains/ethereum/utils/src/things/transaction-receipt.ts index aa02c54b62..a68263b3ff 100644 --- a/src/chains/ethereum/src/things/transaction-receipt.ts +++ b/src/chains/ethereum/utils/src/things/transaction-receipt.ts @@ -1,7 +1,7 @@ -import Transaction from "./transaction"; +import { Transaction } from "./transaction"; import { encode as rlpEncode, decode as rlpDecode } from "rlp"; import { Data, Quantity } from "@ganache/utils"; -import BlockLogs, { TransactionLog } from "./blocklogs"; +import { BlockLogs, TransactionLog } from "./blocklogs"; import { utils } from "@ganache/utils"; import { Block } from "./runtime-block"; @@ -23,7 +23,7 @@ type FullRawReceipt = [ ]; type RawReceipt = OmitLastType>; -export default class TransactionReceipt { +export class TransactionReceipt { public contractAddress: Buffer; #gasUsed: Buffer; raw: RawReceipt; diff --git a/src/chains/ethereum/src/things/transaction.ts b/src/chains/ethereum/utils/src/things/transaction.ts similarity index 98% rename from src/chains/ethereum/src/things/transaction.ts rename to src/chains/ethereum/utils/src/things/transaction.ts index 7849514110..81513eae1e 100644 --- a/src/chains/ethereum/src/things/transaction.ts +++ b/src/chains/ethereum/utils/src/things/transaction.ts @@ -1,7 +1,7 @@ import { INTRINSIC_GAS_TOO_LOW } from "../errors/errors"; -import RuntimeError, { RETURN_TYPES } from "../errors/runtime-error"; +import { RuntimeError, RETURN_TYPES } from "../errors/runtime-error"; import { utils, Data, Quantity } from "@ganache/utils"; -import params from "./params"; +import { params } from "./params"; import { Transaction as EthereumJsTransaction, FakeTransaction as EthereumJsFakeTransaction @@ -10,10 +10,10 @@ import * as ethUtil from "ethereumjs-util"; import assert from "assert"; import { decode as rlpDecode } from "rlp"; import { RunTxResult } from "ethereumjs-vm/dist/runTx"; -import TransactionReceipt from "./transaction-receipt"; +import { TransactionReceipt } from "./transaction-receipt"; import Common from "ethereumjs-common"; import { TransactionLog } from "./blocklogs"; -import Address from "./address"; +import { Address } from "./address"; import { ExtractValuesFromType } from "../types/extract-values-from-types"; import { Block } from "./runtime-block"; @@ -208,9 +208,9 @@ type TransactionFinalization = | { status: "confirmed"; error?: Error } | { status: "rejected"; error: Error }; -interface Transaction extends Omit {} +export interface Transaction extends Omit {} // TODO fix the EthereumJsTransaction as any via some "fake" multi-inheritance: -class Transaction extends (EthereumJsTransaction as any) { +export class Transaction extends (EthereumJsTransaction as any) { public locked: boolean = false; type: number; v: Buffer; @@ -543,5 +543,3 @@ class Transaction extends (EthereumJsTransaction as any) { public execException: RuntimeError = null; } - -export default Transaction; diff --git a/src/chains/ethereum/src/types/executables.ts b/src/chains/ethereum/utils/src/types/executables.ts similarity index 74% rename from src/chains/ethereum/src/types/executables.ts rename to src/chains/ethereum/utils/src/types/executables.ts index 7a9bcae406..849fb673e8 100644 --- a/src/chains/ethereum/src/types/executables.ts +++ b/src/chains/ethereum/utils/src/types/executables.ts @@ -1,5 +1,5 @@ import { utils } from "@ganache/utils"; -import Transaction from "../things/transaction"; +import { Transaction } from "../things/transaction"; export type Executables = { inProgress: Set; diff --git a/src/chains/ethereum/src/types/extract-values-from-types.ts b/src/chains/ethereum/utils/src/types/extract-values-from-types.ts similarity index 100% rename from src/chains/ethereum/src/types/extract-values-from-types.ts rename to src/chains/ethereum/utils/src/types/extract-values-from-types.ts diff --git a/src/chains/ethereum/src/types/filters.ts b/src/chains/ethereum/utils/src/types/filters.ts similarity index 94% rename from src/chains/ethereum/src/types/filters.ts rename to src/chains/ethereum/utils/src/types/filters.ts index 06dde6fd35..f564de35e7 100644 --- a/src/chains/ethereum/src/types/filters.ts +++ b/src/chains/ethereum/utils/src/types/filters.ts @@ -1,6 +1,6 @@ import { Data } from "@ganache/utils"; import Emittery from "emittery"; -import Tag from "../things/tags"; +import { Tag } from "../things/tags"; export enum FilterTypes { log, diff --git a/src/chains/ethereum/src/types/shh.ts b/src/chains/ethereum/utils/src/types/shh.ts similarity index 100% rename from src/chains/ethereum/src/types/shh.ts rename to src/chains/ethereum/utils/src/types/shh.ts diff --git a/src/chains/ethereum/src/types/snapshots.ts b/src/chains/ethereum/utils/src/types/snapshots.ts similarity index 100% rename from src/chains/ethereum/src/types/snapshots.ts rename to src/chains/ethereum/utils/src/types/snapshots.ts diff --git a/src/chains/ethereum/src/types/subscriptions.ts b/src/chains/ethereum/utils/src/types/subscriptions.ts similarity index 100% rename from src/chains/ethereum/src/types/subscriptions.ts rename to src/chains/ethereum/utils/src/types/subscriptions.ts diff --git a/src/chains/ethereum/src/types/tuple-from-union.ts b/src/chains/ethereum/utils/src/types/tuple-from-union.ts similarity index 100% rename from src/chains/ethereum/src/types/tuple-from-union.ts rename to src/chains/ethereum/utils/src/types/tuple-from-union.ts diff --git a/src/chains/ethereum/utils/tests/index.test.ts b/src/chains/ethereum/utils/tests/index.test.ts new file mode 100644 index 0000000000..b3e7e2f373 --- /dev/null +++ b/src/chains/ethereum/utils/tests/index.test.ts @@ -0,0 +1,5 @@ +import assert from "assert"; + +describe("@ganache/ethereum-utils", () => { + it("needs tests"); +}); diff --git a/src/chains/ethereum/utils/tsconfig.json b/src/chains/ethereum/utils/tsconfig.json new file mode 100644 index 0000000000..d36c0eb3ae --- /dev/null +++ b/src/chains/ethereum/utils/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "outDir": "lib" + }, + "include": ["src"] +} diff --git a/src/chains/filecoin/README.md b/src/chains/filecoin/filecoin/README.md similarity index 100% rename from src/chains/filecoin/README.md rename to src/chains/filecoin/filecoin/README.md diff --git a/src/chains/filecoin/docker-compose.yml b/src/chains/filecoin/filecoin/docker-compose.yml similarity index 100% rename from src/chains/filecoin/docker-compose.yml rename to src/chains/filecoin/filecoin/docker-compose.yml diff --git a/src/chains/filecoin/index.ts b/src/chains/filecoin/filecoin/index.ts similarity index 100% rename from src/chains/filecoin/index.ts rename to src/chains/filecoin/filecoin/index.ts diff --git a/src/chains/filecoin/npm-shrinkwrap.json b/src/chains/filecoin/filecoin/npm-shrinkwrap.json similarity index 100% rename from src/chains/filecoin/npm-shrinkwrap.json rename to src/chains/filecoin/filecoin/npm-shrinkwrap.json diff --git a/src/chains/filecoin/package.json b/src/chains/filecoin/filecoin/package.json similarity index 98% rename from src/chains/filecoin/package.json rename to src/chains/filecoin/filecoin/package.json index d2a5245807..ccb147368a 100644 --- a/src/chains/filecoin/package.json +++ b/src/chains/filecoin/filecoin/package.json @@ -46,6 +46,7 @@ ], "dependencies": { "@filecoin-shipyard/lotus-client-schema": "0.0.12", + "@ganache/filecoin-options": "0.1.0", "@ganache/options": "0.1.0", "@ganache/utils": "0.1.0", "base32-encoding": "1.0.0", diff --git a/src/chains/filecoin/src/@types/@types/@filecoin-shipyard/lotus-client-schema/index.d.ts b/src/chains/filecoin/filecoin/src/@types/@types/@filecoin-shipyard/lotus-client-schema/index.d.ts similarity index 100% rename from src/chains/filecoin/src/@types/@types/@filecoin-shipyard/lotus-client-schema/index.d.ts rename to src/chains/filecoin/filecoin/src/@types/@types/@filecoin-shipyard/lotus-client-schema/index.d.ts diff --git a/src/chains/filecoin/src/@types/@types/base32-encoding/index.d.ts b/src/chains/filecoin/filecoin/src/@types/@types/base32-encoding/index.d.ts similarity index 100% rename from src/chains/filecoin/src/@types/@types/base32-encoding/index.d.ts rename to src/chains/filecoin/filecoin/src/@types/@types/base32-encoding/index.d.ts diff --git a/src/chains/filecoin/src/@types/@types/blakejs/index.d.ts b/src/chains/filecoin/filecoin/src/@types/@types/blakejs/index.d.ts similarity index 100% rename from src/chains/filecoin/src/@types/@types/blakejs/index.d.ts rename to src/chains/filecoin/filecoin/src/@types/@types/blakejs/index.d.ts diff --git a/src/chains/filecoin/src/@types/@types/borc/index.d.ts b/src/chains/filecoin/filecoin/src/@types/@types/borc/index.d.ts similarity index 100% rename from src/chains/filecoin/src/@types/@types/borc/index.d.ts rename to src/chains/filecoin/filecoin/src/@types/@types/borc/index.d.ts diff --git a/src/chains/filecoin/src/@types/@types/ipfs-http-client/index.d.ts b/src/chains/filecoin/filecoin/src/@types/@types/ipfs-http-client/index.d.ts similarity index 100% rename from src/chains/filecoin/src/@types/@types/ipfs-http-client/index.d.ts rename to src/chains/filecoin/filecoin/src/@types/@types/ipfs-http-client/index.d.ts diff --git a/src/chains/filecoin/src/@types/@types/ipld-dag-cbor/index.d.ts b/src/chains/filecoin/filecoin/src/@types/@types/ipld-dag-cbor/index.d.ts similarity index 100% rename from src/chains/filecoin/src/@types/@types/ipld-dag-cbor/index.d.ts rename to src/chains/filecoin/filecoin/src/@types/@types/ipld-dag-cbor/index.d.ts diff --git a/src/chains/filecoin/src/api.ts b/src/chains/filecoin/filecoin/src/api.ts similarity index 100% rename from src/chains/filecoin/src/api.ts rename to src/chains/filecoin/filecoin/src/api.ts diff --git a/src/chains/filecoin/src/blockchain.ts b/src/chains/filecoin/filecoin/src/blockchain.ts similarity index 99% rename from src/chains/filecoin/src/blockchain.ts rename to src/chains/filecoin/filecoin/src/blockchain.ts index 699d89eaab..2883b68ec4 100644 --- a/src/chains/filecoin/src/blockchain.ts +++ b/src/chains/filecoin/filecoin/src/blockchain.ts @@ -15,7 +15,7 @@ import dagCBOR from "ipld-dag-cbor"; import { RetrievalOffer } from "./things/retrieval-offer"; import seedrandom from "seedrandom"; import BN from "bn.js"; -import { FilecoinInternalOptions } from "./options"; +import { FilecoinInternalOptions } from "@ganache/filecoin-options"; export type BlockchainEvents = { ready(): void; diff --git a/src/chains/filecoin/src/connector.ts b/src/chains/filecoin/filecoin/src/connector.ts similarity index 96% rename from src/chains/filecoin/src/connector.ts rename to src/chains/filecoin/filecoin/src/connector.ts index ba558efb99..59ff08ae13 100644 --- a/src/chains/filecoin/src/connector.ts +++ b/src/chains/filecoin/filecoin/src/connector.ts @@ -3,7 +3,7 @@ import FilecoinApi from "./api"; import { JsonRpcTypes, types, utils, PromiEvent } from "@ganache/utils"; import FilecoinProvider from "./provider"; import { RecognizedString, HttpRequest } from "uWebSockets.js"; -import { FilecoinProviderOptions } from "./options"; +import { FilecoinProviderOptions } from "@ganache/filecoin-options"; export type ProviderOptions = FilecoinProviderOptions; export type Provider = FilecoinProvider; diff --git a/src/chains/filecoin/src/database.ts b/src/chains/filecoin/filecoin/src/database.ts similarity index 100% rename from src/chains/filecoin/src/database.ts rename to src/chains/filecoin/filecoin/src/database.ts diff --git a/src/chains/filecoin/src/deal-state.ts b/src/chains/filecoin/filecoin/src/deal-state.ts similarity index 100% rename from src/chains/filecoin/src/deal-state.ts rename to src/chains/filecoin/filecoin/src/deal-state.ts diff --git a/src/chains/filecoin/src/ipfs-server.ts b/src/chains/filecoin/filecoin/src/ipfs-server.ts similarity index 100% rename from src/chains/filecoin/src/ipfs-server.ts rename to src/chains/filecoin/filecoin/src/ipfs-server.ts diff --git a/src/chains/filecoin/src/provider.ts b/src/chains/filecoin/filecoin/src/provider.ts similarity index 96% rename from src/chains/filecoin/src/provider.ts rename to src/chains/filecoin/filecoin/src/provider.ts index 64b035d7d8..2e589288ed 100644 --- a/src/chains/filecoin/src/provider.ts +++ b/src/chains/filecoin/filecoin/src/provider.ts @@ -5,7 +5,10 @@ import FilecoinApi from "./api"; import GanacheSchema from "./schema"; import { Schema } from "@filecoin-shipyard/lotus-client-schema"; import Blockchain from "./blockchain"; -import { FilecoinOptionsConfig, FilecoinProviderOptions } from "./options"; +import { + FilecoinOptionsConfig, + FilecoinProviderOptions +} from "@ganache/filecoin-options"; // Meant to mimic this provider: // https://github.com/filecoin-shipyard/js-lotus-client-provider-browser diff --git a/src/chains/filecoin/src/schema.ts b/src/chains/filecoin/filecoin/src/schema.ts similarity index 100% rename from src/chains/filecoin/src/schema.ts rename to src/chains/filecoin/filecoin/src/schema.ts diff --git a/src/chains/filecoin/src/things/address.ts b/src/chains/filecoin/filecoin/src/things/address.ts similarity index 100% rename from src/chains/filecoin/src/things/address.ts rename to src/chains/filecoin/filecoin/src/things/address.ts diff --git a/src/chains/filecoin/src/things/balance.ts b/src/chains/filecoin/filecoin/src/things/balance.ts similarity index 100% rename from src/chains/filecoin/src/things/balance.ts rename to src/chains/filecoin/filecoin/src/things/balance.ts diff --git a/src/chains/filecoin/src/things/beacon-entry.ts b/src/chains/filecoin/filecoin/src/things/beacon-entry.ts similarity index 100% rename from src/chains/filecoin/src/things/beacon-entry.ts rename to src/chains/filecoin/filecoin/src/things/beacon-entry.ts diff --git a/src/chains/filecoin/src/things/block-signature.ts b/src/chains/filecoin/filecoin/src/things/block-signature.ts similarity index 100% rename from src/chains/filecoin/src/things/block-signature.ts rename to src/chains/filecoin/filecoin/src/things/block-signature.ts diff --git a/src/chains/filecoin/src/things/block.ts b/src/chains/filecoin/filecoin/src/things/block.ts similarity index 100% rename from src/chains/filecoin/src/things/block.ts rename to src/chains/filecoin/filecoin/src/things/block.ts diff --git a/src/chains/filecoin/src/things/bls-aggregate.ts b/src/chains/filecoin/filecoin/src/things/bls-aggregate.ts similarity index 100% rename from src/chains/filecoin/src/things/bls-aggregate.ts rename to src/chains/filecoin/filecoin/src/things/bls-aggregate.ts diff --git a/src/chains/filecoin/src/things/cid.ts b/src/chains/filecoin/filecoin/src/things/cid.ts similarity index 100% rename from src/chains/filecoin/src/things/cid.ts rename to src/chains/filecoin/filecoin/src/things/cid.ts diff --git a/src/chains/filecoin/src/things/deal.ts b/src/chains/filecoin/filecoin/src/things/deal.ts similarity index 100% rename from src/chains/filecoin/src/things/deal.ts rename to src/chains/filecoin/filecoin/src/things/deal.ts diff --git a/src/chains/filecoin/src/things/election-proof.ts b/src/chains/filecoin/filecoin/src/things/election-proof.ts similarity index 100% rename from src/chains/filecoin/src/things/election-proof.ts rename to src/chains/filecoin/filecoin/src/things/election-proof.ts diff --git a/src/chains/filecoin/src/things/miner.ts b/src/chains/filecoin/filecoin/src/things/miner.ts similarity index 100% rename from src/chains/filecoin/src/things/miner.ts rename to src/chains/filecoin/filecoin/src/things/miner.ts diff --git a/src/chains/filecoin/src/things/retrieval-offer.ts b/src/chains/filecoin/filecoin/src/things/retrieval-offer.ts similarity index 100% rename from src/chains/filecoin/src/things/retrieval-offer.ts rename to src/chains/filecoin/filecoin/src/things/retrieval-offer.ts diff --git a/src/chains/filecoin/src/things/root-cid.ts b/src/chains/filecoin/filecoin/src/things/root-cid.ts similarity index 100% rename from src/chains/filecoin/src/things/root-cid.ts rename to src/chains/filecoin/filecoin/src/things/root-cid.ts diff --git a/src/chains/filecoin/src/things/serializable-literal.ts b/src/chains/filecoin/filecoin/src/things/serializable-literal.ts similarity index 100% rename from src/chains/filecoin/src/things/serializable-literal.ts rename to src/chains/filecoin/filecoin/src/things/serializable-literal.ts diff --git a/src/chains/filecoin/src/things/serializable-object.ts b/src/chains/filecoin/filecoin/src/things/serializable-object.ts similarity index 100% rename from src/chains/filecoin/src/things/serializable-object.ts rename to src/chains/filecoin/filecoin/src/things/serializable-object.ts diff --git a/src/chains/filecoin/src/things/storage-proposal-data.ts b/src/chains/filecoin/filecoin/src/things/storage-proposal-data.ts similarity index 100% rename from src/chains/filecoin/src/things/storage-proposal-data.ts rename to src/chains/filecoin/filecoin/src/things/storage-proposal-data.ts diff --git a/src/chains/filecoin/src/things/storage-proposal.ts b/src/chains/filecoin/filecoin/src/things/storage-proposal.ts similarity index 100% rename from src/chains/filecoin/src/things/storage-proposal.ts rename to src/chains/filecoin/filecoin/src/things/storage-proposal.ts diff --git a/src/chains/filecoin/src/things/ticket.ts b/src/chains/filecoin/filecoin/src/things/ticket.ts similarity index 100% rename from src/chains/filecoin/src/things/ticket.ts rename to src/chains/filecoin/filecoin/src/things/ticket.ts diff --git a/src/chains/filecoin/src/things/tipset.ts b/src/chains/filecoin/filecoin/src/things/tipset.ts similarity index 100% rename from src/chains/filecoin/src/things/tipset.ts rename to src/chains/filecoin/filecoin/src/things/tipset.ts diff --git a/src/chains/filecoin/src/things/win-post-proof.ts b/src/chains/filecoin/filecoin/src/things/win-post-proof.ts similarity index 100% rename from src/chains/filecoin/src/things/win-post-proof.ts rename to src/chains/filecoin/filecoin/src/things/win-post-proof.ts diff --git a/src/chains/filecoin/tests/api/filecoin/filecoin.test.ts b/src/chains/filecoin/filecoin/tests/api/filecoin/filecoin.test.ts similarity index 100% rename from src/chains/filecoin/tests/api/filecoin/filecoin.test.ts rename to src/chains/filecoin/filecoin/tests/api/filecoin/filecoin.test.ts diff --git a/src/chains/filecoin/tests/blockchain/blockchain.test.ts b/src/chains/filecoin/filecoin/tests/blockchain/blockchain.test.ts similarity index 99% rename from src/chains/filecoin/tests/blockchain/blockchain.test.ts rename to src/chains/filecoin/filecoin/tests/blockchain/blockchain.test.ts index 3481d736db..ea252ea8f0 100644 --- a/src/chains/filecoin/tests/blockchain/blockchain.test.ts +++ b/src/chains/filecoin/filecoin/tests/blockchain/blockchain.test.ts @@ -7,7 +7,7 @@ import { StorageProposalData } from "../../src/things/storage-proposal-data"; import { RootCID } from "../../src/things/root-cid"; import { DealState } from "../../src/deal-state"; -import { FilecoinOptionsConfig } from "../../src/options/index"; +import { FilecoinOptionsConfig } from "@ganache/filecoin-options"; describe("Blockchain", () => { describe("general", () => { diff --git a/src/chains/filecoin/tests/helpers/getIpfsClient.ts b/src/chains/filecoin/filecoin/tests/helpers/getIpfsClient.ts similarity index 100% rename from src/chains/filecoin/tests/helpers/getIpfsClient.ts rename to src/chains/filecoin/filecoin/tests/helpers/getIpfsClient.ts diff --git a/src/chains/filecoin/tests/helpers/getProvider.ts b/src/chains/filecoin/filecoin/tests/helpers/getProvider.ts similarity index 71% rename from src/chains/filecoin/tests/helpers/getProvider.ts rename to src/chains/filecoin/filecoin/tests/helpers/getProvider.ts index 2680ccc8b8..45c2537f8b 100644 --- a/src/chains/filecoin/tests/helpers/getProvider.ts +++ b/src/chains/filecoin/filecoin/tests/helpers/getProvider.ts @@ -1,9 +1,9 @@ -import { RequestCoordinator, Executor } from "@ganache/utils/src/utils"; +import { utils } from "@ganache/utils"; import FilecoinProvider from "../../src/provider"; const getProvider = async () => { - const requestCoordinator = new RequestCoordinator(0); - const executor = new Executor(requestCoordinator); + const requestCoordinator = new utils.RequestCoordinator(0); + const executor = new utils.Executor(requestCoordinator); const provider = new FilecoinProvider( { chain: { diff --git a/src/chains/filecoin/tests/things/things.test.ts b/src/chains/filecoin/filecoin/tests/things/things.test.ts similarity index 100% rename from src/chains/filecoin/tests/things/things.test.ts rename to src/chains/filecoin/filecoin/tests/things/things.test.ts diff --git a/src/chains/filecoin/tsconfig.json b/src/chains/filecoin/filecoin/tsconfig.json similarity index 76% rename from src/chains/filecoin/tsconfig.json rename to src/chains/filecoin/filecoin/tsconfig.json index 0c41d652c6..c6014edc08 100644 --- a/src/chains/filecoin/tsconfig.json +++ b/src/chains/filecoin/filecoin/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.json", + "extends": "../../../../tsconfig.json", "compilerOptions": { "outDir": "lib" }, diff --git a/src/chains/filecoin/options/.npmignore b/src/chains/filecoin/options/.npmignore new file mode 100644 index 0000000000..115ab4f024 --- /dev/null +++ b/src/chains/filecoin/options/.npmignore @@ -0,0 +1,8 @@ +./index.ts +tests +.nyc_output +coverage +scripts +src +tsconfig.json +typedoc.json diff --git a/src/chains/filecoin/options/LICENSE b/src/chains/filecoin/options/LICENSE new file mode 100644 index 0000000000..39f3b14498 --- /dev/null +++ b/src/chains/filecoin/options/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2019-2020 Truffle Blockchain Group + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/chains/filecoin/options/README.md b/src/chains/filecoin/options/README.md new file mode 100644 index 0000000000..f999b39464 --- /dev/null +++ b/src/chains/filecoin/options/README.md @@ -0,0 +1,3 @@ +# `@ganache/filecoin-options` + +> TODO: description diff --git a/src/chains/filecoin/options/index.ts b/src/chains/filecoin/options/index.ts new file mode 100644 index 0000000000..248a7e4f2b --- /dev/null +++ b/src/chains/filecoin/options/index.ts @@ -0,0 +1,11 @@ +/*! + * @ganache/filecoin-options + * + * @copyright Truffle Blockchain Group + * @author Mike Seese + * @license MIT + */ + +export default { + // TODO +}; diff --git a/src/chains/filecoin/options/npm-shrinkwrap.json b/src/chains/filecoin/options/npm-shrinkwrap.json new file mode 100644 index 0000000000..1ec3ee5bd9 --- /dev/null +++ b/src/chains/filecoin/options/npm-shrinkwrap.json @@ -0,0 +1,13 @@ +{ + "name": "@ganache/filecoin-options", + "version": "0.1.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "seedrandom": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.5.tgz", + "integrity": "sha512-8OwmbklUNzwezjGInmZ+2clQmExQPvomqjL7LFqOYqtmuxRgQYqOD3mHaU+MvZn5FLUeVxVfQjwLZW/n/JFuqg==" + } + } +} diff --git a/src/chains/filecoin/options/package.json b/src/chains/filecoin/options/package.json new file mode 100644 index 0000000000..89ed8888f3 --- /dev/null +++ b/src/chains/filecoin/options/package.json @@ -0,0 +1,50 @@ +{ + "name": "@ganache/filecoin-options", + "version": "0.1.0", + "description": "", + "author": "ConsenSys", + "homepage": "https://github.com/trufflesuite/ganache-core/tree/develop/src/chains/filecoin/options#readme", + "license": "MIT", + "main": "lib/index.js", + "types": "src/index.ts", + "source": "index.ts", + "directories": { + "lib": "lib", + "test": "test" + }, + "files": [ + "lib" + ], + "repository": { + "type": "git", + "url": "https://github.com/trufflesuite/ganache-core.git", + "directory": "src/chains/filecoin/options" + }, + "scripts": { + "tsc": "ttsc", + "test": "nyc npm run mocha", + "mocha": "cross-env TS_NODE_COMPILER=ttypescript TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register 'tests/**/*.test.ts'" + }, + "bugs": { + "url": "https://github.com/trufflesuite/ganache-core/issues" + }, + "keywords": [ + "ganache", + "ganache-filecoin-options", + "ethereum", + "evm", + "blockchain", + "smart contracts", + "dapps", + "solidity", + "vyper", + "fe", + "web3", + "tooling", + "truffle" + ], + "dependencies": { + "@ganache/options": "0.1.0", + "seedrandom": "3.0.5" + } +} diff --git a/src/chains/filecoin/src/options/chain-options.ts b/src/chains/filecoin/options/src/chain-options.ts similarity index 100% rename from src/chains/filecoin/src/options/chain-options.ts rename to src/chains/filecoin/options/src/chain-options.ts diff --git a/src/chains/filecoin/src/options/helpers.ts b/src/chains/filecoin/options/src/helpers.ts similarity index 100% rename from src/chains/filecoin/src/options/helpers.ts rename to src/chains/filecoin/options/src/helpers.ts diff --git a/src/chains/filecoin/src/options/index.ts b/src/chains/filecoin/options/src/index.ts similarity index 100% rename from src/chains/filecoin/src/options/index.ts rename to src/chains/filecoin/options/src/index.ts diff --git a/src/chains/filecoin/src/options/logging-options.ts b/src/chains/filecoin/options/src/logging-options.ts similarity index 100% rename from src/chains/filecoin/src/options/logging-options.ts rename to src/chains/filecoin/options/src/logging-options.ts diff --git a/src/chains/filecoin/src/options/miner-options.ts b/src/chains/filecoin/options/src/miner-options.ts similarity index 100% rename from src/chains/filecoin/src/options/miner-options.ts rename to src/chains/filecoin/options/src/miner-options.ts diff --git a/src/chains/filecoin/src/options/wallet-options.ts b/src/chains/filecoin/options/src/wallet-options.ts similarity index 100% rename from src/chains/filecoin/src/options/wallet-options.ts rename to src/chains/filecoin/options/src/wallet-options.ts diff --git a/src/chains/filecoin/options/tests/index.test.ts b/src/chains/filecoin/options/tests/index.test.ts new file mode 100644 index 0000000000..db62a1cfe8 --- /dev/null +++ b/src/chains/filecoin/options/tests/index.test.ts @@ -0,0 +1,5 @@ +import assert from "assert"; + +describe("@ganache/filecoin-options", () => { + it("needs tests"); +}); diff --git a/src/chains/filecoin/options/tsconfig.json b/src/chains/filecoin/options/tsconfig.json new file mode 100644 index 0000000000..d36c0eb3ae --- /dev/null +++ b/src/chains/filecoin/options/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "outDir": "lib" + }, + "include": ["src"] +} diff --git a/src/chains/tezos/options/.npmignore b/src/chains/tezos/options/.npmignore new file mode 100644 index 0000000000..115ab4f024 --- /dev/null +++ b/src/chains/tezos/options/.npmignore @@ -0,0 +1,8 @@ +./index.ts +tests +.nyc_output +coverage +scripts +src +tsconfig.json +typedoc.json diff --git a/src/chains/tezos/options/LICENSE b/src/chains/tezos/options/LICENSE new file mode 100644 index 0000000000..39f3b14498 --- /dev/null +++ b/src/chains/tezos/options/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2019-2020 Truffle Blockchain Group + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/chains/tezos/options/README.md b/src/chains/tezos/options/README.md new file mode 100644 index 0000000000..cce550b5be --- /dev/null +++ b/src/chains/tezos/options/README.md @@ -0,0 +1,3 @@ +# `@ganache/tezos-options` + +> TODO: description diff --git a/src/chains/tezos/options/index.ts b/src/chains/tezos/options/index.ts new file mode 100644 index 0000000000..5f9f782b65 --- /dev/null +++ b/src/chains/tezos/options/index.ts @@ -0,0 +1,11 @@ +/*! + * @ganache/tezos-options + * + * @copyright Truffle Blockchain Group + * @author Mike Seese + * @license MIT + */ + +export default { + // TODO +}; diff --git a/src/chains/tezos/options/npm-shrinkwrap.json b/src/chains/tezos/options/npm-shrinkwrap.json new file mode 100644 index 0000000000..c807272a0c --- /dev/null +++ b/src/chains/tezos/options/npm-shrinkwrap.json @@ -0,0 +1 @@ +{"name":"@ganache/tezos-options","version":"0.1.0","lockfileVersion":1} diff --git a/src/chains/tezos/options/package.json b/src/chains/tezos/options/package.json new file mode 100644 index 0000000000..e437b7f836 --- /dev/null +++ b/src/chains/tezos/options/package.json @@ -0,0 +1,46 @@ +{ + "name": "@ganache/tezos-options", + "version": "0.1.0", + "description": "", + "author": "ConsenSys", + "homepage": "https://github.com/trufflesuite/ganache-core/tree/develop/src/chains/tezos/options#readme", + "license": "MIT", + "main": "lib/index.js", + "types": "src/index.ts", + "source": "index.ts", + "directories": { + "lib": "lib", + "test": "test" + }, + "files": [ + "lib" + ], + "repository": { + "type": "git", + "url": "https://github.com/trufflesuite/ganache-core.git", + "directory": "src/chains/tezos/options" + }, + "scripts": { + "tsc": "ttsc", + "test": "nyc npm run mocha", + "mocha": "cross-env TS_NODE_COMPILER=ttypescript TS_NODE_FILES=true mocha --exit --check-leaks --throw-deprecation --trace-warnings --require ts-node/register 'tests/**/*.test.ts'" + }, + "bugs": { + "url": "https://github.com/trufflesuite/ganache-core/issues" + }, + "keywords": [ + "ganache", + "ganache-tezos-options", + "ethereum", + "evm", + "blockchain", + "smart contracts", + "dapps", + "solidity", + "vyper", + "fe", + "web3", + "tooling", + "truffle" + ] +} diff --git a/src/chains/tezos/options/src/index.ts b/src/chains/tezos/options/src/index.ts new file mode 100644 index 0000000000..808108c3a8 --- /dev/null +++ b/src/chains/tezos/options/src/index.ts @@ -0,0 +1,3 @@ +export default { + // TODO +}; diff --git a/src/chains/tezos/options/tests/index.test.ts b/src/chains/tezos/options/tests/index.test.ts new file mode 100644 index 0000000000..6f98f6f53c --- /dev/null +++ b/src/chains/tezos/options/tests/index.test.ts @@ -0,0 +1,6 @@ +import assert from "assert"; +import tezosOptions from "../src/"; + +describe("@ganache/tezos-options", () => { + it("needs tests"); +}); diff --git a/src/chains/tezos/options/tsconfig.json b/src/chains/tezos/options/tsconfig.json new file mode 100644 index 0000000000..d36c0eb3ae --- /dev/null +++ b/src/chains/tezos/options/tsconfig.json @@ -0,0 +1,7 @@ +{ + "extends": "../../../../tsconfig.json", + "compilerOptions": { + "outDir": "lib" + }, + "include": ["src"] +} diff --git a/src/chains/tezos/tezos/.npmignore b/src/chains/tezos/tezos/.npmignore new file mode 100644 index 0000000000..115ab4f024 --- /dev/null +++ b/src/chains/tezos/tezos/.npmignore @@ -0,0 +1,8 @@ +./index.ts +tests +.nyc_output +coverage +scripts +src +tsconfig.json +typedoc.json diff --git a/src/chains/tezos/tezos/LICENSE b/src/chains/tezos/tezos/LICENSE new file mode 100644 index 0000000000..39f3b14498 --- /dev/null +++ b/src/chains/tezos/tezos/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2019-2020 Truffle Blockchain Group + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/src/chains/tezos/README.md b/src/chains/tezos/tezos/README.md similarity index 100% rename from src/chains/tezos/README.md rename to src/chains/tezos/tezos/README.md diff --git a/src/chains/tezos/index.ts b/src/chains/tezos/tezos/index.ts similarity index 100% rename from src/chains/tezos/index.ts rename to src/chains/tezos/tezos/index.ts diff --git a/src/chains/tezos/npm-shrinkwrap.json b/src/chains/tezos/tezos/npm-shrinkwrap.json similarity index 100% rename from src/chains/tezos/npm-shrinkwrap.json rename to src/chains/tezos/tezos/npm-shrinkwrap.json diff --git a/src/chains/tezos/package.json b/src/chains/tezos/tezos/package.json similarity index 100% rename from src/chains/tezos/package.json rename to src/chains/tezos/tezos/package.json diff --git a/src/chains/tezos/src/api.ts b/src/chains/tezos/tezos/src/api.ts similarity index 100% rename from src/chains/tezos/src/api.ts rename to src/chains/tezos/tezos/src/api.ts diff --git a/src/chains/tezos/src/provider.ts b/src/chains/tezos/tezos/src/provider.ts similarity index 100% rename from src/chains/tezos/src/provider.ts rename to src/chains/tezos/tezos/src/provider.ts diff --git a/src/chains/tezos/tests/index.test.ts b/src/chains/tezos/tezos/tests/index.test.ts similarity index 100% rename from src/chains/tezos/tests/index.test.ts rename to src/chains/tezos/tezos/tests/index.test.ts diff --git a/src/chains/tezos/tsconfig.json b/src/chains/tezos/tezos/tsconfig.json similarity index 65% rename from src/chains/tezos/tsconfig.json rename to src/chains/tezos/tezos/tsconfig.json index 25d5c3cf7e..b215880a1c 100644 --- a/src/chains/tezos/tsconfig.json +++ b/src/chains/tezos/tezos/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.json", + "extends": "../../../../tsconfig.json", "compilerOptions": { "outDir": "lib" }, diff --git a/src/chains/tezos/typedoc.json b/src/chains/tezos/tezos/typedoc.json similarity index 100% rename from src/chains/tezos/typedoc.json rename to src/chains/tezos/tezos/typedoc.json