aboutsummaryrefslogtreecommitdiffstats
path: root/test/contracts
diff options
context:
space:
mode:
authorchriseth <c@ethdev.com>2016-06-29 06:14:22 +0800
committerchriseth <c@ethdev.com>2016-06-29 06:14:50 +0800
commitccba76384510ea3aa3565029a8a68ca8f777a4ea (patch)
tree67c5d08757b9215c880bb9ed6b7f95588621e2b2 /test/contracts
parent272a9d94d2d42cbaf3ac26bd72132bbc74d6e22c (diff)
downloaddexon-solidity-ccba76384510ea3aa3565029a8a68ca8f777a4ea.tar
dexon-solidity-ccba76384510ea3aa3565029a8a68ca8f777a4ea.tar.gz
dexon-solidity-ccba76384510ea3aa3565029a8a68ca8f777a4ea.tar.bz2
dexon-solidity-ccba76384510ea3aa3565029a8a68ca8f777a4ea.tar.lz
dexon-solidity-ccba76384510ea3aa3565029a8a68ca8f777a4ea.tar.xz
dexon-solidity-ccba76384510ea3aa3565029a8a68ca8f777a4ea.tar.zst
dexon-solidity-ccba76384510ea3aa3565029a8a68ca8f777a4ea.zip
Fix test contracts.
Diffstat (limited to 'test/contracts')
-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) {