aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--test/contracts/AuctionRegistrar.cpp14
-rw-r--r--test/contracts/FixedFeeRegistrar.cpp3
2 files changed, 12 insertions, 5 deletions
diff --git a/test/contracts/AuctionRegistrar.cpp b/test/contracts/AuctionRegistrar.cpp
index f94cc935..9aa47189 100644
--- a/test/contracts/AuctionRegistrar.cpp
+++ b/test/contracts/AuctionRegistrar.cpp
@@ -124,13 +124,19 @@ contract GlobalRegistrar is Registrar, AuctionSystem {
function onAuctionEnd(string _name) internal {
var auction = m_auctions[_name];
var record = m_toRecord[_name];
- if (record.owner != 0)
- record.owner.send(auction.sumOfBids - auction.highestBid / 100);
- else
- auction.highestBidder.send(auction.highestBid - auction.secondHighestBid);
+ var previousOwner = record.owner;
record.renewalDate = now + c_renewalInterval;
record.owner = auction.highestBidder;
Changed(_name);
+ if (previousOwner != 0) {
+ if (!record.owner.send(auction.sumOfBids - auction.highestBid / 100))
+ throw;
+ }
+ else
+ {
+ if (!auction.highestBidder.send(auction.highestBid - auction.secondHighestBid))
+ throw;
+ }
}
function reserve(string _name) external {
diff --git a/test/contracts/FixedFeeRegistrar.cpp b/test/contracts/FixedFeeRegistrar.cpp
index dec29b37..8cb8257a 100644
--- a/test/contracts/FixedFeeRegistrar.cpp
+++ b/test/contracts/FixedFeeRegistrar.cpp
@@ -81,7 +81,8 @@ contract FixedFeeRegistrar is Registrar {
}
function disown(string _name, address _refund) onlyrecordowner(_name) {
delete m_recordData[uint(sha3(_name)) / 8];
- _refund.send(c_fee);
+ if (!_refund.send(c_fee))
+ throw;
Changed(_name);
}
function transfer(string _name, address _newOwner) onlyrecordowner(_name) {