orbland / contracts

🔮 Orb and related contracts. Auction + Harberger taxed ownership + invocations.
https://orb.land
MIT License
22 stars 5 forks source link

[INF] Move AuctionFinalized outside the if/else clauses #10

Closed odyslam closed 1 year ago

odyslam commented 1 year ago

Description

In finalizeAuction() the event emission is placed inside the if/else clause. That is not required and leads to duplicated code.

Suggestions

Move the event emission outside the if/else clause, at the end.

emit AuctionFinalized(winningBidder, winningBid);
startTime = 0;
endTime = 0;
lekevicius commented 1 year ago

That was done to to emit the event before zero'ing winningBidder and winningBid. I think we could simplify this code if we're certain that it doesn't change anything. Again, perhaps do the test suite before this change.