Coder Social home page Coder Social logo

Comments (5)

GlenDC avatar GlenDC commented on July 17, 2024 1

API has changed, and have adapted unit test code to adapt to these web3.js breaking changes.

from atomicswap.

GlenDC avatar GlenDC commented on July 17, 2024

Just fixed Go tests.

Truffle tests do work on my machine:

truffle test
Compiling ./contracts/AtomicSwap.sol...
Compiling ./contracts/Migrations.sol...


  Contract: AtomicSwap tests
balance of accounts before test:
  * balance of account #1: 100000000000000000000
  * balance of account #2: 100000000000000000000
  * balance of account #3: 100000000000000000000
  * balance of account #4: 100000000000000000000
    ✓ should be able to redeem a participation contract (1351ms)
balance of accounts after test:
  * balance of account #1: 99990000000000000000
  * balance of account #2: 100010000000000000000
  * balance of account #3: 100000000000000000000
  * balance of account #4: 100000000000000000000
balance of accounts before test:
  * balance of account #1: 99990000000000000000
  * balance of account #2: 100010000000000000000
  * balance of account #3: 100000000000000000000
  * balance of account #4: 100000000000000000000
    ✓ should be able to redeem a participation contract even when refunding is already possible (3026ms)
balance of accounts after test:
  * balance of account #1: 99980000000000000000
  * balance of account #2: 100020000000000000000
  * balance of account #3: 100000000000000000000
  * balance of account #4: 100000000000000000000
balance of accounts before test:
  * balance of account #1: 99980000000000000000
  * balance of account #2: 100020000000000000000
  * balance of account #3: 100000000000000000000
  * balance of account #4: 100000000000000000000
    ✓ should be able to redeem an initiation contract (1250ms)
balance of accounts after test:
  * balance of account #1: 99970000000000000000
  * balance of account #2: 100030000000000000000
  * balance of account #3: 100000000000000000000
  * balance of account #4: 100000000000000000000
balance of accounts before test:
  * balance of account #1: 99970000000000000000
  * balance of account #2: 100030000000000000000
  * balance of account #3: 100000000000000000000
  * balance of account #4: 100000000000000000000
    ✓ should be able to redeem an initiation contract even when refunding is already possible (3030ms)
balance of accounts after test:
  * balance of account #1: 99960000000000000000
  * balance of account #2: 100040000000000000000
  * balance of account #3: 100000000000000000000
  * balance of account #4: 100000000000000000000
balance of accounts before test:
  * balance of account #1: 99960000000000000000
  * balance of account #2: 100040000000000000000
  * balance of account #3: 100000000000000000000
  * balance of account #4: 100000000000000000000
    ✓ should be able to refund a participation contract (4347ms)
balance of accounts after test:
  * balance of account #1: 99960000000000000000
  * balance of account #2: 100040000000000000000
  * balance of account #3: 100000000000000000000
  * balance of account #4: 100000000000000000000
balance of accounts before test:
  * balance of account #1: 99960000000000000000
  * balance of account #2: 100040000000000000000
  * balance of account #3: 100000000000000000000
  * balance of account #4: 100000000000000000000
    ✓ should be able to refund an initiation contract (3967ms)
balance of accounts after test:
  * balance of account #1: 99960000000000000000
  * balance of account #2: 100040000000000000000
  * balance of account #3: 100000000000000000000
  * balance of account #4: 100000000000000000000
balance of accounts before test:
  * balance of account #1: 99960000000000000000
  * balance of account #2: 100040000000000000000
  * balance of account #3: 100000000000000000000
  * balance of account #4: 100000000000000000000
    ✓ shouldn't be possible to create a contract with no value
balance of accounts after test:
  * balance of account #1: 99960000000000000000
  * balance of account #2: 100040000000000000000
  * balance of account #3: 100000000000000000000
  * balance of account #4: 100000000000000000000
balance of accounts before test:
  * balance of account #1: 99960000000000000000
  * balance of account #2: 100040000000000000000
  * balance of account #3: 100000000000000000000
  * balance of account #4: 100000000000000000000
    ✓ shouldn't be possible to create a contract with no refundTime
balance of accounts after test:
  * balance of account #1: 99960000000000000000
  * balance of account #2: 100040000000000000000
  * balance of account #3: 100000000000000000000
  * balance of account #4: 100000000000000000000


  8 passing (25s)

I have Truffle v4.1.12, going to see to upgrade, as I think it has to do with a new version.

from atomicswap.

GlenDC avatar GlenDC commented on July 17, 2024

After running npm update -g truffle I now have

truffle --version
Truffle v4.1.16

Unit tests still run fine locally...

from atomicswap.

GlenDC avatar GlenDC commented on July 17, 2024

Going to ensure I have same node versions...

from atomicswap.

GlenDC avatar GlenDC commented on July 17, 2024

Ok found it, need latest version of truffle:

truffle --version
Truffle v5.0.38 - a development framework for Ethereum

from atomicswap.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.