Skip to content

Commit 3ff932c

Browse files
committed
Merge pull request #100 from LianaHus/use_throw_in_action_registrar
used throw statement instead of __throw()
2 parents 4457170 + 5082730 commit 3ff932c

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

test/contracts/AuctionRegistrar.cpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ contract GlobalRegistrar is Registrar, AuctionSystem {
118118
119119
function() {
120120
// prevent people from just sending funds to the registrar
121-
__throw();
121+
throw;
122122
}
123123
124124
function onAuctionEnd(string _name) internal {
@@ -135,19 +135,19 @@ contract GlobalRegistrar is Registrar, AuctionSystem {
135135
136136
function reserve(string _name) external {
137137
if (bytes(_name).length == 0)
138-
__throw();
138+
throw;
139139
bool needAuction = requiresAuction(_name);
140140
if (needAuction)
141141
{
142142
if (now < m_toRecord[_name].renewalDate)
143-
__throw();
143+
throw;
144144
bid(_name, msg.sender, msg.value);
145145
}
146146
else
147147
{
148148
Record record = m_toRecord[_name];
149149
if (record.owner != 0)
150-
__throw();
150+
throw;
151151
m_toRecord[_name].owner = msg.sender;
152152
Changed(_name);
153153
}
@@ -210,11 +210,6 @@ contract GlobalRegistrar is Registrar, AuctionSystem {
210210
function content(string _name) constant returns (bytes32) { return m_toRecord[_name].content; }
211211
function name(address _addr) constant returns (string o_name) { return m_toName[_addr]; }
212212
213-
function __throw() internal {
214-
// workaround until we have "throw"
215-
uint[] x; x[1];
216-
}
217-
218213
mapping (address => string) m_toName;
219214
mapping (string => Record) m_toRecord;
220215
}

0 commit comments

Comments
 (0)