TrueBitFoundation / incentive-layer

[DEPRECATED] Incentive layer contracts and deployment information.
31 stars 20 forks source link

Tests only pass when run individually #7

Closed hswick closed 6 years ago

hswick commented 7 years ago

If you run truffle test you will get an invalid opcode. But if you test each file they will run fine.

I believe this is because of how I am creating taskID with an incrementing integer. A hash of some constant hash data might suffice.

Thinking something like this:

bytes32 taskID  = sha3(task_giver_address, minDeposit, timeoutBlock);
shrugs commented 7 years ago

I've seen a lot of contracts that use an autoincrementing id... namely 0x; might be worth checking to see if they have/had the same problem?

hswick commented 6 years ago

I changed the taskID to a hash like I commented above. this solves the invalid opcode issue which is an improvement. However I still get this weird error: Uncaught Error: LevelUpArrayAdapter named 'blockLogs' index out of range: index 7; length: 7

It seems I am not the only one with this issue. https://github.com/ethereumjs/testrpc/issues/346. When switching to the next test the testrpc+promises freak out. Fairly certain there is an issue with how I am waiting for the promises.