Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VolumeRestrictionTM #421

Merged
merged 71 commits into from
Jan 3, 2019
Merged

VolumeRestrictionTM #421

merged 71 commits into from
Jan 3, 2019

Conversation

satyamakgec
Copy link
Contributor

@satyamakgec satyamakgec commented Nov 20, 2018

  • Test suite

  • Global check

  • Algorithm optimizations

  • Adding read functionality using verifyTransfer()

@satyamakgec satyamakgec changed the title VolumeRestrictionTM [WIP]:VolumeRestrictionTM Nov 20, 2018
@satyamakgec satyamakgec changed the title [WIP]:VolumeRestrictionTM [WIP]VolumeRestrictionTM Nov 20, 2018
@satyamakgec satyamakgec changed the title [WIP]VolumeRestrictionTM VolumeRestrictionTM Nov 25, 2018
@maxsam4
Copy link
Contributor

maxsam4 commented Dec 12, 2018

Travis failed again while local tests passed
Travis output

4 failing
  1) Contract: VolumeRestrictionTransferManager
       Test cases for the Default restrictions
         Should transfer the tokens freely after ending the default daily restriction:
     Error: VM Exception while processing transaction: revert Transfer invalid
      at Object.InvalidResponse (node_modules/truffle/build/webpack:/~/web3/lib/web3/errors.js:38:1)
      at node_modules/truffle/build/webpack:/~/web3/lib/web3/requestmanager.js:86:1
      at node_modules/truffle/build/webpack:/packages/truffle-provider/wrapper.js:134:1
      at XMLHttpRequest.request.onreadystatechange (node_modules/truffle/build/webpack:/~/web3/lib/web3/httpprovider.js:128:1)
      at XMLHttpRequestEventTarget.dispatchEvent (node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:64:1)
      at XMLHttpRequest._setReadyState (node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:354:1)
      at XMLHttpRequest._onHttpResponseEnd (node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:509:1)
      at IncomingMessage.<anonymous> (node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:469:1)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)
  2) Contract: VolumeRestrictionTransferManager
       Test cases for the Default restrictions
         Should transfer tokens on by investor 3 (comes under the Default restriction):
     Error: VM Exception while processing transaction: revert
      at Object.InvalidResponse (node_modules/truffle/build/webpack:/~/web3/lib/web3/errors.js:38:1)
      at node_modules/truffle/build/webpack:/~/web3/lib/web3/requestmanager.js:86:1
      at node_modules/truffle/build/webpack:/packages/truffle-provider/wrapper.js:134:1
      at XMLHttpRequest.request.onreadystatechange (node_modules/truffle/build/webpack:/~/web3/lib/web3/httpprovider.js:128:1)
      at XMLHttpRequestEventTarget.dispatchEvent (node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:64:1)
      at XMLHttpRequest._setReadyState (node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:354:1)
      at XMLHttpRequest._onHttpResponseEnd (node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:509:1)
      at IncomingMessage.<anonymous> (node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:469:1)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)
  3) Contract: VolumeRestrictionTransferManager
       Test cases for the Default restrictions
         Should able to transfer tokens in the next rolling period:
     Error: VM Exception while processing transaction: revert
      at Object.InvalidResponse (node_modules/truffle/build/webpack:/~/web3/lib/web3/errors.js:38:1)
      at node_modules/truffle/build/webpack:/~/web3/lib/web3/requestmanager.js:86:1
      at node_modules/truffle/build/webpack:/packages/truffle-provider/wrapper.js:134:1
      at XMLHttpRequest.request.onreadystatechange (node_modules/truffle/build/webpack:/~/web3/lib/web3/httpprovider.js:128:1)
      at XMLHttpRequestEventTarget.dispatchEvent (node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:64:1)
      at XMLHttpRequest._setReadyState (node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:354:1)
      at XMLHttpRequest._onHttpResponseEnd (node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:509:1)
      at IncomingMessage.<anonymous> (node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:469:1)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)
  4) Contract: VolumeRestrictionTransferManager
       Test cases for the Default restrictions
         Should able to transfer tokens within the limit of (daily default + default) restriction:
     Error: VM Exception while processing transaction: revert
      at Object.InvalidResponse (node_modules/truffle/build/webpack:/~/web3/lib/web3/errors.js:38:1)
      at node_modules/truffle/build/webpack:/~/web3/lib/web3/requestmanager.js:86:1
      at node_modules/truffle/build/webpack:/packages/truffle-provider/wrapper.js:134:1
      at XMLHttpRequest.request.onreadystatechange (node_modules/truffle/build/webpack:/~/web3/lib/web3/httpprovider.js:128:1)
      at XMLHttpRequestEventTarget.dispatchEvent (node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:64:1)
      at XMLHttpRequest._setReadyState (node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:354:1)
      at XMLHttpRequest._onHttpResponseEnd (node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:509:1)
      at IncomingMessage.<anonymous> (node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:469:1)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)

Copy link
Contributor

@maxsam4 maxsam4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's first figure out why Travis is failing sometimes. Is there an edge case that is time-based and is causing the failure? or is it just Travis being Travis.

@maxsam4
Copy link
Contributor

maxsam4 commented Dec 12, 2018

It's definitely an edge case.
Edge case in either the smart contract code or time travel in test code.

After 6 successful runs, it finally failed on my local. Trying to debug now.
@satyamakgec keep spamming tests till you get an error 📦

