From aa08460d94f0e3ac8e067f89786175fb5ebba73b Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Thu, 12 Jul 2018 00:43:19 +0100 Subject: Replace throw with revert() in end-to-end tests --- test/contracts/AuctionRegistrar.cpp | 10 +++++----- test/contracts/FixedFeeRegistrar.cpp | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'test/contracts') diff --git a/test/contracts/AuctionRegistrar.cpp b/test/contracts/AuctionRegistrar.cpp index 4f135730..8bfd97df 100644 --- a/test/contracts/AuctionRegistrar.cpp +++ b/test/contracts/AuctionRegistrar.cpp @@ -125,26 +125,26 @@ contract GlobalRegistrar is Registrar, AuctionSystem { emit Changed(_name); if (previousOwner != 0x0000000000000000000000000000000000000000) { if (!record.owner.send(auction.sumOfBids - auction.highestBid / 100)) - throw; + revert(); } else { if (!auction.highestBidder.send(auction.highestBid - auction.secondHighestBid)) - throw; + revert(); } } function reserve(string _name) external payable { if (bytes(_name).length == 0) - throw; + revert(); bool needAuction = requiresAuction(_name); if (needAuction) { if (now < m_toRecord[_name].renewalDate) - throw; + revert(); bid(_name, msg.sender, msg.value); } else { Record storage record = m_toRecord[_name]; if (record.owner != 0x0000000000000000000000000000000000000000) - throw; + revert(); m_toRecord[_name].owner = msg.sender; emit Changed(_name); } diff --git a/test/contracts/FixedFeeRegistrar.cpp b/test/contracts/FixedFeeRegistrar.cpp index ff683de0..9ebf109e 100644 --- a/test/contracts/FixedFeeRegistrar.cpp +++ b/test/contracts/FixedFeeRegistrar.cpp @@ -84,7 +84,7 @@ contract FixedFeeRegistrar is Registrar { function disown(string memory _name, address _refund) onlyrecordowner(_name) { delete m_recordData[uint(keccak256(bytes(_name))) / 8]; if (!_refund.send(c_fee)) - throw; + revert(); emit Changed(_name); } function transfer(string memory _name, address _newOwner) onlyrecordowner(_name) { -- cgit