git clone https://github.com/functionalfoundry/ethereum-htlc
cd ethereum-htlc/
sudo npm i -g ethereumjs-testrpc truffle
testrpc --account="0x22e2ba90f06cb8ba247347e2eff9a3488f71ff76c7110672e117ecb228be80b6,100000000000000000000" --account="0x1b79656d6bd43e7cfd1669885ff8826ba6fb8d8b5d5b16e7fc41c2812ccdbf8d,100000000000000000000"
then in 2nd terminal
npm install
truffle test
Compiling ./contracts/HTLC.sol...
Compiling ./contracts/Migrations.sol...
Compiling zeppelin-solidity/contracts/ReentrancyGuard.sol...
Compilation warnings encountered:
.../ethereum-htlc/contracts/HTLC.sol:35:5: Warning: No visibility specified. Defaulting to "public".
function HTLC (address _recipient, bytes32 _image, uint _expirationTime) payable {
^
Spanning multiple lines.
,.../ethereum-htlc/contracts/Migrations.sol:14:5: Warning: No visibility specified. Defaulting to "public".
function Migrations() {
^
Spanning multiple lines.
,.../ethereum-htlc/contracts/Migrations.sol:18:5: Warning: No visibility specified. Defaulting to "public".
function setCompleted(uint completed) restricted {
^
Spanning multiple lines.
,.../ethereum-htlc/contracts/Migrations.sol:22:5: Warning: No visibility specified. Defaulting to "public".
function upgrade(address newAddress) restricted {
^
Spanning multiple lines.
,.../ethereum-htlc/contracts/HTLC.sol:113:5: Warning: Function state mutability can be restricted to pure
function hash (bytes32 _preimage) internal returns (bytes32 _image) {
^
Spanning multiple lines.
Error: Error: Exceeds block gas limit
at StateManager.queueTransaction (/usr/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:84915:21)
at GethApiDouble.eth_sendTransaction (/usr/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:84423:14)
at GethApiDouble.handleRequest (/usr/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:84222:10)
at next (/usr/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:53732:18)
at GethDefaults.handleRequest (/usr/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:84119:12)
at next (/usr/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:53732:18)
at FilterSubprovider.handleRequest (/usr/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:60186:7)
at next (/usr/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:53732:18)
at DelayedBlockFilter.handleRequest (/usr/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:83947:3)
at next (/usr/lib/node_modules/ethereumjs-testrpc/build/cli.node.js:53732:18)
at Object.InvalidResponse (/usr/lib/node_modules/truffle/build/cli.bundled.js:43303:16)
at /usr/lib/node_modules/truffle/build/cli.bundled.js:331156:36
at /usr/lib/node_modules/truffle/build/cli.bundled.js:175492:11
at /usr/lib/node_modules/truffle/build/cli.bundled.js:314196:9
at XMLHttpRequest.request.onreadystatechange (/usr/lib/node_modules/truffle/build/cli.bundled.js:315621:13)
at XMLHttpRequestEventTarget.dispatchEvent (/usr/lib/node_modules/truffle/build/cli.bundled.js:70159:18)
at XMLHttpRequest._setReadyState (/usr/lib/node_modules/truffle/build/cli.bundled.js:70449:12)
at XMLHttpRequest._onHttpResponseEnd (/usr/lib/node_modules/truffle/build/cli.bundled.js:70604:12)
at IncomingMessage.<anonymous> (/usr/lib/node_modules/truffle/build/cli.bundled.js:70564:24)
at emitNone (events.js:91:20)
then in 2nd terminal
testrpc log shows this:
versions: