vechain / crowdsale-contracts

Smart contracts to support VeChain's token sale
MIT License
24 stars 17 forks source link

Truffle test failed. #5

Closed laalaguer closed 6 years ago

laalaguer commented 6 years ago

Hi,

I have a local setup of the following running: 1) Vechain testnet connection: docker run --rm -v /Users/thomasjefferson/vechain/vechain-test-data/.org.vechain.thor:/root/.org.vechain.thor -p 127.0.0.1:8669:8669 -p 11235:11235/udp --name thor-node vechain/thor --api-addr 0.0.0.0:8669 --network test

2) Web3-gear web3-gear

When I clone this repo and do the following:

npm intall
truffle develop
> test

I have the following tests failed:

  Contract: MockedExchange
exchange address=   0x9fbda871d559710256a2502a2517b794b482db40
ven address=    0x2c2b9c9a4a25e24b174f26114e8926a9f2128fe4
account[0] balance is   99.1790995
account[1] balance is   100
account[2] balance is   100
account[3] balance is   100
    ✓ deploy (649ms)
    ✓ setToken (88ms)
    ✓ setRate (100ms)
    ✓ setTokenQuota (106ms)
    ✓ setTokenToEtherAllowed (92ms)
    ✓ withdrawEther (266ms)
    1) receiveApproval

    Events emitted during test:
    ---------------------------

    Transfer(_from: <indexed>, _to: <indexed>, _value: 402500)
    Transfer(_from: <indexed>, _to: <indexed>, _value: 402510)
    Transfer(_from: <indexed>, _to: <indexed>, _value: 805000)
    Transfer(_from: <indexed>, _to: <indexed>, _value: 1207500)
    Approval(_owner: <indexed>, _spender: <indexed>, _value: 201250)
    Transfer(_from: <indexed>, _to: <indexed>, _value: 201250)
    onExchangeTokenToEther(who: 0x627306090abab3a6e1400e9345bc60c78a8bef57, tokenAmount: 201250, etherAmount: 50)
    Approval(_owner: <indexed>, _spender: <indexed>, _value: 201250)
    Transfer(_from: <indexed>, _to: <indexed>, _value: 201250)
    onExchangeTokenToEther(who: 0x627306090abab3a6e1400e9345bc60c78a8bef57, tokenAmount: 201250, etherAmount: 50)
    Approval(_owner: <indexed>, _spender: <indexed>, _value: 402510)
    Transfer(_from: <indexed>, _to: <indexed>, _value: 402500)
    onExchangeTokenToEther(who: 0xf17f52151ebef6c7334fad080c5704d77216b732, tokenAmount: 402500, etherAmount: 100)

    ---------------------------
    ✓ withdrawToken (51ms)

  Contract: Rollback
rollback address=   0x9fbda871d559710256a2502a2517b794b482db40
ven address=    0x2c2b9c9a4a25e24b174f26114e8926a9f2128fe4
    ✓ deploy (140ms)
    ✓ setVen (79ms)
    ✓ setCredit (218ms)
    ✓ withDrawETH (246ms)
    2) receiveApproval

    Events emitted during test:
    ---------------------------

    Transfer(_from: <indexed>, _to: <indexed>, _value: 8050)
    Transfer(_from: <indexed>, _to: <indexed>, _value: 80500)
    Transfer(_from: <indexed>, _to: <indexed>, _value: 100000000)
    Transfer(_from: <indexed>, _to: <indexed>, _value: 200000000)

    ---------------------------
    3) withdrawToken
    > No events were emitted

  Contract: Sale
    ✓ deploy (326ms)
    ✓ initialize (240ms)
    4) early stage

    Events emitted during test:
    ---------------------------

    Transfer(_from: <indexed>, _to: <indexed>, _value: 1.2075e+23)
    onSold(buyer: <indexed>, venAmount: 1.2075e+23, ethCost: 30000000000000000000)

    ---------------------------
    ✓ normal stage (425ms)
    ✓ offer to channels (155ms)
    5) closed stage
    > No events were emitted
    6) finalized stage
    > No events were emitted

  Contract: VEN
    ✓ deploy (86ms)
    ✓ mint (180ms)
    7) seal

    Events emitted during test:
    ---------------------------

    Transfer(_from: <indexed>, _to: <indexed>, _value: 1000)

    ---------------------------
    ✓ transfer (220ms)

  18 passing (7s)
  7 failing

  1) Contract: MockedExchange
       receiveApproval:
     AssertionError: Transaction should fail: expected false to be truthy
      at assertFail (test/utils.js:9:16)
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:160:7)

  2) Contract: Rollback
       receiveApproval:
     AssertionError: Transaction should fail: expected false to be truthy
      at assertFail (test/utils.js:9:16)
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:160:7)

  3) Contract: Rollback
       withdrawToken:
     AssertionError: 0 equals 1: expected false to be truthy
      at assertEqual (test/utils.js:14:20)
      at Context.it (test/rollback.js:163:9)
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:160:7)

  4) Contract: Sale
       early stage:
     AssertionError: Transaction should fail: expected false to be truthy
      at assertFail (test/utils.js:9:16)
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:160:7)

  5) Contract: Sale
       closed stage:
     AssertionError: Transaction should fail: expected false to be truthy
      at assertFail (test/utils.js:9:16)
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:160:7)

  6) Contract: Sale
       finalized stage:
     AssertionError: Transaction should fail: expected false to be truthy
      at assertFail (test/utils.js:9:16)
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:160:7)

  7) Contract: VEN
       seal:
     AssertionError: Transaction should fail: expected false to be truthy
      at assertFail (test/utils.js:9:16)
      at <anonymous>
      at process._tickCallback (internal/process/next_tick.js:160:7)

7

Is that my setup has an error, or the setup environment has an error?

uldaman commented 6 years ago

truffle 4.0.6+ support

Fix Assert.sol's notEqual method