joshma91 / avocado

3 stars 0 forks source link

Person contract #10

Closed adrianmcli closed 6 years ago

adrianmcli commented 6 years ago

I took the last two commits (made by @kendricktan) and moved them onto this branch instead. This way, we can discuss as we go along.

Fixes #9

adrianmcli commented 6 years ago

@joshma91 I'm getting errors running the tests. Here are the errors:

Compiling ./contracts/SimpleStorage.sol...
Compiling ./test/TestSimpleStorage.sol...
Compiling truffle/Assert.sol...
Compiling truffle/DeployedAddresses.sol...

  TestSimpleStorage
    ✓ testItStoresAValue (98ms)

  Contract: Avocado
    1) should return the teacher & student names
    > No events were emitted
    2) should return addresses with specified tag
    > No events were emitted
0xef2c67c9b464a7aea837a4eb42191bb668a8145152f4f980230e705cf9047407
    ✓ should return the meeting description (531ms)

  Contract: SimpleStorage
    ✓ ...should store the value 89. (73ms)

  3 passing (1s)
  2 failing

  1) Contract: Avocado should return the teacher & student names:
     TypeError: Cannot read property 'fromAscii' of undefined
      at teacher.tags.map.x (test/avocado.js:28:60)
      at Array.map (<anonymous>)
      at Context.it (test/avocado.js:28:40)
      at <anonymous>
      at process._tickDomainCallback (internal/process/next_tick.js:228:7)

  2) Contract: Avocado should return addresses with specified tag:
     TypeError: Cannot read property 'fromAscii' of undefined
      at Context.it (test/avocado.js:48:48)
      at <anonymous>
      at process._tickDomainCallback (internal/process/next_tick.js:228:7)
kendricktan commented 6 years ago

@adrianmcli yep same error

adrianmcli commented 6 years ago

@joshma91 I had to remove your web3 dependency. Since you were only using one function, I just copy and pasted it into a utils.js file and required it from there. The tests were failing because it was using our globally installed web3 and it wasn't finding the utils.

joshma91 commented 6 years ago

The newest commits complete testing for Avocado.sol end-end. Tests completed & successful:

Todo: More robust testing of payments/time tracking.