From ccba76384510ea3aa3565029a8a68ca8f777a4ea Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 29 Jun 2016 00:14:22 +0200 Subject: Fix test contracts. --- test/contracts/AuctionRegistrar.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'test/contracts/AuctionRegistrar.cpp') 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 { -- cgit v1.2.3