Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Commit

Permalink
Updated tests for better coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
oed committed Jul 13, 2017
1 parent b840ed9 commit f3f7ebd
Show file tree
Hide file tree
Showing 38 changed files with 328 additions and 630 deletions.
3 changes: 2 additions & 1 deletion .solcover.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module.exports = {
port: 8555,
testCommand: 'sleep 5 && ../node_modules/.bin/truffle test --network coverage',
accounts: 25
accounts: 25,
skipFiles: ['misc/Migrations.sol']
};
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# uPort Identity Contracts
[![npm](https://img.shields.io/npm/v/npm.svg)](https://www.npmjs.com/package/uport-identity)
![CircleCI](https://img.shields.io/circleci/project/github/uport-project/uport-identity.svg)
[![solidity-coverage](https://img.shields.io/badge/coverage-92.86%25-green.svg)](https://uport-project.github.io/uport-identity/coverage)
[![solidity-coverage](https://img.shields.io/badge/coverage-96.64%25-green.svg)](https://uport-project.github.io/uport-identity/coverage)

Please read our [Whitepaper](http://whitepaper.uport.me) for information on what uPort is, and what is currently possible as far as integration.

Expand Down
4 changes: 0 additions & 4 deletions contracts/misc/MetaTestRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ contract MetaTestRegistry {
registry[sender] = x;
}

function reallyLongFunctionName(uint with, address many, string strange, uint params) {
registry[many] = params;
}

function testThrow(address sender) {
throw;
}
Expand Down
2 changes: 1 addition & 1 deletion docs/coverage/contracts/IdentityFactory.sol.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ <h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jul 12 2017 19:00:39 GMT+0200 (CEST)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Jul 13 2017 17:20:16 GMT+0200 (CEST)
</div>
</div>
<script src="../prettify.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ <h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jul 12 2017 19:00:39 GMT+0200 (CEST)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Jul 13 2017 17:20:16 GMT+0200 (CEST)
</div>
</div>
<script src="../prettify.js"></script>
Expand Down
68 changes: 34 additions & 34 deletions docs/coverage/contracts/IdentityManager.sol.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ <h1>
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">88.64% </span>
<span class="strong">97.73% </span>
<span class="quiet">Statements</span>
<span class='fraction'>39/44</span>
<span class='fraction'>43/44</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">70% </span>
<span class="strong">90% </span>
<span class="quiet">Branches</span>
<span class='fraction'>14/20</span>
<span class='fraction'>18/20</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
Expand Down Expand Up @@ -312,34 +312,34 @@ <h1>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">134×</span>
<span class="cline-any cline-yes">142×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">25×</span>
<span class="cline-any cline-yes">26×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">93×</span>
<span class="cline-any cline-yes">95×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">15×</span>
<span class="cline-any cline-yes">20×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">77×</span>
<span class="cline-any cline-yes">63×</span>
<span class="cline-any cline-yes">63×</span>
<span class="cline-any cline-yes">83×</span>
<span class="cline-any cline-yes">69×</span>
<span class="cline-any cline-yes">69×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">69×</span>
<span class="cline-any cline-yes">75×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
Expand All @@ -349,21 +349,21 @@ <h1>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">46×</span>
<span class="cline-any cline-yes">46×</span>
<span class="cline-any cline-yes">46×</span>
<span class="cline-any cline-yes">46×</span>
<span class="cline-any cline-yes">47×</span>
<span class="cline-any cline-yes">47×</span>
<span class="cline-any cline-yes">47×</span>
<span class="cline-any cline-yes">47×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">61×</span>
<span class="cline-any cline-yes">65×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">61×</span>
<span class="cline-any cline-yes">61×</span>
<span class="cline-any cline-yes">65×</span>
<span class="cline-any cline-yes">65×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
Expand All @@ -382,7 +382,7 @@ <h1>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">14×</span>
<span class="cline-any cline-yes">15×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
Expand All @@ -391,8 +391,8 @@ <h1>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">38×</span>
<span class="cline-any cline-yes">38×</span>
<span class="cline-any cline-yes">39×</span>
<span class="cline-any cline-yes">39×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
Expand All @@ -401,9 +401,9 @@ <h1>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">13×</span>
<span class="cline-any cline-yes">13×</span>
<span class="cline-any cline-yes">13×</span>
<span class="cline-any cline-yes">17×</span>
<span class="cline-any cline-yes">16×</span>
<span class="cline-any cline-yes">16×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
Expand Down Expand Up @@ -458,8 +458,8 @@ <h1>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">69×</span>
<span class="cline-any cline-yes">69×</span>
<span class="cline-any cline-yes">77×</span>
<span class="cline-any cline-yes">77×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
Expand Down Expand Up @@ -538,8 +538,8 @@ <h1>
}
&nbsp;
modifier onlyRecovery(address identity, address sender) {
<span class="missing-if-branch" title="else path not taken" >E</span>if (recoveryKeys[identity] == sender) _;
else <span class="cstat-no" title="statement not covered" >throw;</span>
if (recoveryKeys[identity] == sender) _;
else throw;
}
&nbsp;
modifier rateLimited(Proxy identity, address sender) {
Expand All @@ -550,8 +550,8 @@ <h1>
}
&nbsp;
modifier validRecovery(address newKey) { //protects against some weird attacks
<span class="missing-if-branch" title="else path not taken" >E</span>if (newKey != address(0)) _;
else <span class="cstat-no" title="statement not covered" >throw;</span>
if (newKey != address(0)) _;
else throw;
}
&nbsp;
/// @dev Contract constructor sets initial timelocks and meta-tx relay address
Expand Down Expand Up @@ -582,7 +582,7 @@ <h1>
/// @param recoveryKey Key of recovery network or address from seed to recovery proxy
/// Note: User must change owner of proxy to this contract after calling this
function registerIdentity(address owner, address recoveryKey) validRecovery(recoveryKey) {
<span class="missing-if-branch" title="if path not taken" >I</span>if (recoveryKeys[msg.sender] &gt; 0 ) <span class="cstat-no" title="statement not covered" >throw;</span> // Invariant enforced w/ validRecovery modifier
if (recoveryKeys[msg.sender] &gt; 0 ) throw; // Invariant enforced w/ validRecovery modifier
owners[msg.sender][owner] = now - adminTimeLock; // Owner has full power from day one
recoveryKeys[msg.sender] = recoveryKey;
IdentityCreated(msg.sender, msg.sender, owner, recoveryKey);
Expand Down Expand Up @@ -612,7 +612,7 @@ <h1>
onlyRecovery(identity, sender)
rateLimited(identity, sender)
{
<span class="missing-if-branch" title="if path not taken" >I</span>if (owners[identity][newOwner] &gt; 0) <span class="cstat-no" title="statement not covered" >throw;</span>
if (owners[identity][newOwner] &gt; 0) throw;
owners[identity][newOwner] = now;
OwnerAdded(identity, newOwner, sender);
}
Expand Down Expand Up @@ -682,7 +682,7 @@ <h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jul 12 2017 19:00:39 GMT+0200 (CEST)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Jul 13 2017 17:20:16 GMT+0200 (CEST)
</div>
</div>
<script src="../prettify.js"></script>
Expand Down
6 changes: 3 additions & 3 deletions docs/coverage/contracts/Proxy.sol.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ <h1>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">27×</span>
<span class="cline-any cline-yes">4×</span>
<span class="cline-any cline-yes">28×</span>
<span class="cline-any cline-yes">5×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">23×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
Expand Down Expand Up @@ -100,7 +100,7 @@ <h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jul 12 2017 19:00:39 GMT+0200 (CEST)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Jul 13 2017 17:20:16 GMT+0200 (CEST)
</div>
</div>
<script src="../prettify.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/coverage/contracts/RecoverableController.sol.html
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ <h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jul 12 2017 19:00:39 GMT+0200 (CEST)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Jul 13 2017 17:20:16 GMT+0200 (CEST)
</div>
</div>
<script src="../prettify.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/coverage/contracts/RecoveryQuorum.sol.html
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ <h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jul 12 2017 19:00:39 GMT+0200 (CEST)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Jul 13 2017 17:20:16 GMT+0200 (CEST)
</div>
</div>
<script src="../prettify.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/coverage/contracts/TxRelay.sol.html
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ <h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jul 12 2017 19:00:39 GMT+0200 (CEST)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Jul 13 2017 17:20:16 GMT+0200 (CEST)
</div>
</div>
<script src="../prettify.js"></script>
Expand Down
20 changes: 10 additions & 10 deletions docs/coverage/contracts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ <h1>
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">96.18% </span>
<span class="strong">99.24% </span>
<span class="quiet">Statements</span>
<span class='fraction'>126/131</span>
<span class='fraction'>130/131</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">88.33% </span>
<span class="strong">95% </span>
<span class="quiet">Branches</span>
<span class='fraction'>53/60</span>
<span class='fraction'>57/60</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
Expand Down Expand Up @@ -86,11 +86,11 @@ <h1>

<tr>
<td class="file high" data-value="IdentityManager.sol"><a href="IdentityManager.sol.html">IdentityManager.sol</a></td>
<td data-value="88.64" class="pic high"><div class="chart"><div class="cover-fill" style="width: 88%;"></div><div class="cover-empty" style="width:12%;"></div></div></td>
<td data-value="88.64" class="pct high">88.64%</td>
<td data-value="44" class="abs high">39/44</td>
<td data-value="70" class="pct medium">70%</td>
<td data-value="20" class="abs medium">14/20</td>
<td data-value="97.73" class="pic high"><div class="chart"><div class="cover-fill" style="width: 97%;"></div><div class="cover-empty" style="width:3%;"></div></div></td>
<td data-value="97.73" class="pct high">97.73%</td>
<td data-value="44" class="abs high">43/44</td>
<td data-value="90" class="pct high">90%</td>
<td data-value="20" class="abs high">18/20</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="18" class="abs high">18/18</td>
<td data-value="100" class="pct high">100%</td>
Expand Down Expand Up @@ -155,7 +155,7 @@ <h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jul 12 2017 19:00:39 GMT+0200 (CEST)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Jul 13 2017 17:20:16 GMT+0200 (CEST)
</div>
</div>
<script src="../prettify.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/coverage/contracts/libs/ArrayLib.sol.html
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ <h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jul 12 2017 19:00:39 GMT+0200 (CEST)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Jul 13 2017 17:20:16 GMT+0200 (CEST)
</div>
</div>
<script src="../../prettify.js"></script>
Expand Down
6 changes: 3 additions & 3 deletions docs/coverage/contracts/libs/Owned.sol.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ <h1>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">45×</span>
<span class="cline-any cline-yes">46×</span>
<span class="cline-any cline-yes"></span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">42×</span>
<span class="cline-any cline-yes">43×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
Expand Down Expand Up @@ -115,7 +115,7 @@ <h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jul 12 2017 19:00:39 GMT+0200 (CEST)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Jul 13 2017 17:20:16 GMT+0200 (CEST)
</div>
</div>
<script src="../../prettify.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion docs/coverage/contracts/libs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ <h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Jul 12 2017 19:00:39 GMT+0200 (CEST)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Thu Jul 13 2017 17:20:16 GMT+0200 (CEST)
</div>
</div>
<script src="../../prettify.js"></script>
Expand Down
Loading

0 comments on commit f3f7ebd

Please sign in to comment.