From e299a0031f6519cecdf88eeeeff59a9eb02b6168 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 14 Jun 2018 12:28:33 +0200 Subject: Update compilation tests. --- test/compilationTests/corion/moduleHandler.sol | 20 ++++++++++---------- test/compilationTests/corion/multiOwner.sol | 6 +++--- test/compilationTests/corion/schelling.sol | 2 +- .../gnosis/Events/CategoricalEvent.sol | 2 +- test/compilationTests/gnosis/Events/EventFactory.sol | 4 ++-- test/compilationTests/gnosis/Events/ScalarEvent.sol | 2 +- .../gnosis/Oracles/SignedMessageOracle.sol | 4 ++-- test/compilationTests/zeppelin/MultisigWallet.sol | 2 +- 8 files changed, 21 insertions(+), 21 deletions(-) (limited to 'test/compilationTests') diff --git a/test/compilationTests/corion/moduleHandler.sol b/test/compilationTests/corion/moduleHandler.sol index 1d546b40..a2880f56 100644 --- a/test/compilationTests/corion/moduleHandler.sol +++ b/test/compilationTests/corion/moduleHandler.sol @@ -117,7 +117,7 @@ contract moduleHandler is multiOwner, announcementTypes { @id Index of module. @found Was there any result or not. */ - bytes32 _name = keccak256(name); + bytes32 _name = keccak256(bytes(name)); for ( uint256 a=0 ; a 0; diff --git a/test/compilationTests/corion/schelling.sol b/test/compilationTests/corion/schelling.sol index 51133d73..519d92b4 100644 --- a/test/compilationTests/corion/schelling.sol +++ b/test/compilationTests/corion/schelling.sol @@ -335,7 +335,7 @@ contract schelling is module, announcementTypes, schellingVars { require( voter.status == voterStatus.afterPrepareVote ); require( voter.roundID < currentRound ); - if ( keccak256(vote) == voter.hash ) { + if ( keccak256(bytes(vote)) == voter.hash ) { delete voter.hash; if (round.blockHeight+roundBlockDelay/2 >= block.number) { if ( bytes(vote)[0] == aboveChar ) { diff --git a/test/compilationTests/gnosis/Events/CategoricalEvent.sol b/test/compilationTests/gnosis/Events/CategoricalEvent.sol index fbd1d744..be2c81a7 100644 --- a/test/compilationTests/gnosis/Events/CategoricalEvent.sol +++ b/test/compilationTests/gnosis/Events/CategoricalEvent.sol @@ -48,6 +48,6 @@ contract CategoricalEvent is Event { constant returns (bytes32) { - return keccak256(collateralToken, oracle, outcomeTokens.length); + return keccak256(abi.encodePacked(collateralToken, oracle, outcomeTokens.length)); } } diff --git a/test/compilationTests/gnosis/Events/EventFactory.sol b/test/compilationTests/gnosis/Events/EventFactory.sol index 4779c6e4..5ef08544 100644 --- a/test/compilationTests/gnosis/Events/EventFactory.sol +++ b/test/compilationTests/gnosis/Events/EventFactory.sol @@ -35,7 +35,7 @@ contract EventFactory { public returns (CategoricalEvent eventContract) { - bytes32 eventHash = keccak256(collateralToken, oracle, outcomeCount); + bytes32 eventHash = keccak256(abi.encodePacked(collateralToken, oracle, outcomeCount)); // Event should not exist yet require(address(categoricalEvents[eventHash]) == address(0)); // Create event @@ -63,7 +63,7 @@ contract EventFactory { public returns (ScalarEvent eventContract) { - bytes32 eventHash = keccak256(collateralToken, oracle, lowerBound, upperBound); + bytes32 eventHash = keccak256(abi.encodePacked(collateralToken, oracle, lowerBound, upperBound)); // Event should not exist yet require(address(scalarEvents[eventHash]) == address(0)); // Create event diff --git a/test/compilationTests/gnosis/Events/ScalarEvent.sol b/test/compilationTests/gnosis/Events/ScalarEvent.sol index 2e5718ef..e84bf324 100644 --- a/test/compilationTests/gnosis/Events/ScalarEvent.sol +++ b/test/compilationTests/gnosis/Events/ScalarEvent.sol @@ -82,6 +82,6 @@ contract ScalarEvent is Event { constant returns (bytes32) { - return keccak256(collateralToken, oracle, lowerBound, upperBound); + return keccak256(abi.encodePacked(collateralToken, oracle, lowerBound, upperBound)); } } diff --git a/test/compilationTests/gnosis/Oracles/SignedMessageOracle.sol b/test/compilationTests/gnosis/Oracles/SignedMessageOracle.sol index d541ab46..2bbf312f 100644 --- a/test/compilationTests/gnosis/Oracles/SignedMessageOracle.sol +++ b/test/compilationTests/gnosis/Oracles/SignedMessageOracle.sol @@ -58,7 +58,7 @@ contract SignedMessageOracle is Oracle { // Result is not set yet and nonce and signer are valid require( !isSet && _nonce > nonce - && signer == ecrecover(keccak256(descriptionHash, newSigner, _nonce), v, r, s)); + && signer == ecrecover(keccak256(abi.encodePacked(descriptionHash, newSigner, _nonce)), v, r, s)); nonce = _nonce; signer = newSigner; SignerReplacement(newSigner); @@ -74,7 +74,7 @@ contract SignedMessageOracle is Oracle { { // Result is not set yet and signer is valid require( !isSet - && signer == ecrecover(keccak256(descriptionHash, _outcome), v, r, s)); + && signer == ecrecover(keccak256(abi.encodePacked(descriptionHash, _outcome)), v, r, s)); isSet = true; outcome = _outcome; OutcomeAssignment(_outcome); diff --git a/test/compilationTests/zeppelin/MultisigWallet.sol b/test/compilationTests/zeppelin/MultisigWallet.sol index 8fcdb63e..420c9611 100644 --- a/test/compilationTests/zeppelin/MultisigWallet.sol +++ b/test/compilationTests/zeppelin/MultisigWallet.sol @@ -66,7 +66,7 @@ contract MultisigWallet is Multisig, Shareable, DayLimit { return 0; } // determine our operation hash. - _r = keccak256(msg.data, block.number); + _r = keccak256(abi.encodePacked(msg.data, block.number)); if (!confirm(_r) && txs[_r].to == address(0)) { txs[_r].to = _to; txs[_r].value = _value; -- cgit v1.2.3