diff options
author | Daniel Kirchner <daniel@ekpyron.org> | 2018-05-08 19:09:15 +0800 |
---|---|---|
committer | Daniel Kirchner <daniel@ekpyron.org> | 2018-07-03 00:58:43 +0800 |
commit | 469dc7bbe72c3ac1c32d46a233e4bf0b36451c22 (patch) | |
tree | 7d73e4a00196aa616b275b12640f7103feb4a255 /test | |
parent | f5e1cf7753bb6a87f5a9a11db6a497dc4b2ccca5 (diff) | |
download | dexon-solidity-469dc7bbe72c3ac1c32d46a233e4bf0b36451c22.tar dexon-solidity-469dc7bbe72c3ac1c32d46a233e4bf0b36451c22.tar.gz dexon-solidity-469dc7bbe72c3ac1c32d46a233e4bf0b36451c22.tar.bz2 dexon-solidity-469dc7bbe72c3ac1c32d46a233e4bf0b36451c22.tar.lz dexon-solidity-469dc7bbe72c3ac1c32d46a233e4bf0b36451c22.tar.xz dexon-solidity-469dc7bbe72c3ac1c32d46a233e4bf0b36451c22.tar.zst dexon-solidity-469dc7bbe72c3ac1c32d46a233e4bf0b36451c22.zip |
Update test contracts.
Diffstat (limited to 'test')
-rw-r--r-- | test/contracts/AuctionRegistrar.cpp | 24 | ||||
-rw-r--r-- | test/contracts/FixedFeeRegistrar.cpp | 20 | ||||
-rw-r--r-- | test/contracts/Wallet.cpp | 4 |
3 files changed, 24 insertions, 24 deletions
diff --git a/test/contracts/AuctionRegistrar.cpp b/test/contracts/AuctionRegistrar.cpp index bd996fb1..3d759aa0 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) constant returns (address o_owner); - function name(address _owner) constant returns (string o_name); + function addr(string _name) view returns (address o_owner); + function name(address _owner) view returns (string o_name); } contract Registrar is NameRegister { event Changed(string indexed name); event PrimaryChanged(string indexed name, address indexed addr); - function owner(string _name) constant returns (address o_owner); - function addr(string _name) constant returns (address o_address); - function subRegistrar(string _name) constant returns (address o_subRegistrar); - function content(string _name) constant returns (bytes32 o_content); + 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 name(address _owner) constant returns (string o_name); + function name(address _owner) view returns (string o_name); } contract AuctionSystem { @@ -201,11 +201,11 @@ contract GlobalRegistrar is Registrar, AuctionSystem { return true; } - function owner(string _name) constant returns (address) { return m_toRecord[_name].owner; } - function addr(string _name) constant returns (address) { return m_toRecord[_name].primary; } - function subRegistrar(string _name) constant returns (address) { return m_toRecord[_name].subRegistrar; } - function content(string _name) constant returns (bytes32) { return m_toRecord[_name].content; } - function name(address _addr) constant returns (string o_name) { return m_toName[_addr]; } + 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]; } mapping (address => string) m_toName; mapping (string => Record) m_toRecord; diff --git a/test/contracts/FixedFeeRegistrar.cpp b/test/contracts/FixedFeeRegistrar.cpp index 630d2ab9..87f801b0 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) constant returns (address o_owner); - function addr(string _name) constant returns (address o_address); - function subRegistrar(string _name) constant returns (address o_subRegistrar); - function content(string _name) constant returns (bytes32 o_content); + 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); } contract FixedFeeRegistrar is Registrar { @@ -104,20 +104,20 @@ contract FixedFeeRegistrar is Registrar { emit Changed(_name); } - function record(string _name) constant returns (address o_addr, address o_subRegistrar, bytes32 o_content, address o_owner) { + function record(string _name) view returns (address o_addr, address o_subRegistrar, bytes32 o_content, address o_owner) { Record rec = m_record(_name); o_addr = rec.addr; o_subRegistrar = rec.subRegistrar; o_content = rec.content; o_owner = rec.owner; } - function addr(string _name) constant returns (address) { return m_record(_name).addr; } - function subRegistrar(string _name) constant returns (address) { return m_record(_name).subRegistrar; } - function content(string _name) constant returns (bytes32) { return m_record(_name).content; } - function owner(string _name) constant returns (address) { return m_record(_name).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; } Record[2**253] m_recordData; - function m_record(string _name) constant internal returns (Record storage o_record) { + function m_record(string _name) view internal returns (Record storage o_record) { return m_recordData[uint(keccak256(bytes(_name))) / 8]; } uint constant c_fee = 69 ether; diff --git a/test/contracts/Wallet.cpp b/test/contracts/Wallet.cpp index 1db1e4e2..fb104300 100644 --- a/test/contracts/Wallet.cpp +++ b/test/contracts/Wallet.cpp @@ -177,7 +177,7 @@ contract multiowned { return m_ownerIndex[uint(_addr)] > 0; } - function hasConfirmed(bytes32 _operation, address _owner) constant returns (bool) { + function hasConfirmed(bytes32 _operation, address _owner) view returns (bool) { PendingState pending = m_pending[_operation]; uint ownerIndex = m_ownerIndex[uint(_owner)]; @@ -319,7 +319,7 @@ contract daylimit is multiowned { return false; } // determines today's index. - function today() private constant returns (uint) { return now / 1 days; } + function today() private view returns (uint) { return now / 1 days; } // FIELDS |