@0x:contracts-integrations
Added unit tests for FunctionAssertion
This commit is contained in:
@@ -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
|
@@ -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
|
||||
}
|
Reference in New Issue
Block a user