How to use the ethereumjs-wallet/package.json.version function in ethereumjs-wallet

To help you get started, we’ve selected a few ethereumjs-wallet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github trufflesuite / ganache-core / index.js View on Github external
// make sourcemaps work!
require("source-map-support/register");

const debug = require("debug")("ganache");

// we use optional dependencies which may, or may not exist, so try native first
try {
  // make sure these exist before we try to load ganache with native modules
  const optionalDependencies = require("./package.json").optionalDependencies;
  const wrongWeb3 = require("web3/package.json").version !== optionalDependencies["web3"];
  const wrongEthereumJs = require(
    "ethereumjs-wallet/package.json"
  ).version !== optionalDependencies["ethereumjs-wallet"];
  if (wrongWeb3 || wrongEthereumJs) {
    useBundled();
  } else {
    module.exports = require("./public-exports.js");
    module.exports._webpacked = false;
    debug("Optional dependencies installed; exporting ganache-core with native optional dependencies.");
  }
} catch (nativeError) {
  debug(nativeError);

  // grabbing the native/optional deps failed, try using our webpacked build.
  useBundled();
}