aboutsummaryrefslogtreecommitdiffstats
path: root/test/contracts/AuctionRegistrar.cpp
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-07-16 21:46:40 +0800
committerGitHub <noreply@github.com>2018-07-16 21:46:40 +0800
commitb38c26bb0cbbb7fe80c99fc757cb6150c61a56b4 (patch)
tree7eb6a360a07db75166459ae5160fc350109329ac /test/contracts/AuctionRegistrar.cpp
parent931794001e92cbfe99c91da037cf36a1808d9df1 (diff)
parented2aa3b8694f253edff8c0a4acefd4ba74bbd859 (diff)
downloaddexon-solidity-b38c26bb0cbbb7fe80c99fc757cb6150c61a56b4.tar.gz
dexon-solidity-b38c26bb0cbbb7fe80c99fc757cb6150c61a56b4.tar.zst
dexon-solidity-b38c26bb0cbbb7fe80c99fc757cb6150c61a56b4.zip
Merge pull request #4482 from ethereum/enforceVisibilitySpecifierTests
Enforce visibility specifier in tests
Diffstat (limited to 'test/contracts/AuctionRegistrar.cpp')
-rw-r--r--test/contracts/AuctionRegistrar.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/test/contracts/AuctionRegistrar.cpp b/test/contracts/AuctionRegistrar.cpp
index 4f135730..14c37105 100644
--- a/test/contracts/AuctionRegistrar.cpp
+++ b/test/contracts/AuctionRegistrar.cpp
@@ -43,20 +43,20 @@ static char const* registrarCode = R"DELIMITER(
pragma solidity ^0.4.0;
contract NameRegister {
- function addr(string memory _name) view returns (address o_owner);
- function name(address _owner) view returns (string memory o_name);
+ function addr(string memory _name) public view returns (address o_owner);
+ function name(address _owner) public view returns (string memory o_name);
}
contract Registrar is NameRegister {
event Changed(string indexed name);
event PrimaryChanged(string indexed name, address indexed addr);
- function owner(string memory _name) view returns (address o_owner);
- function addr(string memory _name) view returns (address o_address);
- function subRegistrar(string memory _name) view returns (address o_subRegistrar);
- function content(string memory _name) view returns (bytes32 o_content);
+ function owner(string memory _name) public view returns (address o_owner);
+ function addr(string memory _name) public view returns (address o_address);
+ function subRegistrar(string memory _name) public view returns (address o_subRegistrar);
+ function content(string memory _name) public view returns (bytes32 o_content);
- function name(address _owner) view returns (string memory o_name);
+ function name(address _owner) public view returns (string memory o_name);
}
contract AuctionSystem {
@@ -112,7 +112,7 @@ contract GlobalRegistrar is Registrar, AuctionSystem {
uint constant c_renewalInterval = 365 days;
uint constant c_freeBytes = 12;
- function Registrar() {
+ function Registrar() public {
// TODO: Populate with hall-of-fame.
}
@@ -156,12 +156,12 @@ contract GlobalRegistrar is Registrar, AuctionSystem {
modifier onlyrecordowner(string memory _name) { if (m_toRecord[_name].owner == msg.sender) _; }
- function transfer(string memory _name, address _newOwner) onlyrecordowner(_name) {
+ function transfer(string memory _name, address _newOwner) onlyrecordowner(_name) public {
m_toRecord[_name].owner = _newOwner;
emit Changed(_name);
}
- function disown(string memory _name) onlyrecordowner(_name) {
+ function disown(string memory _name) onlyrecordowner(_name) public {
if (stringsEqual(m_toName[m_toRecord[_name].primary], _name))
{
emit PrimaryChanged(_name, m_toRecord[_name].primary);
@@ -171,7 +171,7 @@ contract GlobalRegistrar is Registrar, AuctionSystem {
emit Changed(_name);
}
- function setAddress(string memory _name, address _a, bool _primary) onlyrecordowner(_name) {
+ function setAddress(string memory _name, address _a, bool _primary) onlyrecordowner(_name) public {
m_toRecord[_name].primary = _a;
if (_primary)
{
@@ -180,11 +180,11 @@ contract GlobalRegistrar is Registrar, AuctionSystem {
}
emit Changed(_name);
}
- function setSubRegistrar(string memory _name, address _registrar) onlyrecordowner(_name) {
+ function setSubRegistrar(string memory _name, address _registrar) onlyrecordowner(_name) public {
m_toRecord[_name].subRegistrar = _registrar;
emit Changed(_name);
}
- function setContent(string memory _name, bytes32 _content) onlyrecordowner(_name) {
+ function setContent(string memory _name, bytes32 _content) onlyrecordowner(_name) public {
m_toRecord[_name].content = _content;
emit Changed(_name);
}
@@ -201,11 +201,11 @@ contract GlobalRegistrar is Registrar, AuctionSystem {
return true;
}
- function owner(string memory _name) view returns (address) { return m_toRecord[_name].owner; }
- function addr(string memory _name) view returns (address) { return m_toRecord[_name].primary; }
- function subRegistrar(string memory _name) view returns (address) { return m_toRecord[_name].subRegistrar; }
- function content(string memory _name) view returns (bytes32) { return m_toRecord[_name].content; }
- function name(address _addr) view returns (string memory o_name) { return m_toName[_addr]; }
+ function owner(string memory _name) public view returns (address) { return m_toRecord[_name].owner; }
+ function addr(string memory _name) public view returns (address) { return m_toRecord[_name].primary; }
+ function subRegistrar(string memory _name) public view returns (address) { return m_toRecord[_name].subRegistrar; }
+ function content(string memory _name) public view returns (bytes32) { return m_toRecord[_name].content; }
+ function name(address _addr) public view returns (string memory o_name) { return m_toName[_addr]; }
mapping (address => string) m_toName;
mapping (string => Record) m_toRecord;