diff --git a/contracts/HashRegistrar.sol b/contracts/HashRegistrar.sol index 739ec53b..d8c91fb3 100644 --- a/contracts/HashRegistrar.sol +++ b/contracts/HashRegistrar.sol @@ -28,8 +28,6 @@ contract HashRegistrar is Registrar { mapping (bytes32 => Entry) _entries; mapping (address => mapping (bytes32 => Deed)) public sealedBids; - - enum Mode { Open, Auction, Owned, Forbidden, Reveal, NotYetAvailable } uint32 constant totalAuctionLength = 5 days; uint32 constant revealPeriod = 48 hours; @@ -346,6 +344,11 @@ contract HashRegistrar is Registrar { hash; deed; registrationDate; // Don't warn about unused variables } + function entries(bytes32 _hash) external view returns (Mode, address, uint, uint, uint) { + Entry storage h = _entries[_hash]; + return (state(_hash), address(h.deed), h.registrationDate, h.value, h.highestBid); + } + // State transitions for names: // Open -> Auction (startAuction) // Auction -> Reveal @@ -372,11 +375,6 @@ contract HashRegistrar is Registrar { } } - function entries(bytes32 _hash) public view returns (Mode, address, uint, uint, uint) { - Entry storage h = _entries[_hash]; - return (state(_hash), address(h.deed), h.registrationDate, h.value, h.highestBid); - } - /** * @dev Determines if a name is available for registration yet * diff --git a/contracts/Registrar.sol b/contracts/Registrar.sol index e3686ea4..fd5186c1 100644 --- a/contracts/Registrar.sol +++ b/contracts/Registrar.sol @@ -4,6 +4,8 @@ import "./Deed.sol"; interface Registrar { + enum Mode { Open, Auction, Owned, Forbidden, Reveal, NotYetAvailable } + event AuctionStarted(bytes32 indexed hash, uint registrationDate); event NewBid(bytes32 indexed hash, address indexed bidder, uint deposit); event BidRevealed(bytes32 indexed hash, address indexed owner, uint value, uint8 status); @@ -11,7 +13,6 @@ interface Registrar { event HashReleased(bytes32 indexed hash, uint value); event HashInvalidated(bytes32 indexed hash, string indexed name, uint value, uint registrationDate); - function startAuction(bytes32 _hash) external; function startAuctions(bytes32[] calldata _hashes) external; function newBid(bytes32 sealedBid) external payable; @@ -25,4 +26,5 @@ interface Registrar { function eraseNode(bytes32[] calldata labels) external; function transferRegistrars(bytes32 _hash) external; function acceptRegistrarTransfer(bytes32 hash, Deed deed, uint registrationDate) external; + function entries(bytes32 _hash) external view returns (Mode, address, uint, uint, uint); }