From b30da8859a35065aafed3b2d9aeea5e0941e80c8 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 7 Aug 2018 22:12:52 +0200 Subject: [PATCH] Update external tests. --- test/compilationTests/corion/moduleHandler.sol | 12 ++++++------ test/compilationTests/corion/premium.sol | 8 ++++---- test/compilationTests/corion/provider.sol | 8 ++++---- test/compilationTests/corion/publisher.sol | 2 +- test/compilationTests/corion/schelling.sol | 2 +- test/compilationTests/corion/token.sol | 8 ++++---- test/compilationTests/zeppelin/MultisigWallet.sol | 2 +- .../zeppelin/ownership/HasNoTokens.sol | 2 +- .../compilationTests/zeppelin/ownership/Multisig.sol | 2 +- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/test/compilationTests/corion/moduleHandler.sol b/test/compilationTests/corion/moduleHandler.sol index 5628f657b..2b513eb18 100644 --- a/test/compilationTests/corion/moduleHandler.sol +++ b/test/compilationTests/corion/moduleHandler.sol @@ -140,7 +140,7 @@ contract moduleHandler is multiOwner, announcementTypes { } return (true, false, 0); } - function replaceModule(string name, address addr, bool callCallback) external returns (bool success) { + function replaceModule(string calldata name, address addr, bool callCallback) external returns (bool success) { /* Module replace, can be called only by the Publisher contract. @@ -167,7 +167,7 @@ contract moduleHandler is multiOwner, announcementTypes { return true; } - function callReplaceCallback(string moduleName, address newModule) external returns (bool success) { + function callReplaceCallback(string calldata moduleName, address newModule) external returns (bool success) { require( block.number < debugModeUntil ); if ( ! insertAndCheckDo(calcDoHash("callReplaceCallback", keccak256(abi.encodePacked(moduleName, newModule)))) ) { return true; @@ -178,7 +178,7 @@ contract moduleHandler is multiOwner, announcementTypes { return true; } - function newModule(string name, address addr, bool schellingEvent, bool transferEvent) external returns (bool success) { + function newModule(string calldata name, address addr, bool schellingEvent, bool transferEvent) external returns (bool success) { /* Adding new module to the database. Can be called only by the Publisher contract. @@ -199,7 +199,7 @@ contract moduleHandler is multiOwner, announcementTypes { addModule( modules_s(addr, keccak256(bytes(name)), schellingEvent, transferEvent), true); return true; } - function dropModule(string name, bool callCallback) external returns (bool success) { + function dropModule(string calldata name, bool callCallback) external returns (bool success) { /* Deleting module from the database. Can be called only by the Publisher contract. @@ -224,7 +224,7 @@ contract moduleHandler is multiOwner, announcementTypes { return true; } - function callDisableCallback(string moduleName) external returns (bool success) { + function callDisableCallback(string calldata moduleName) external returns (bool success) { require( block.number < debugModeUntil ); if ( ! insertAndCheckDo(calcDoHash("callDisableCallback", keccak256(bytes(moduleName)))) ) { return true; @@ -406,7 +406,7 @@ contract moduleHandler is multiOwner, announcementTypes { require( token(modules[_id].addr).burn(from, value) ); return true; } - function configureModule(string moduleName, announcementType aType, uint256 value) external returns (bool success) { + function configureModule(string calldata moduleName, announcementType aType, uint256 value) external returns (bool success) { /* Changing configuration of a module. Can be called only by Publisher or while debug mode by owners. diff --git a/test/compilationTests/corion/premium.sol b/test/compilationTests/corion/premium.sol index 65895f336..84277a99d 100644 --- a/test/compilationTests/corion/premium.sol +++ b/test/compilationTests/corion/premium.sol @@ -5,8 +5,8 @@ import "./tokenDB.sol"; import "./module.sol"; contract thirdPartyPContractAbstract { - function receiveCorionPremiumToken(address, uint256, bytes) external returns (bool, uint256) {} - function approvedCorionPremiumToken(address, uint256, bytes) external returns (bool) {} + function receiveCorionPremiumToken(address, uint256, bytes calldata) external returns (bool, uint256) {} + function approvedCorionPremiumToken(address, uint256, bytes calldata) external returns (bool) {} } contract ptokenDB is tokenDB {} @@ -108,7 +108,7 @@ contract premium is module, safeMath { * @param extraData Data to give forward to the receiver * @return True if the approval was successful */ - function approveAndCall(address spender, uint256 amount, uint256 nonce, bytes extraData) isReady external returns (bool success) { + function approveAndCall(address spender, uint256 amount, uint256 nonce, bytes calldata extraData) isReady external returns (bool success) { /* Authorize another address to use an exact amount of the principal’s balance. After the transaction the approvedCorionPremiumToken function of the address will be called with the given data. @@ -226,7 +226,7 @@ contract premium is module, safeMath { * @param extraData Data to give forward to the receiver * @return Whether the transfer was successful or not */ - function transfer(address to, uint256 amount, bytes extraData) isReady external returns (bool success) { + function transfer(address to, uint256 amount, bytes calldata extraData) isReady external returns (bool success) { /* Launch a transaction where we transfer from a given address to another one. After thetransaction the approvedCorionPremiumToken function of the receiver’s address is going to be called with the given data. diff --git a/test/compilationTests/corion/provider.sol b/test/compilationTests/corion/provider.sol index a4ee4a48b..41857e546 100644 --- a/test/compilationTests/corion/provider.sol +++ b/test/compilationTests/corion/provider.sol @@ -213,7 +213,7 @@ contract provider is module, safeMath, announcementTypes { return ( ! priv && ( rate >= publicMinRate && rate <= publicMaxRate ) ) || ( priv && ( rate >= privateMinRate && rate <= privateMaxRate ) ); } - function createProvider(bool priv, string name, string website, string country, string info, uint8 rate, bool isForRent, address admin) isReady external { + function createProvider(bool priv, string calldata name, string calldata website, string calldata country, string calldata info, uint8 rate, bool isForRent, address admin) isReady external { /* Creating a provider. During the ICO its not allowed to create provider. @@ -270,7 +270,7 @@ contract provider is module, safeMath, announcementTypes { } emit EProviderOpen(msg.sender, currHeight); } - function setProviderDetails(address addr, string website, string country, string info, uint8 rate, address admin) isReady external { + function setProviderDetails(address addr, string calldata website, string calldata country, string calldata info, uint8 rate, address admin) isReady external { /* Modifying the datas of the provider. This can only be invited by the provider’s admin. @@ -369,7 +369,7 @@ contract provider is module, safeMath, announcementTypes { setRightForInterest(getProviderCurrentSupply(msg.sender), 0, providers[msg.sender].data[currHeight].priv); emit EProviderClose(msg.sender, currHeight); } - function allowUsers(address provider, address[] addr) isReady external { + function allowUsers(address provider, address[] calldata addr) isReady external { /* Permition of the user to be able to connect to the provider. This can only be invited by the provider’s admin. @@ -387,7 +387,7 @@ contract provider is module, safeMath, announcementTypes { providers[provider].data[currHeight].allowedUsers[addr[a]] = true; } } - function disallowUsers(address provider, address[] addr) isReady external { + function disallowUsers(address provider, address[] calldata addr) isReady external { /* Disable of the user not to be able to connect to the provider. It is can called only for the admin of the provider. diff --git a/test/compilationTests/corion/publisher.sol b/test/compilationTests/corion/publisher.sol index fcba13ad2..6a77bc9e2 100644 --- a/test/compilationTests/corion/publisher.sol +++ b/test/compilationTests/corion/publisher.sol @@ -116,7 +116,7 @@ contract publisher is announcementTypes, module, safeMath { return _amount * oppositeRate / 100 > weight; } - function newAnnouncement(announcementType Type, string Announcement, string Link, bool Oppositable, string _str, uint256 _uint, address _addr) onlyOwner external { + function newAnnouncement(announcementType Type, string calldata Announcement, string calldata Link, bool Oppositable, string calldata _str, uint256 _uint, address _addr) onlyOwner external { /* New announcement. Can be called only by those in the admin list diff --git a/test/compilationTests/corion/schelling.sol b/test/compilationTests/corion/schelling.sol index c4f3c02cd..e9288332a 100644 --- a/test/compilationTests/corion/schelling.sol +++ b/test/compilationTests/corion/schelling.sol @@ -310,7 +310,7 @@ contract schelling is module, announcementTypes, schellingVars { setRound(currentRound, round); } - function sendVote(string vote) isReady noContract external { + function sendVote(string calldata vote) isReady noContract external { /* Check vote (Envelope opening) Only the sent “envelopes” can be opened. diff --git a/test/compilationTests/corion/token.sol b/test/compilationTests/corion/token.sol index 87ec64d6e..6d3f1a1e7 100644 --- a/test/compilationTests/corion/token.sol +++ b/test/compilationTests/corion/token.sol @@ -7,8 +7,8 @@ import "./moduleHandler.sol"; import "./tokenDB.sol"; contract thirdPartyContractAbstract { - function receiveCorionToken(address, uint256, bytes) external returns (bool, uint256) {} - function approvedCorionToken(address, uint256, bytes) external returns (bool) {} + function receiveCorionToken(address, uint256, bytes calldata) external returns (bool, uint256) {} + function approvedCorionToken(address, uint256, bytes calldata) external returns (bool) {} } contract token is safeMath, module, announcementTypes { @@ -123,7 +123,7 @@ contract token is safeMath, module, announcementTypes { * @param extraData Data to give forward to the receiver * @return True if the approval was successful */ - function approveAndCall(address spender, uint256 amount, uint256 nonce, bytes extraData) isReady external returns (bool success) { + function approveAndCall(address spender, uint256 amount, uint256 nonce, bytes calldata extraData) isReady external returns (bool success) { /* Authorise another address to use a certain quantity of the authorising owner’s balance Following the transaction the receiver address `approvedCorionToken` function is called by the given data @@ -267,7 +267,7 @@ contract token is safeMath, module, announcementTypes { * @param extraData Data to give forward to the receiver * @return Whether the transfer was successful or not */ - function transfer(address to, uint256 amount, bytes extraData) isReady external returns (bool success) { + function transfer(address to, uint256 amount, bytes calldata extraData) isReady external returns (bool success) { /* Start transaction to send a quantity from a given address to another address After transaction the function `receiveCorionToken`of the receiver is called by the given data diff --git a/test/compilationTests/zeppelin/MultisigWallet.sol b/test/compilationTests/zeppelin/MultisigWallet.sol index 3793428d3..9aac5c539 100644 --- a/test/compilationTests/zeppelin/MultisigWallet.sol +++ b/test/compilationTests/zeppelin/MultisigWallet.sol @@ -55,7 +55,7 @@ contract MultisigWallet is Multisig, Shareable, DayLimit { * @param _value The value to send * @param _data The data part of the transaction */ - function execute(address _to, uint256 _value, bytes _data) external onlyOwner returns (bytes32 _r) { + function execute(address _to, uint256 _value, bytes calldata _data) external onlyOwner returns (bytes32 _r) { // first, take the opportunity to check that we're under the daily limit. if (underLimit(_value)) { emit SingleTransact(msg.sender, _value, _to, _data); diff --git a/test/compilationTests/zeppelin/ownership/HasNoTokens.sol b/test/compilationTests/zeppelin/ownership/HasNoTokens.sol index e14d8da7a..079cef7c4 100644 --- a/test/compilationTests/zeppelin/ownership/HasNoTokens.sol +++ b/test/compilationTests/zeppelin/ownership/HasNoTokens.sol @@ -18,7 +18,7 @@ contract HasNoTokens is Ownable { * @param value_ uint256 the amount of the specified token * @param data_ Bytes The data passed from the caller. */ - function tokenFallback(address from_, uint256 value_, bytes data_) external { + function tokenFallback(address from_, uint256 value_, bytes calldata data_) external { revert(); } diff --git a/test/compilationTests/zeppelin/ownership/Multisig.sol b/test/compilationTests/zeppelin/ownership/Multisig.sol index 25531d8dc..2eb0f4bc3 100644 --- a/test/compilationTests/zeppelin/ownership/Multisig.sol +++ b/test/compilationTests/zeppelin/ownership/Multisig.sol @@ -23,6 +23,6 @@ contract Multisig { // TODO: document function changeOwner(address _from, address _to) external; - function execute(address _to, uint256 _value, bytes _data) external returns (bytes32); + function execute(address _to, uint256 _value, bytes calldata _data) external returns (bytes32); function confirm(bytes32 _h) public returns (bool); }