bridge.sol: mark pure functions as pure to get to 0 solc compiliation warnings
This commit is contained in:
parent
31a17f2644
commit
6cec01f8f0
|
@ -2,7 +2,7 @@ pragma solidity ^0.4.15;
|
||||||
|
|
||||||
|
|
||||||
library Authorities {
|
library Authorities {
|
||||||
function contains (address[] self, address value) internal returns (bool) {
|
function contains (address[] self, address value) internal pure returns (bool) {
|
||||||
for (uint i = 0; i < self.length; i++) {
|
for (uint i = 0; i < self.length; i++) {
|
||||||
if (self[i] == value) {
|
if (self[i] == value) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -15,14 +15,14 @@ library Authorities {
|
||||||
|
|
||||||
/// Library used only to test Signer library via rpc calls
|
/// Library used only to test Signer library via rpc calls
|
||||||
library SignerTest {
|
library SignerTest {
|
||||||
function signer (bytes signature, bytes message) public constant returns (address) {
|
function signer (bytes signature, bytes message) public pure returns (address) {
|
||||||
return Signer.signer(signature, message);
|
return Signer.signer(signature, message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
library Utils {
|
library Utils {
|
||||||
function toString (uint256 v) internal returns (string str) {
|
function toString (uint256 v) internal pure returns (string str) {
|
||||||
// it is used only for small numbers
|
// it is used only for small numbers
|
||||||
bytes memory reversed = new bytes(8);
|
bytes memory reversed = new bytes(8);
|
||||||
uint i = 0;
|
uint i = 0;
|
||||||
|
@ -41,7 +41,7 @@ library Utils {
|
||||||
|
|
||||||
|
|
||||||
library Signer {
|
library Signer {
|
||||||
function signer (bytes signature, bytes message) internal returns (address) {
|
function signer (bytes signature, bytes message) internal pure returns (address) {
|
||||||
require(signature.length == 65);
|
require(signature.length == 65);
|
||||||
bytes32 r;
|
bytes32 r;
|
||||||
bytes32 s;
|
bytes32 s;
|
||||||
|
@ -55,7 +55,7 @@ library Signer {
|
||||||
return ecrecover(hash(message), uint8(v), r, s);
|
return ecrecover(hash(message), uint8(v), r, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
function hash (bytes message) internal returns (bytes32) {
|
function hash (bytes message) internal pure returns (bytes32) {
|
||||||
bytes memory prefix = "\x19Ethereum Signed Message:\n";
|
bytes memory prefix = "\x19Ethereum Signed Message:\n";
|
||||||
return keccak256(prefix, Utils.toString(message.length), message);
|
return keccak256(prefix, Utils.toString(message.length), message);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue