aboutsummaryrefslogtreecommitdiffstats
path: root/test/contracts/AuctionRegistrar.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/AuctionRegistrar.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/AuctionRegistrar.cpp')
-rw-r--r--test/contracts/AuctionRegistrar.cpp44
1 files changed, 22 insertions, 22 deletions
diff --git a/test/contracts/AuctionRegistrar.cpp b/test/contracts/AuctionRegistrar.cpp
index 0fc093e7..4f135730 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 _name) view returns (address o_owner);
- function name(address _owner) view returns (string o_name);
+ function addr(string memory _name) view returns (address o_owner);
+ function name(address _owner) 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 _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);
- function name(address _owner) view returns (string o_name);
+ function name(address _owner) view returns (string memory o_name);
}
contract AuctionSystem {
@@ -64,9 +64,9 @@ contract AuctionSystem {
event NewBid(string indexed _name, address _bidder, uint _value);
/// Function that is called once an auction ends.
- function onAuctionEnd(string _name) internal;
+ function onAuctionEnd(string memory _name) internal;
- function bid(string _name, address _bidder, uint _value) internal {
+ function bid(string memory _name, address _bidder, uint _value) internal {
Auction storage auction = m_auctions[_name];
if (auction.endDate > 0 && now > auction.endDate)
{
@@ -116,7 +116,7 @@ contract GlobalRegistrar is Registrar, AuctionSystem {
// TODO: Populate with hall-of-fame.
}
- function onAuctionEnd(string _name) internal {
+ function onAuctionEnd(string memory _name) internal {
Auction storage auction = m_auctions[_name];
Record storage record = m_toRecord[_name];
address previousOwner = record.owner;
@@ -150,18 +150,18 @@ contract GlobalRegistrar is Registrar, AuctionSystem {
}
}
- function requiresAuction(string _name) internal returns (bool) {
+ function requiresAuction(string memory _name) internal returns (bool) {
return bytes(_name).length < c_freeBytes;
}
- modifier onlyrecordowner(string _name) { if (m_toRecord[_name].owner == msg.sender) _; }
+ modifier onlyrecordowner(string memory _name) { if (m_toRecord[_name].owner == msg.sender) _; }
- function transfer(string _name, address _newOwner) onlyrecordowner(_name) {
+ function transfer(string memory _name, address _newOwner) onlyrecordowner(_name) {
m_toRecord[_name].owner = _newOwner;
emit Changed(_name);
}
- function disown(string _name) onlyrecordowner(_name) {
+ function disown(string memory _name) onlyrecordowner(_name) {
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 _name, address _a, bool _primary) onlyrecordowner(_name) {
+ function setAddress(string memory _name, address _a, bool _primary) onlyrecordowner(_name) {
m_toRecord[_name].primary = _a;
if (_primary)
{
@@ -180,11 +180,11 @@ contract GlobalRegistrar is Registrar, AuctionSystem {
}
emit Changed(_name);
}
- function setSubRegistrar(string _name, address _registrar) onlyrecordowner(_name) {
+ function setSubRegistrar(string memory _name, address _registrar) onlyrecordowner(_name) {
m_toRecord[_name].subRegistrar = _registrar;
emit Changed(_name);
}
- function setContent(string _name, bytes32 _content) onlyrecordowner(_name) {
+ function setContent(string memory _name, bytes32 _content) onlyrecordowner(_name) {
m_toRecord[_name].content = _content;
emit Changed(_name);
}
@@ -201,11 +201,11 @@ contract GlobalRegistrar is Registrar, AuctionSystem {
return true;
}
- function owner(string _name) view returns (address) { return m_toRecord[_name].owner; }
- function addr(string _name) view returns (address) { return m_toRecord[_name].primary; }
- function subRegistrar(string _name) view returns (address) { return m_toRecord[_name].subRegistrar; }
- function content(string _name) view returns (bytes32) { return m_toRecord[_name].content; }
- function name(address _addr) view returns (string o_name) { return m_toName[_addr]; }
+ 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]; }
mapping (address => string) m_toName;
mapping (string => Record) m_toRecord;