Skip to content

Commit a35eb7b

Browse files
authored
Merge pull request #224 from ethereum/updateCallAndKeccak256
Update test code to support new way of using keccak256 and call.
2 parents aae79ff + 25a096e commit a35eb7b

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

test/DAO/DAO.sol

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
455455
p.recipient = _recipient;
456456
p.amount = _amount;
457457
p.description = _description;
458-
p.proposalHash = keccak256(_recipient, _amount, _transactionData);
458+
p.proposalHash = keccak256(abi.encodePacked(_recipient, _amount, _transactionData));
459459
p.votingDeadline = now + _debatingPeriod;
460460
p.open = true;
461461
//p.proposalPassed = False; // that's default
@@ -484,7 +484,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
484484
bytes _transactionData
485485
) noEther view returns (bool _codeChecksOut) {
486486
Proposal p = proposals[_proposalID];
487-
return p.proposalHash == keccak256(_recipient, _amount, _transactionData);
487+
return p.proposalHash == keccak256(abi.encodePacked(_recipient, _amount, _transactionData));
488488
}
489489

490490

@@ -543,7 +543,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
543543
|| !p.open
544544
|| p.proposalPassed // anyone trying to call us recursively?
545545
// Does the transaction code match the proposal?
546-
|| p.proposalHash != keccak256(p.recipient, p.amount, _transactionData)) {
546+
|| p.proposalHash != keccak256(abi.encodePacked(p.recipient, p.amount, _transactionData))) {
547547

548548
revert();
549549
}
@@ -699,7 +699,7 @@ contract DAO is DAOInterface, Token, TokenCreation {
699699
function newContract(address _newContract){
700700
if (msg.sender != address(this) || !allowedRecipients[_newContract]) return;
701701
// move all ether
702-
if (!_newContract.call.value(address(this).balance)()) {
702+
if (!_newContract.call.value(address(this).balance)("")) {
703703
revert();
704704
}
705705

test/DAO/ManagedAccount.sol

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ contract ManagedAccount is ManagedAccountInterface{
5757
function payOut(address _recipient, uint _amount) returns (bool) {
5858
if (msg.sender != owner || msg.value > 0 || (payOwnerOnly && _recipient != owner))
5959
revert();
60-
if (_recipient.call.value(_amount)()) {
60+
if (_recipient.call.value(_amount)("")) {
6161
PayOut(_recipient, _amount);
6262
return true;
6363
} else {

test/DAO/TokenCreation.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ contract TokenCreation is TokenCreationInterface, Token {
105105
&& (privateCreation == 0x0000000000000000000000000000000000000000 || privateCreation == msg.sender)) {
106106

107107
uint token = (msg.value * 20) / divisor();
108-
extraBalance.call.value(msg.value - token)();
108+
extraBalance.call.value(msg.value - token)("");
109109
balances[_tokenHolder] += token;
110110
totalSupply += token;
111111
weiGiven[_tokenHolder] += msg.value;
@@ -126,7 +126,7 @@ contract TokenCreation is TokenCreationInterface, Token {
126126
extraBalance.payOut(address(this), extraBalance.accumulatedInput());
127127

128128
// Execute refund
129-
if (msg.sender.call.value(weiGiven[msg.sender])()) {
129+
if (msg.sender.call.value(weiGiven[msg.sender])("")) {
130130
Refund(msg.sender, weiGiven[msg.sender]);
131131
totalSupply -= balances[msg.sender];
132132
balances[msg.sender] = 0;

0 commit comments

Comments
 (0)