functionalfoundry / ethereum-htlc

HTLC for doing cross-chain atomic swaps
MIT License
7 stars 2 forks source link

SyntaxError: Identifier 'to32' has already been declared #7

Open drandreaskrueger opened 6 years ago

drandreaskrueger commented 6 years ago

after solving that issue (so still identical setup & versions) ... I have a new problem:

truffle test

Compiling ./contracts/HTLC.sol...
Compiling ./contracts/Migrations.sol...
Compiling zeppelin-solidity/contracts/ReentrancyGuard.sol...

Compilation warnings encountered:

[... warnings omitted ...]

.../ethereum-htlc/test/htlc.js:34
const to32 = buffer => `0x${pad(buffer, 64, '0')}`
                                                ^^

SyntaxError: Identifier 'to32' has already been declared
    at createScript (vm.js:56:10)
    at Object.runInThisContext (vm.js:97:10)
    at Module._compile (module.js:542:28)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at /usr/lib/node_modules/truffle/node_modules/mocha/lib/mocha.js:231:27
drandreaskrueger commented 6 years ago

line 16 https://github.com/functionalfoundry/ethereum-htlc/blob/a15185713b451f33a71afcc77c65616f60054c3e/test/htlc.js#L16

vs

line 32 https://github.com/functionalfoundry/ethereum-htlc/blob/a15185713b451f33a71afcc77c65616f60054c3e/test/htlc.js#L34

drandreaskrueger commented 6 years ago

as to32 was only used in line 110, I commented out line 16.

that solved that.