Skip to content
This repository has been archived by the owner on Jun 13, 2018. It is now read-only.

test-hevm fails but test-ethrun pass with contract calling library #82

Closed
alext234 opened this issue Mar 14, 2018 · 0 comments
Closed

Comments

@alext234
Copy link

With the following simple test code:

//WithLib.sol
pragma solidity ^0.4.21;

library MyLib {

	function libFunc(string s) public pure returns(uint) {
		return uint(keccak256(s));
	}
}

contract WithLib {
	
	function myFunc(string s) public pure returns(uint) {
		return MyLib.libFunc(s);
	}
}

And

//WithLib.t.sol
pragma solidity ^0.4.21;

import "ds-test/test.sol";

import "./WithLib.sol";

contract WithLibTest is DSTest {
    WithLib lib;

    function setUp() public {
        lib = new WithLib();
    }

    function test_myFunc() {
	lib.myFunc('a1');
    }
}

dapp test-ethrun passes but dapp test-hevm fails with out of gas (at the place when it calls the library)

Failure: test_myFunc
  
  src/WithLib.t.sol:WithLibTest
   ├╴constructor
   ├╴initialize test
   │  └╴create WithLib (src/WithLib.t.sol:11)
   └╴test_myFunc()
      ├╴call WithLib::myFunc(string)("a1") (src/WithLib.t.sol:15)
      │  └╴error OutOfGas 0xfbffffffefbd 0xfbfffffff279 (src/WithLib.sol:13)
      └╴error Revert (src/WithLib.t.sol:15)

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

No branches or pull requests

2 participants