Factor winningBids for easier testing.

[?]
Mar 5, 2016, 3:33 AM
GLFF5ZDKWI7WKPZSAEE3IUM27LL6DFOPIL4VPODXYXV3BCSCJ6GQC

Dependencies

  • [2] NEDDHXUK Reformat via stylish-haskell
  • [3] UUR6SMCA Add start of specs for auctions.
  • [4] WO2MINIF Auctions now compile!
  • [5] TLQ72DSJ Lenses, sqlite-simple
  • [6] KEP5WUFJ Convert project to stack-based build.
  • [7] 75N3UJ4J More progression toward lenses.
  • [8] ZP62WC47 Begin conversion to build with stack.
  • [9] IZEVQF62 Work in progress replacing sqlite with postgres.
  • [10] M4KM76DG Merge branch 'stackify'
  • [11] F2XLL7XW Remove Ord Bid & sort in favor of sortBy
  • [12] 7HPY3QPF Fix linting errors. (yay hlint!)
  • [*] LAROLAYU WIP

Change contents

  • replacement in lib/Aftok/Auction.hs at line 44
    [4.369][2.298:325]()
    winningBids auction bids =
    [4.369]
    [4.323]
    winningBids auction = winningBids' (auction ^. raiseAmount)
    winningBids' :: Satoshi -> [Bid] -> [Bid]
    winningBids' raiseAmount' bids =
  • replacement in lib/Aftok/Auction.hs at line 51
    [4.538][2.326:390]()
    | total + (x ^. bidAmount) < (auction ^. raiseAmount) =
    [4.538]
    [4.3]
    | total + (x ^. bidAmount) < raiseAmount' =
  • replacement in lib/Aftok/Auction.hs at line 55
    [4.727][2.391:436](),[2.436][4.274:333](),[4.274][4.274:333]()
    | total < (auction ^. raiseAmount) =
    let remainder = (auction ^. raiseAmount) - total
    [4.727]
    [4.375]
    | total < raiseAmount' =
    let remainder = raiseAmount' - total
  • replacement in test/Aftok/AuctionSpec.hs at line 16
    [3.412][3.412:419]()
    spec =
    [3.412]
    [3.419]
    spec = do
  • edit in test/Aftok/AuctionSpec.hs at line 26
    [3.839]
    [3.839]
    describe "winning bids" $
    it "determines a sufficient number of winners to fulfill the raise amount" $
    True `shouldBe` True