diff options
author | chriseth <chris@ethereum.org> | 2018-07-16 21:46:40 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-16 21:46:40 +0800 |
commit | b38c26bb0cbbb7fe80c99fc757cb6150c61a56b4 (patch) | |
tree | 7eb6a360a07db75166459ae5160fc350109329ac /test/contracts/FixedFeeRegistrar.cpp | |
parent | 931794001e92cbfe99c91da037cf36a1808d9df1 (diff) | |
parent | ed2aa3b8694f253edff8c0a4acefd4ba74bbd859 (diff) | |
download | dexon-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/FixedFeeRegistrar.cpp')
-rw-r--r-- | test/contracts/FixedFeeRegistrar.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/test/contracts/FixedFeeRegistrar.cpp b/test/contracts/FixedFeeRegistrar.cpp index ff683de0..bc0c4118 100644 --- a/test/contracts/FixedFeeRegistrar.cpp +++ b/test/contracts/FixedFeeRegistrar.cpp @@ -58,10 +58,10 @@ pragma solidity ^0.4.0; contract Registrar { event Changed(string indexed name); - 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); } contract FixedFeeRegistrar is Registrar { @@ -74,47 +74,47 @@ contract FixedFeeRegistrar is Registrar { modifier onlyrecordowner(string memory _name) { if (m_record(_name).owner == msg.sender) _; } - function reserve(string memory _name) payable { + function reserve(string memory _name) public payable { Record storage rec = m_record(_name); if (rec.owner == 0x0000000000000000000000000000000000000000 && msg.value >= c_fee) { rec.owner = msg.sender; emit Changed(_name); } } - function disown(string memory _name, address _refund) onlyrecordowner(_name) { + function disown(string memory _name, address _refund) onlyrecordowner(_name) public { delete m_recordData[uint(keccak256(bytes(_name))) / 8]; if (!_refund.send(c_fee)) throw; emit Changed(_name); } - function transfer(string memory _name, address _newOwner) onlyrecordowner(_name) { + function transfer(string memory _name, address _newOwner) onlyrecordowner(_name) public { m_record(_name).owner = _newOwner; emit Changed(_name); } - function setAddr(string memory _name, address _a) onlyrecordowner(_name) { + function setAddr(string memory _name, address _a) onlyrecordowner(_name) public { m_record(_name).addr = _a; emit Changed(_name); } - function setSubRegistrar(string memory _name, address _registrar) onlyrecordowner(_name) { + function setSubRegistrar(string memory _name, address _registrar) onlyrecordowner(_name) public { m_record(_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_record(_name).content = _content; emit Changed(_name); } - function record(string memory _name) view returns (address o_addr, address o_subRegistrar, bytes32 o_content, address o_owner) { + function record(string memory _name) public view returns (address o_addr, address o_subRegistrar, bytes32 o_content, address o_owner) { Record storage rec = m_record(_name); o_addr = rec.addr; o_subRegistrar = rec.subRegistrar; o_content = rec.content; o_owner = rec.owner; } - function addr(string memory _name) view returns (address) { return m_record(_name).addr; } - function subRegistrar(string memory _name) view returns (address) { return m_record(_name).subRegistrar; } - function content(string memory _name) view returns (bytes32) { return m_record(_name).content; } - function owner(string memory _name) view returns (address) { return m_record(_name).owner; } + function addr(string memory _name) public view returns (address) { return m_record(_name).addr; } + function subRegistrar(string memory _name) public view returns (address) { return m_record(_name).subRegistrar; } + function content(string memory _name) public view returns (bytes32) { return m_record(_name).content; } + function owner(string memory _name) public view returns (address) { return m_record(_name).owner; } Record[2**253] m_recordData; function m_record(string memory _name) view internal returns (Record storage o_record) { |