Add auction functions to ADB.

[?]
Dec 9, 2014, 7:23 PM
TZQJVHBAMDNWDBYCDE3SDVGBG2T5FOE3J5JAD6NENRW36XBHUUFQC

Dependencies

  • [2] LAROLAYU WIP
  • [3] 64VI73NP Server now compiles using abstracted SQLite
  • [4] 64C6AWH6 Rename Ananke -> Quixotic, project reboot.
  • [5] NTPC7KJE Trivial changes, feature scratchpad.
  • [6] EMVTF2IW WIP moving back to snap.
  • [7] FRPWIKCN Added log event parsing to Quixotic.Database.SQLite
  • [8] 5W5M56VJ Move library code to 'lib'

Change contents

  • replacement in lib/Quixotic/Database/SQLite.hs at line 10
    [3.3837][3.3837:3877]()
    import qualified Quixotic.Database as D
    [3.3837]
    [3.3877]
    import Quixotic.Database
  • replacement in lib/Quixotic/Database/SQLite.hs at line 13
    [3.3923][3.1192:1248]()
    sqliteADB :: SQLiteHandle -> IO (D.ADB IO SQLiteHandle)
    [3.3923]
    [3.1248]
    sqliteADB :: SQLiteHandle -> IO (ADB (EitherT Text IO) SQLiteHandle)
  • replacement in lib/Quixotic/Database/SQLite.hs at line 16
    [3.1307][3.4032:4076](),[3.4032][3.4032:4076]()
    return $ D.ADB recordEvent readWorkIndex
    [3.1307]
    [3.4076]
    return $ ADB
    { recordEvent = recordEvent'
    , readWorkIndex = readWorkIndex'
    , newAuction = undefined
    , readAuction = undefined
    , recordBid = undefined
    , readBids = undefined
    , createUser = undefined
    }
  • replacement in lib/Quixotic/Database/SQLite.hs at line 26
    [3.4077][3.4077:4160](),[3.4160][3.104:242](),[3.242][3.4291:4371](),[3.1637][3.4291:4371](),[3.4291][3.4291:4371]()
    recordEvent :: SQLiteHandle -> LogEntry -> IO ()
    recordEvent h (LogEntry ba ev) =
    void $ insertRow h "workEvents" [ ("btcAddr", unpack (address ba))
    , ("event", unpack (eventName ev))
    , ("eventTime", formatSqlTime (logTime ev)) ]
    [3.4077]
    [3.4371]
    recordEvent' :: LogEntry -> ReaderT SQLiteHandle (EitherT Text IO) ()
    recordEvent' (LogEntry ba ev) = do
    db <- ask
    lift . lift . void $ insertRow db "workEvents"
    [ ("btcAddr", unpack (address ba))
    , ("event", unpack (eventName ev))
    , ("eventTime", formatSqlTime (logTime ev)) ]
  • replacement in lib/Quixotic/Database/SQLite.hs at line 34
    [3.4372][3.243:302](),[3.302][3.4433:4455](),[3.1369][3.4433:4455](),[3.4433][3.4433:4455]()
    readWorkIndex :: SQLiteHandle -> EitherT Text IO WorkIndex
    readWorkIndex db = do
    [3.4372]
    [3.1370]
    readWorkIndex' :: ReaderT SQLiteHandle (EitherT Text IO) WorkIndex
    readWorkIndex' = do
    db <- ask
  • replacement in lib/Quixotic/Database/SQLite.hs at line 38
    [3.1467][3.303:345]()
    rows <- bimapEitherT pack id baseResult
    [3.1467]
    [3.35]
    rows <- lift $ bimapEitherT pack id baseResult
  • replacement in lib/Quixotic/Database.hs at line 3
    [3.427][3.4937:4985](),[3.4936][3.4937:4985]()
    module Quixotic.Database
    ( ADB(..)
    ) where
    [3.427]
    [3.4985]
    module Quixotic.Database where
  • replacement in lib/Quixotic/Database.hs at line 5
    [3.4986][3.4986:5020]()
    import Control.Monad.Trans.Either
    [3.4986]
    [2.5521]
    import ClassyPrelude
  • edit in lib/Quixotic/Database.hs at line 9
    [3.5044][3.1639:1671]()
    import qualified Data.Text as T
  • replacement in lib/Quixotic/Database.hs at line 12
    [2.5614][2.5614:5674]()
    , readWorkIndex :: EitherT T.Text (ReaderT a m) WorkIndex
    [2.5614]
    [2.5674]
    , readWorkIndex :: ReaderT a m WorkIndex