aboutsummaryrefslogtreecommitdiffstats
path: root/test/contracts
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-05-11 20:43:29 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-05-30 19:33:04 +0800
commit9e1c509cf560096b620c3ba627277e622cf8f261 (patch)
tree33dc98250eab105833358840483ba77e2c99f17c /test/contracts
parent75e4a2be1b920ad88c34a261a84cef5f4635eb68 (diff)
downloaddexon-solidity-9e1c509cf560096b620c3ba627277e622cf8f261.tar.gz
dexon-solidity-9e1c509cf560096b620c3ba627277e622cf8f261.tar.zst
dexon-solidity-9e1c509cf560096b620c3ba627277e622cf8f261.zip
Use keccak256() in tests (and not sha3())
Diffstat (limited to 'test/contracts')
-rw-r--r--test/contracts/FixedFeeRegistrar.cpp4
-rw-r--r--test/contracts/Wallet.cpp16
2 files changed, 10 insertions, 10 deletions
diff --git a/test/contracts/FixedFeeRegistrar.cpp b/test/contracts/FixedFeeRegistrar.cpp
index 39c32eb7..d2904b5f 100644
--- a/test/contracts/FixedFeeRegistrar.cpp
+++ b/test/contracts/FixedFeeRegistrar.cpp
@@ -82,7 +82,7 @@ contract FixedFeeRegistrar is Registrar {
}
}
function disown(string _name, address _refund) onlyrecordowner(_name) {
- delete m_recordData[uint(sha3(_name)) / 8];
+ delete m_recordData[uint(keccak256(_name)) / 8];
if (!_refund.send(c_fee))
throw;
Changed(_name);
@@ -118,7 +118,7 @@ contract FixedFeeRegistrar is Registrar {
Record[2**253] m_recordData;
function m_record(string _name) constant internal returns (Record storage o_record) {
- return m_recordData[uint(sha3(_name)) / 8];
+ return m_recordData[uint(keccak256(_name)) / 8];
}
uint constant c_fee = 69 ether;
}
diff --git a/test/contracts/Wallet.cpp b/test/contracts/Wallet.cpp
index 80f06613..ef345d86 100644
--- a/test/contracts/Wallet.cpp
+++ b/test/contracts/Wallet.cpp
@@ -128,7 +128,7 @@ contract multiowned {
}
// Replaces an owner `_from` with another `_to`.
- function changeOwner(address _from, address _to) onlymanyowners(sha3(msg.data)) external {
+ function changeOwner(address _from, address _to) onlymanyowners(keccak256(msg.data)) external {
if (isOwner(_to)) return;
uint ownerIndex = m_ownerIndex[uint(_from)];
if (ownerIndex == 0) return;
@@ -140,7 +140,7 @@ contract multiowned {
OwnerChanged(_from, _to);
}
- function addOwner(address _owner) onlymanyowners(sha3(msg.data)) external {
+ function addOwner(address _owner) onlymanyowners(keccak256(msg.data)) external {
if (isOwner(_owner)) return;
clearPending();
@@ -154,7 +154,7 @@ contract multiowned {
OwnerAdded(_owner);
}
- function removeOwner(address _owner) onlymanyowners(sha3(msg.data)) external {
+ function removeOwner(address _owner) onlymanyowners(keccak256(msg.data)) external {
uint ownerIndex = m_ownerIndex[uint(_owner)];
if (ownerIndex == 0) return;
if (m_required > m_numOwners - 1) return;
@@ -166,7 +166,7 @@ contract multiowned {
OwnerRemoved(_owner);
}
- function changeRequirement(uint _newRequired) onlymanyowners(sha3(msg.data)) external {
+ function changeRequirement(uint _newRequired) onlymanyowners(keccak256(msg.data)) external {
if (_newRequired > m_numOwners) return;
m_required = _newRequired;
clearPending();
@@ -293,11 +293,11 @@ contract daylimit is multiowned {
m_lastDay = today();
}
// (re)sets the daily limit. needs many of the owners to confirm. doesn't alter the amount already spent today.
- function setDailyLimit(uint _newLimit) onlymanyowners(sha3(msg.data)) external {
+ function setDailyLimit(uint _newLimit) onlymanyowners(keccak256(msg.data)) external {
m_dailyLimit = _newLimit;
}
// (re)sets the daily limit. needs many of the owners to confirm. doesn't alter the amount already spent today.
- function resetSpentToday() onlymanyowners(sha3(msg.data)) external {
+ function resetSpentToday() onlymanyowners(keccak256(msg.data)) external {
m_spentToday = 0;
}
@@ -374,7 +374,7 @@ contract Wallet is multisig, multiowned, daylimit {
}
// destroys the contract sending everything to `_to`.
- function kill(address _to) onlymanyowners(sha3(msg.data)) external {
+ function kill(address _to) onlymanyowners(keccak256(msg.data)) external {
selfdestruct(_to);
}
@@ -398,7 +398,7 @@ contract Wallet is multisig, multiowned, daylimit {
return 0;
}
// determine our operation hash.
- _r = sha3(msg.data, block.number);
+ _r = keccak256(msg.data, block.number);
if (!confirm(_r) && m_txs[_r].to == 0) {
m_txs[_r].to = _to;
m_txs[_r].value = _value;