Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
eth-gas-reporter
Advanced tools
A Mocha reporter for Ethereum test suites:
npm install --save-dev eth-gas-reporter
/* truffle-config.js */
module.exports = {
networks: { ... },
mocha: {
reporter: 'eth-gas-reporter',
reporterOptions : { ... } // See options below
}
};
npm install --save-dev buidler-gas-reporter
/* buidler.config.js */
usePlugin('buidler-gas-reporter');
module.exports = {
networks: { ... },
gasReporter: { ... } // See options below
};
Other
This reporter should work with any build platform that uses Mocha and connects to an Ethereum client running as a separate process. There's more on advanced use cases here.
This reporter comes with a codechecks CI integration that displays a pull request's gas consumption changes relative to its target branch in the Github UI. It's like coveralls for gas. The codechecks service is free for open source and maintained by MakerDao engineer @krzkaczor.
Complete set-up guide here (it's easy).
Option | Type | Default | Description |
---|---|---|---|
currency | String | 'EUR' | National currency to represent gas costs in. Exchange rates loaded at runtime from the coinmarketcap api. Available currency codes can be found here. |
gasPrice | Number | (varies) | Denominated in gwei . Default is loaded at runtime from the eth gas station api |
outputFile | String | stdout | File path to write report output to |
noColors | Boolean | false | Suppress report color. Useful if you are printing to file b/c terminal colorization corrupts the text. |
onlyCalledMethods | Boolean | true | Omit methods that are never called from report. |
rst | Boolean | false | Output with a reStructured text code-block directive. Useful if you want to include report in RTD |
rstTitle | String | "" | Title for reStructured text header (See Travis for example output) |
showTimeSpent | Boolean | false | Show the amount of time spent as well as the gas consumed |
excludeContracts | String[] | [] | Contract names to exclude from report. Ex: ['Migrations'] |
src | String | "contracts" | Folder in root directory to begin search for .sol files. This can also be a path to a subfolder relative to the root, e.g. "planets/annares/contracts" |
url | String | web3.currentProvider.host | RPC client url (ex: "http://localhost:8545") |
proxyResolver | Function | none | Custom method to resolve identity of methods managed by a proxy contract. |
artifactType | Function or String | "truffle-v5" | Compilation artifact format to consume. (See advanced use.) |
An advanced use guide is available here. Topics include:
ganache-core
as an in-process provider for your test suite. The reporter makes sync RPC calls
while collecting data and your tests will hang unless the client is launched as a separate process.Feel free to open PRs or issues. There is an integration test and one of the mock test cases is expected to fail. If you're adding an option, you can vaildate it in CI by adding it to the mock options config located here.
All the ideas in this utility have been borrowed from elsewhere. Many thanks to:
ico-contracts
test suite.FAQs
Mocha reporter which shows gas used per unit test.
The npm package eth-gas-reporter receives a total of 52,447 weekly downloads. As such, eth-gas-reporter popularity was classified as popular.
We found that eth-gas-reporter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.