below is output from my local. It is different from Travis's last output.

  5 failing

  1) Contract: VolumeRestrictionTransferManager
       Test cases for the Default restrictions
         Should transfer the tokens freely after ending the default daily restriction:
     Error: VM Exception while processing transaction: revert Transfer invalid
      at Object.InvalidResponse (/home/max/.nvm/versions/node/v8.12.0/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/errors.js:38:1)
      at /home/max/.nvm/versions/node/v8.12.0/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/requestmanager.js:86:1
      at /home/max/.nvm/versions/node/v8.12.0/lib/node_modules/truffle/build/webpack:/packages/truffle-provider/wrapper.js:134:1
      at XMLHttpRequest.request.onreadystatechange (/home/max/.nvm/versions/node/v8.12.0/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/httpprovider.js:128:1)
      at XMLHttpRequestEventTarget.dispatchEvent (/home/max/.nvm/versions/node/v8.12.0/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:64:1)
      at XMLHttpRequest._setReadyState (/home/max/.nvm/versions/node/v8.12.0/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:354:1)
      at XMLHttpRequest._onHttpResponseEnd (/home/max/.nvm/versions/node/v8.12.0/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:509:1)
      at IncomingMessage.<anonymous> (/home/max/.nvm/versions/node/v8.12.0/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:469:1)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  2) Contract: VolumeRestrictionTransferManager
       Test cases for the Default restrictions
         Should transfer tokens on by investor 3 (comes under the Default restriction):
     Error: VM Exception while processing transaction: revert Transfer invalid
      at Object.InvalidResponse (/home/max/.nvm/versions/node/v8.12.0/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/errors.js:38:1)
      at /home/max/.nvm/versions/node/v8.12.0/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/requestmanager.js:86:1
      at /home/max/.nvm/versions/node/v8.12.0/lib/node_modules/truffle/build/webpack:/packages/truffle-provider/wrapper.js:134:1
      at XMLHttpRequest.request.onreadystatechange (/home/max/.nvm/versions/node/v8.12.0/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/httpprovider.js:128:1)
      at XMLHttpRequestEventTarget.dispatchEvent (/home/max/.nvm/versions/node/v8.12.0/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:64:1)
      at XMLHttpRequest._setReadyState (/home/max/.nvm/versions/node/v8.12.0/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:354:1)
      at XMLHttpRequest._onHttpResponseEnd (/home/max/.nvm/versions/node/v8.12.0/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:509:1)
      at IncomingMessage.<anonymous> (/home/max/.nvm/versions/node/v8.12.0/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:469:1)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  3) Contract: VolumeRestrictionTransferManager
       Test cases for the Default restrictions
         Should fail to transfer more tokens than the available default limit:
     AssertionError: Expected an error but did not get one
      at _callee$ (test/helpers/exceptions.js:9:9)
      at tryCatch (node_modules/regenerator-runtime/runtime.js:65:40)
      at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:303:22)
      at Generator.prototype.(anonymous function) [as next] (node_modules/regenerator-runtime/runtime.js:117:21)
      at step (test/helpers/exceptions.js:40:191)
      at test/helpers/exceptions.js:40:361
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:189:7)

  4) Contract: VolumeRestrictionTransferManager
       Test cases for the Default restrictions
         Should able to transfer tokens in the next rolling period:
     Error: VM Exception while processing transaction: revert
      at Object.InvalidResponse (/home/max/.nvm/versions/node/v8.12.0/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/errors.js:38:1)
      at /home/max/.nvm/versions/node/v8.12.0/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/requestmanager.js:86:1
      at /home/max/.nvm/versions/node/v8.12.0/lib/node_modules/truffle/build/webpack:/packages/truffle-provider/wrapper.js:134:1
      at XMLHttpRequest.request.onreadystatechange (/home/max/.nvm/versions/node/v8.12.0/lib/node_modules/truffle/build/webpack:/~/web3/lib/web3/httpprovider.js:128:1)
      at XMLHttpRequestEventTarget.dispatchEvent (/home/max/.nvm/versions/node/v8.12.0/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:64:1)
      at XMLHttpRequest._setReadyState (/home/max/.nvm/versions/node/v8.12.0/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:354:1)
      at XMLHttpRequest._onHttpResponseEnd (/home/max/.nvm/versions/node/v8.12.0/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:509:1)
      at IncomingMessage.<anonymous> (/home/max/.nvm/versions/node/v8.12.0/lib/node_modules/truffle/build/webpack:/~/xhr2/lib/xhr2.js:469:1)
      at endReadableNT (_stream_readable.js:1064:12)
      at _combinedTickCallback (internal/process/next_tick.js:139:11)
      at process._tickCallback (internal/process/next_tick.js:181:9)

  5) Contract: VolumeRestrictionTransferManager
       Test cases for the Default restrictions
         Should able to transfer tokens within the limit of (daily default + default) restriction:

      AssertionError: expected 5 to equal 6
      + expected - actual

      -5
      +6
      
      at _callee79$ (test/y_volume_restriction_tm.js:1448:20)
      at tryCatch (node_modules/regenerator-runtime/runtime.js:65:40)
      at Generator.invoke [as _invoke] (node_modules/regenerator-runtime/runtime.js:303:22)
      at Generator.prototype.(anonymous function) [as next] (node_modules/regenerator-runtime/runtime.js:117:21)
      at step (test/y_volume_restriction_tm.js:23:191)
      at test/y_volume_restriction_tm.js:23:361
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:189:7)

@maxsam4
Copy link
Contributor

maxsam4 commented Dec 21, 2018

Approved the solidity code

@coveralls
Copy link

Coverage Status

Coverage decreased (-1.5%) to 96.228% when pulling 6354748 on volTM-module into c4a0af6 on dev-2.1.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants