Browse Source

rename purchaseValid to validPurchase

Francisco Giordano 8 years ago
parent
commit
070bcbcdbd
2 changed files with 5 additions and 5 deletions
  1. 3 3
      contracts/crowdsale/CappedCrowdsale.sol
  2. 2 2
      contracts/crowdsale/Crowdsale.sol

+ 3 - 3
contracts/crowdsale/CappedCrowdsale.sol

@@ -16,11 +16,11 @@ contract CappedCrowdsale is Crowdsale {
     cap = _cap;
   }
 
-  // overriding Crowdsale#purchaseValid to add extra cap logic
+  // overriding Crowdsale#validPurchase to add extra cap logic
   // @return true if investors can buy at the moment
-  function purchaseValid() internal constant returns (bool) {
+  function validPurchase() internal constant returns (bool) {
     bool withinCap = weiRaised.add(msg.value) <= cap;
-    return super.purchaseValid() && withinCap;
+    return super.validPurchase() && withinCap;
   }
 
   // overriding Crowdsale#hasEnded to add cap logic

+ 2 - 2
contracts/crowdsale/Crowdsale.sol

@@ -68,7 +68,7 @@ contract Crowdsale {
   // low level token purchase function
   function buyTokens(address beneficiary) payable {
     require(beneficiary != 0x0);
-    require(purchaseValid());
+    require(validPurchase());
 
     uint256 weiAmount = msg.value;
     uint256 updatedWeiRaised = weiRaised.add(weiAmount);
@@ -92,7 +92,7 @@ contract Crowdsale {
   }
 
   // @return true if the transaction can buy tokens
-  function purchaseValid() internal constant returns (bool) {
+  function validPurchase() internal constant returns (bool) {
     uint256 current = block.number;
     bool withinPeriod = current >= startBlock && current <= endBlock;
     bool nonZeroPurchase = msg.value != 0;