travis-ci-com
66 of 74 branches covered (89.19%)
Branch coverage included in aggregate %.
46 of 46 new or added lines in 4 files covered. (100.0%)
187 of 199 relevant lines covered (93.97%)
539.21 hits per line
1 |
pragma solidity ^0.5.11; |
|
2 |
|
|
3 |
library Utils { |
|
4 |
function uint2str(uint256 _i) |
|
5 |
internal |
|
6 |
pure |
|
7 |
returns (string memory _uintAsString)
|
|
8 |
{ |
|
|
if (_i == 0) { |
|
|
return "0"; |
× |
11 |
} |
|
|
uint256 j = _i; |
2,359✔ |
|
uint256 len; |
2,359✔ |
|
while (j != 0) { |
2,359✔ |
|
len++; |
5,813✔ |
|
j /= 10;
|
5,813✔ |
17 |
} |
|
|
bytes memory bstr = new bytes(len);
|
2,359✔ |
|
uint256 k = len - 1;
|
2,359✔ |
|
while (_i != 0) { |
2,359✔ |
|
bstr[k--] = byte(uint8(48 + (_i % 10))); |
5,813✔ |
|
_i /= 10;
|
5,813✔ |
23 |
} |
|
|
return string(bstr); |
2,359✔ |
25 |
} |
|
26 |
|
|
27 |
function toPayable(address _a) |
|
28 |
internal |
|
29 |
pure |
|
30 |
returns (address payable _addressAsPayable) |
|
31 |
{ |
|
|
return address(uint160(_a));
|
12✔ |
33 |
} |
|
34 |
} |