https://github.com/vitiko/solidity-test-util
https://github.com/vitiko/solidity-test-util
contract-testing ethereum solidity testrpc
Last synced: 28 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/vitiko/solidity-test-util
- Owner: vitiko
- Created: 2017-01-30T14:23:03.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-27T08:27:37.000Z (over 8 years ago)
- Last Synced: 2025-10-08T09:48:45.632Z (5 months ago)
- Topics: contract-testing, ethereum, solidity, testrpc
- Language: JavaScript
- Size: 8.79 KB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Solidity-test-util
A collection of utility functions for testing ethereum contracts with [truffle framework](https://github.com/Consensys/truffle) and [testrpc](https://github.com/ethereumjs/testrpc).
Examples can be found on [Github solidity-test-example project](https://github.com/vitiko/solidity-test-example/blob/master/test/CongressWithTestUtil.js)
## getEventLog
**Parameters**
- `Object` Contract events subscriber, [see web3 doc](https://github.com/ethereum/wiki/wiki/JavaScript-API#contract-events)
**Returns**
- `Array` Events
## assertThrow
**Parameters**
- `Callback` with contract method call, that should throw exception
**Returns**
- `Boolean` exception throwed
## evmIncreaseTime
Jump testrpc forward in time
**Parameters**
- `Number` amount of time to increase in seconds
**Returns**
- `Number` total time adjustment, in seconds.
## prepareValue
Convert `BigNumber` value to `Number` using toNumber() method
**Parameters**
- `Mixed`
**Returns**
- `Mixed`
## prepareArray
Convert `BigNumber` array values to `Number` using toNumber() method
**Parameters**
- `Array`
**Returns**
- `Array`
## prepareObject
Convert `BigNumber` object values to `Number` using toNumber() method
**Parameters**
- `Object`
**Returns**
- `Object`