3.0.0 • Published 5 years ago

web3studio-helpers v3.0.0

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
5 years ago

This project contains common code used to bootstrap tests and common scripts.

Truffle Setup

Create a truffle-config.js, and a global test setup file.

// truffle-config.js
module.exports = require('web3studio-helpers/truffle-config')(__dirname, {
  // defaults
  mainnetGasPrice: '0',
  solcVersion: '0.5.4',
  ignoreFilesGlobs: ['**/node_modules/**', '**/Migrations.sol']
});
// test/global.js
require('web3studio-helpers/truffleTestGlobals');

For coverage requirements, drop a .istanbul.yml file in the root of the package:

# .istanbul.yml
check:
  global:
    statements: 100
    lines: 100
    branches: 100
    functions: 100

Environment Variables

You'll need to set some environment variables to use the config on a testnet or mainnet. You can do so either via your shell or with a .env file

# .env
INFURA_API_KEY="<YOUR_INFURA_KEY>"
SEED_PHRASE="<YOUR_WALLET_SEED_PHRASE>"

License

Apache 2.0