aboutsummaryrefslogtreecommitdiffstats
path: root/test/contracts/FixedFeeRegistrar.cpp
diff options
context:
space:
mode:
authorChase McDermott <chasemcd1745@tamu.edu>2018-07-12 12:18:50 +0800
committerchriseth <chris@ethereum.org>2018-07-16 20:18:16 +0800
commitf48d01d0660747b0071e9d82a0261ce15bcc4c35 (patch)
treeaefd334e35456e79439c85bd1fe98f99a1ecf9a4 /test/contracts/FixedFeeRegistrar.cpp
parentc5ff173431741a4b12cac73c10e2132e3e4bb9d5 (diff)
downloaddexon-solidity-f48d01d0660747b0071e9d82a0261ce15bcc4c35.tar.gz
dexon-solidity-f48d01d0660747b0071e9d82a0261ce15bcc4c35.tar.zst
dexon-solidity-f48d01d0660747b0071e9d82a0261ce15bcc4c35.zip
Added default data locations to parameters for end to end tests.
Diffstat (limited to 'test/contracts/FixedFeeRegistrar.cpp')
-rw-r--r--test/contracts/FixedFeeRegistrar.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/test/contracts/FixedFeeRegistrar.cpp b/test/contracts/FixedFeeRegistrar.cpp
index aebdb053..ff683de0 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 _name) view returns (address o_owner);
- function addr(string _name) view returns (address o_address);
- function subRegistrar(string _name) view returns (address o_subRegistrar);
- function content(string _name) view returns (bytes32 o_content);
+ 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);
}
contract FixedFeeRegistrar is Registrar {
@@ -72,52 +72,52 @@ contract FixedFeeRegistrar is Registrar {
address owner;
}
- modifier onlyrecordowner(string _name) { if (m_record(_name).owner == msg.sender) _; }
+ modifier onlyrecordowner(string memory _name) { if (m_record(_name).owner == msg.sender) _; }
- function reserve(string _name) payable {
+ function reserve(string memory _name) 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 _name, address _refund) onlyrecordowner(_name) {
+ function disown(string memory _name, address _refund) onlyrecordowner(_name) {
delete m_recordData[uint(keccak256(bytes(_name))) / 8];
if (!_refund.send(c_fee))
throw;
emit Changed(_name);
}
- function transfer(string _name, address _newOwner) onlyrecordowner(_name) {
+ function transfer(string memory _name, address _newOwner) onlyrecordowner(_name) {
m_record(_name).owner = _newOwner;
emit Changed(_name);
}
- function setAddr(string _name, address _a) onlyrecordowner(_name) {
+ function setAddr(string memory _name, address _a) onlyrecordowner(_name) {
m_record(_name).addr = _a;
emit Changed(_name);
}
- function setSubRegistrar(string _name, address _registrar) onlyrecordowner(_name) {
+ function setSubRegistrar(string memory _name, address _registrar) onlyrecordowner(_name) {
m_record(_name).subRegistrar = _registrar;
emit Changed(_name);
}
- function setContent(string _name, bytes32 _content) onlyrecordowner(_name) {
+ function setContent(string memory _name, bytes32 _content) onlyrecordowner(_name) {
m_record(_name).content = _content;
emit Changed(_name);
}
- function record(string _name) view returns (address o_addr, address o_subRegistrar, bytes32 o_content, address o_owner) {
+ function record(string memory _name) 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 _name) view returns (address) { return m_record(_name).addr; }
- function subRegistrar(string _name) view returns (address) { return m_record(_name).subRegistrar; }
- function content(string _name) view returns (bytes32) { return m_record(_name).content; }
- function owner(string _name) view returns (address) { return m_record(_name).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; }
Record[2**253] m_recordData;
- function m_record(string _name) view internal returns (Record storage o_record) {
+ function m_record(string memory _name) view internal returns (Record storage o_record) {
return m_recordData[uint(keccak256(bytes(_name))) / 8];
}
uint constant c_fee = 69 ether;