0

I am compiling the code available at using "truffle test":

https://michalzalecki.com/ethereum-test-driven-introduction-to-solidity/

pragma solidity 0.5.16;
import "truffle/Assert.sol";
import "../contracts/Funding.sol";

contract FundingTest {
   function testSettingAnOwnerDuringCreation() public {
      Funding funding = new Funding();
      Assert.equal(funding.owner(), this, "An owner is different than  deployer");
   }

}

I am getting the following message:

$ truffle test

You can improve web3's peformance when running Node.js versions older than 10.5.0 by installing the (deprecated) scrypt package in your project Using network 'test'.

Compiling your contracts... ===========================

Compiling ./test/FundingTest.sol

/FundingTest.sol:8:7: TypeError: Member "equal" not found or not visible after argument-dependent lookup in type(library Assert). Assert.equal(funding.owner(), this, "An owner is different than deployer"); ^----------^

Compilation failed. See above. Truffle v5.1.27 (core: 5.1.27) Node v8.10.0

  • 1
    Try Assert.equal(funding.owner(), assert(this), ....). – Ismael Jul 6 at 15:51
  • I am still getting the same error, I am trying to upgrade to latest version v5.1.33. – zak100 Jul 7 at 12:40
  • 1
    Do you have a version ready to test? I tried with the article repo github.com/MichalZalecki/tdd-solidity-intro, but it is very old and I can't make it work without spending too much time fixing things required by the migration from 0.4 to 0.5. I saw that many of your questions came from reading old articles, perhaps you can try some of the truffle boxes, they are more recent trufflesuite.com/boxes/pet-shop but you still may find some bugs from time to time. – Ismael Jul 8 at 3:44
  • Thanks for guidance. I started with pet-shop. The example works. But it does not have any example related to reentrancy. Okay I would try one of the improved versions on it. – zak100 Jul 8 at 12:48
  • I tried the update v5.1.33 but it did not work. – zak100 Jul 8 at 12:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.