Skip to content

Commit

Permalink
Merge pull request #100 from LianaHus/use_throw_in_action_registrar
Browse files Browse the repository at this point in the history
used throw statement instead of __throw()
  • Loading branch information
chriseth committed Sep 29, 2015
2 parents 4457170 + 5082730 commit 3ff932c
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions test/contracts/AuctionRegistrar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ contract GlobalRegistrar is Registrar, AuctionSystem {
function() {
// prevent people from just sending funds to the registrar
__throw();
throw;
}
function onAuctionEnd(string _name) internal {
Expand All @@ -135,19 +135,19 @@ contract GlobalRegistrar is Registrar, AuctionSystem {
function reserve(string _name) external {
if (bytes(_name).length == 0)
__throw();
throw;
bool needAuction = requiresAuction(_name);
if (needAuction)
{
if (now < m_toRecord[_name].renewalDate)
__throw();
throw;
bid(_name, msg.sender, msg.value);
}
else
{
Record record = m_toRecord[_name];
if (record.owner != 0)
__throw();
throw;
m_toRecord[_name].owner = msg.sender;
Changed(_name);
}
Expand Down Expand Up @@ -210,11 +210,6 @@ contract GlobalRegistrar is Registrar, AuctionSystem {
function content(string _name) constant returns (bytes32) { return m_toRecord[_name].content; }
function name(address _addr) constant returns (string o_name) { return m_toName[_addr]; }
function __throw() internal {
// workaround until we have "throw"
uint[] x; x[1];
}
mapping (address => string) m_toName;
mapping (string => Record) m_toRecord;
}
Expand Down

0 comments on commit 3ff932c

Please sign in to comment.