Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chaintope/contract-coverager
Coverage tool for SmartContract
https://github.com/chaintope/contract-coverager
abi coverage ethereum smart-contract solidity vyper
Last synced: 1 day ago
JSON representation
Coverage tool for SmartContract
- Host: GitHub
- URL: https://github.com/chaintope/contract-coverager
- Owner: chaintope
- License: gpl-3.0
- Created: 2019-05-05T03:04:48.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T05:14:09.000Z (almost 2 years ago)
- Last Synced: 2024-10-16T09:29:17.648Z (about 1 month ago)
- Topics: abi, coverage, ethereum, smart-contract, solidity, vyper
- Language: JavaScript
- Size: 964 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Name
====Overview
## Description
Coverage Tool for SmartContract.
Analayzing based on bytecodes and abi specification for functions.## Requirement
Truffle v5.0.14 or higher.```
## Install
`npm install contract-coverage`## Usage
Add following code in your truffle test cases:
```js
const CoverageSubprovider = require('contract-coverager')
const engine = CoverageSubprovider.injectInTruffle(artifacts, web3)
```and define before, after hook code:
```js
before(() => engine.start())
after(() => engine.stop())
```example code overall:
```js
const CoverageSubprovider = require('contract-coverager')
const engine = CoverageSubprovider.injectInTruffle(artifacts, web3)
const VyperStorage = artifacts.require("VyperStorage")contract("VyperStorage", (accounts) => {
before(() => engine.start())
after(() => engine.stop())it("...should store the value 89.", async () => {
const storage = await VyperStorage.new()// Set value of 89
const receipt = await storage.set(89)
// Get stored value
const storedData = await storage.get()
assert.equal(storedData, 89, "The value 89 was not stored.")
})
})
```## CAUTION
if request method is eth_call, then this Lib re-request eth_sendTransaction with same params, for getting traceLogs.
so that, in using this coverage tool, more gas is consumes. may `out of gas` error a lot of happen.## Demo
![](https://user-images.githubusercontent.com/1563840/58031554-9b583380-7b5b-11e9-80ee-a87cead6d210.png)## Not yet support list
- Solidity's Contract (maybe available, but not tested)## Licence
[GPLv3](https://github.com/nakajo2011/contract-coverage/blob/master/LICENCE)## Author
[nakajo2011](https://github.com/nakajo2011)