@0x:contracts-integrations Added unit tests for FunctionAssertion

This commit is contained in:
Alex Towle
2019-10-09 15:48:47 -07:00
parent 89ae04803f
commit d66101cd9d
14 changed files with 386 additions and 65 deletions

View File

@@ -1,7 +1,9 @@
pragma solidity ^0.5.9;
contract TestCache {
contract TestFramework {
event SomeEvent(uint256 someNumber);
uint256 public counter;
@@ -11,12 +13,16 @@ contract TestCache {
counter = newCounter;
}
function numberSideEffect()
function revertSideEffect(uint256 returnValue)
external
view
returns (uint256)
{
return counter;
if (counter != 0) {
revert("Revert");
}
emit SomeEvent(returnValue);
return returnValue;
}
function equalsSideEffect(uint256 possiblyZero)
@@ -31,6 +37,19 @@ contract TestCache {
}
}
function noEffect(uint256)
external
pure
{} // solhint-disable-line no-empty-blocks
function numberSideEffect()
external
view
returns (uint256)
{
return counter;
}
function hashSideEffect(uint256 arg1, bytes32 arg2)
external
view

View File

@@ -1,15 +0,0 @@
pragma solidity ^0.5.9;
pragma experimental ABIEncoderV2;
import "@0x/contracts-staking/contracts/test/TestStaking.sol";
// TODO(jalextowle): This contract can be removed when the added to this package.
contract TestStakingPlaceholder is
TestStaking
{
constructor(address wethAddress, address zrxVaultAddress)
public
TestStaking(wethAddress, zrxVaultAddress)
{} // solhint-disable-line no-empty-blocks
}