Remove solidity warnings in tests
This commit is contained in:
@ -7,7 +7,7 @@ import '../../contracts/token/BasicToken.sol';
|
||||
// mock class using BasicToken
|
||||
contract BasicTokenMock is BasicToken {
|
||||
|
||||
function BasicTokenMock(address initialAccount, uint256 initialBalance) {
|
||||
function BasicTokenMock(address initialAccount, uint256 initialBalance) public {
|
||||
balances[initialAccount] = initialBalance;
|
||||
totalSupply = initialBalance;
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@ import '../../contracts/token/BurnableToken.sol';
|
||||
|
||||
contract BurnableTokenMock is BurnableToken {
|
||||
|
||||
function BurnableTokenMock(address initialAccount, uint initialBalance) {
|
||||
function BurnableTokenMock(address initialAccount, uint initialBalance) public {
|
||||
balances[initialAccount] = initialBalance;
|
||||
totalSupply = initialBalance;
|
||||
}
|
||||
|
||||
@ -12,7 +12,7 @@ contract CappedCrowdsaleImpl is CappedCrowdsale {
|
||||
uint256 _rate,
|
||||
address _wallet,
|
||||
uint256 _cap
|
||||
)
|
||||
) public
|
||||
Crowdsale(_startTime, _endTime, _rate, _wallet)
|
||||
CappedCrowdsale(_cap)
|
||||
{
|
||||
|
||||
@ -4,7 +4,7 @@ import "../../contracts/DayLimit.sol";
|
||||
contract DayLimitMock is DayLimit {
|
||||
uint256 public totalSpending;
|
||||
|
||||
function DayLimitMock(uint256 _value) DayLimit(_value) {
|
||||
function DayLimitMock(uint256 _value) public DayLimit(_value) {
|
||||
totalSpending = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -4,5 +4,5 @@ import '../../contracts/token/StandardToken.sol';
|
||||
import '../../contracts/token/DetailedERC20.sol';
|
||||
|
||||
contract DetailedERC20Mock is StandardToken, DetailedERC20 {
|
||||
function DetailedERC20Mock(string _name, string _symbol, uint8 _decimals) DetailedERC20(_name, _symbol, _decimals) {}
|
||||
function DetailedERC20Mock(string _name, string _symbol, uint8 _decimals) DetailedERC20(_name, _symbol, _decimals) public {}
|
||||
}
|
||||
|
||||
@ -10,13 +10,13 @@ contract ERC23ContractInterface {
|
||||
|
||||
contract ERC23TokenMock is BasicToken {
|
||||
|
||||
function ERC23TokenMock(address initialAccount, uint256 initialBalance) {
|
||||
function ERC23TokenMock(address initialAccount, uint256 initialBalance) public {
|
||||
balances[initialAccount] = initialBalance;
|
||||
totalSupply = initialBalance;
|
||||
}
|
||||
|
||||
// ERC23 compatible transfer function (except the name)
|
||||
function transferERC23(address _to, uint256 _value, bytes _data)
|
||||
function transferERC23(address _to, uint256 _value, bytes _data) public
|
||||
returns (bool success)
|
||||
{
|
||||
transfer(_to, _value);
|
||||
|
||||
@ -11,7 +11,7 @@ contract FinalizableCrowdsaleImpl is FinalizableCrowdsale {
|
||||
uint256 _endTime,
|
||||
uint256 _rate,
|
||||
address _wallet
|
||||
)
|
||||
) public
|
||||
Crowdsale(_startTime, _endTime, _rate, _wallet)
|
||||
FinalizableCrowdsale()
|
||||
{
|
||||
|
||||
@ -7,9 +7,9 @@ pragma solidity ^0.4.18;
|
||||
// @author Remco Bloemen <remco@neufund.org>
|
||||
contract ForceEther {
|
||||
|
||||
function ForceEther() payable { }
|
||||
function ForceEther() public payable { }
|
||||
|
||||
function destroyAndSend(address _recipient) {
|
||||
function destroyAndSend(address _recipient) public {
|
||||
selfdestruct(_recipient);
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@ import "../../contracts/ownership/HasNoEther.sol";
|
||||
contract HasNoEtherTest is HasNoEther {
|
||||
|
||||
// Constructor with explicit payable — should still fail
|
||||
function HasNoEtherTest() payable {
|
||||
function HasNoEtherTest() public payable {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@ import {Bounty, Target} from "../../contracts/Bounty.sol";
|
||||
|
||||
|
||||
contract InsecureTargetMock is Target {
|
||||
function checkInvariant() returns(bool){
|
||||
function checkInvariant() public returns(bool){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ import '../../contracts/LimitBalance.sol';
|
||||
// mock class using LimitBalance
|
||||
contract LimitBalanceMock is LimitBalance(1000) {
|
||||
|
||||
function limitedDeposit() payable limitedPayable {
|
||||
function limitedDeposit() public payable limitedPayable {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -9,7 +9,7 @@ contract PausableMock is Pausable {
|
||||
bool public drasticMeasureTaken;
|
||||
uint256 public count;
|
||||
|
||||
function PausableMock() {
|
||||
function PausableMock() public {
|
||||
drasticMeasureTaken = false;
|
||||
count = 0;
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@ import '../../contracts/token/PausableToken.sol';
|
||||
// mock class using PausableToken
|
||||
contract PausableTokenMock is PausableToken {
|
||||
|
||||
function PausableTokenMock(address initialAccount, uint initialBalance) {
|
||||
function PausableTokenMock(address initialAccount, uint initialBalance) public {
|
||||
balances[initialAccount] = initialBalance;
|
||||
}
|
||||
|
||||
|
||||
@ -7,10 +7,10 @@ import '../../contracts/payment/PullPayment.sol';
|
||||
// mock class using PullPayment
|
||||
contract PullPaymentMock is PullPayment {
|
||||
|
||||
function PullPaymentMock() payable { }
|
||||
function PullPaymentMock() public payable { }
|
||||
|
||||
// test helper function to call asyncSend
|
||||
function callSend(address dest, uint256 amount) {
|
||||
function callSend(address dest, uint256 amount) public {
|
||||
asyncSend(dest, amount);
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@ pragma solidity ^0.4.18;
|
||||
|
||||
contract ReentrancyAttack {
|
||||
|
||||
function callSender(bytes4 data) {
|
||||
function callSender(bytes4 data) public {
|
||||
require(msg.sender.call(data));
|
||||
}
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ contract ReentrancyMock is ReentrancyGuard {
|
||||
|
||||
uint256 public counter;
|
||||
|
||||
function ReentrancyMock() {
|
||||
function ReentrancyMock() public {
|
||||
counter = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -12,7 +12,7 @@ contract RefundableCrowdsaleImpl is RefundableCrowdsale {
|
||||
uint256 _rate,
|
||||
address _wallet,
|
||||
uint256 _goal
|
||||
)
|
||||
) public
|
||||
Crowdsale(_startTime, _endTime, _rate, _wallet)
|
||||
RefundableCrowdsale(_goal)
|
||||
{
|
||||
|
||||
@ -4,45 +4,45 @@ import '../../contracts/token/ERC20.sol';
|
||||
import '../../contracts/token/SafeERC20.sol';
|
||||
|
||||
contract ERC20FailingMock is ERC20 {
|
||||
function transfer(address, uint256) returns (bool) {
|
||||
function transfer(address, uint256) public returns (bool) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function transferFrom(address, address, uint256) returns (bool) {
|
||||
function transferFrom(address, address, uint256) public returns (bool) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function approve(address, uint256) returns (bool) {
|
||||
function approve(address, uint256) public returns (bool) {
|
||||
return false;
|
||||
}
|
||||
|
||||
function balanceOf(address) constant returns (uint256) {
|
||||
function balanceOf(address) public constant returns (uint256) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
function allowance(address, address) constant returns (uint256) {
|
||||
function allowance(address, address) public constant returns (uint256) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
contract ERC20SucceedingMock is ERC20 {
|
||||
function transfer(address, uint256) returns (bool) {
|
||||
function transfer(address, uint256) public returns (bool) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function transferFrom(address, address, uint256) returns (bool) {
|
||||
function transferFrom(address, address, uint256) public returns (bool) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function approve(address, uint256) returns (bool) {
|
||||
function approve(address, uint256) public returns (bool) {
|
||||
return true;
|
||||
}
|
||||
|
||||
function balanceOf(address) constant returns (uint256) {
|
||||
function balanceOf(address) public constant returns (uint256) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
function allowance(address, address) constant returns (uint256) {
|
||||
function allowance(address, address) public constant returns (uint256) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -53,32 +53,32 @@ contract SafeERC20Helper {
|
||||
ERC20 failing;
|
||||
ERC20 succeeding;
|
||||
|
||||
function SafeERC20Helper() {
|
||||
function SafeERC20Helper() public {
|
||||
failing = new ERC20FailingMock();
|
||||
succeeding = new ERC20SucceedingMock();
|
||||
}
|
||||
|
||||
function doFailingTransfer() {
|
||||
function doFailingTransfer() public {
|
||||
failing.safeTransfer(0, 0);
|
||||
}
|
||||
|
||||
function doFailingTransferFrom() {
|
||||
function doFailingTransferFrom() public {
|
||||
failing.safeTransferFrom(0, 0, 0);
|
||||
}
|
||||
|
||||
function doFailingApprove() {
|
||||
function doFailingApprove() public {
|
||||
failing.safeApprove(0, 0);
|
||||
}
|
||||
|
||||
function doSucceedingTransfer() {
|
||||
function doSucceedingTransfer() public {
|
||||
succeeding.safeTransfer(0, 0);
|
||||
}
|
||||
|
||||
function doSucceedingTransferFrom() {
|
||||
function doSucceedingTransferFrom() public {
|
||||
succeeding.safeTransferFrom(0, 0, 0);
|
||||
}
|
||||
|
||||
function doSucceedingApprove() {
|
||||
function doSucceedingApprove() public {
|
||||
succeeding.safeApprove(0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,15 +7,15 @@ import '../../contracts/math/SafeMath.sol';
|
||||
contract SafeMathMock {
|
||||
uint256 public result;
|
||||
|
||||
function multiply(uint256 a, uint256 b) {
|
||||
function multiply(uint256 a, uint256 b) public {
|
||||
result = SafeMath.mul(a, b);
|
||||
}
|
||||
|
||||
function subtract(uint256 a, uint256 b) {
|
||||
function subtract(uint256 a, uint256 b) public {
|
||||
result = SafeMath.sub(a, b);
|
||||
}
|
||||
|
||||
function add(uint256 a, uint256 b) {
|
||||
function add(uint256 a, uint256 b) public {
|
||||
result = SafeMath.add(a, b);
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,7 +5,7 @@ import {Bounty, Target} from "../../contracts/Bounty.sol";
|
||||
|
||||
|
||||
contract SecureTargetMock is Target {
|
||||
function checkInvariant() returns(bool) {
|
||||
function checkInvariant() public returns(bool) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@ import '../../contracts/payment/SplitPayment.sol';
|
||||
|
||||
// mock class using SplitPayment
|
||||
contract SplitPaymentMock is SplitPayment {
|
||||
function SplitPaymentMock(address[] _payees, uint256[] _shares)
|
||||
function SplitPaymentMock(address[] _payees, uint256[] _shares) public
|
||||
SplitPayment(_payees, _shares) payable {}
|
||||
function () payable {}
|
||||
function () public payable {}
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@ import '../../contracts/token/StandardToken.sol';
|
||||
// mock class using StandardToken
|
||||
contract StandardTokenMock is StandardToken {
|
||||
|
||||
function StandardTokenMock(address initialAccount, uint256 initialBalance) {
|
||||
function StandardTokenMock(address initialAccount, uint256 initialBalance) public {
|
||||
balances[initialAccount] = initialBalance;
|
||||
totalSupply = initialBalance;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user