Skip to content

Commit

Permalink
Merge branch 'master' into feature/validate-data-and-sig-#891
Browse files Browse the repository at this point in the history
  • Loading branch information
aflesher committed Jun 5, 2018
2 parents a02b258 + 2a997a8 commit d2f6fc7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions contracts/math/SafeMath.sol
Expand Up @@ -11,9 +11,13 @@ library SafeMath {
* @dev Multiplies two numbers, throws on overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256 c) {
// Gas optimization: this is cheaper than asserting 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-solidity/pull/522
if (a == 0) {
return 0;
}

c = a * b;
assert(c / a == b);
return c;
Expand Down
2 changes: 1 addition & 1 deletion test/examples/SampleCrowdsale.test.js
Expand Up @@ -76,7 +76,7 @@ contract('SampleCrowdsale', function ([owner, wallet, investor]) {
});

it('should reject payments after end', async function () {
await increaseTimeTo(this.afterEnd);
await increaseTimeTo(this.afterClosingTime);
await this.crowdsale.send(ether(1)).should.be.rejectedWith(EVMRevert);
await this.crowdsale.buyTokens(investor, { value: ether(1), from: investor }).should.be.rejectedWith(EVMRevert);
});
Expand Down

0 comments on commit d2f6fc7

Please sign in to comment.