Start of addition of project infrastructure.

[?]
Jan 24, 2015, 2:59 AM
5XFJNUAZUCQ3WCGW4QRIAWR764QYDOPHOIVO2TRMGSSG7UDX2M2AC

Dependencies

  • [2] BROSTG5K Beginning of modularization of server.
  • [3] 4IQVQL4T Added client for payouts endpoint.
  • [4] IZEVQF62 Work in progress replacing sqlite with postgres.
  • [5] BXGLKYRX Added primitive user registration handler.
  • [6] TZQJVHBA Add auction functions to ADB.
  • [7] W35DDBFY Factor common JSON conversions up into client lib module.
  • [8] EMVTF2IW WIP moving back to snap.
  • [9] WO2MINIF Auctions now compile!
  • [10] 75N3UJ4J More progression toward lenses.
  • [11] TNR3TEHK Switch to Postgres + snaplet arch compiles.
  • [12] 64VI73NP Server now compiles using abstracted SQLite
  • [13] 64C6AWH6 Rename Ananke -> Quixotic, project reboot.
  • [14] LAROLAYU WIP
  • [15] NTPC7KJE Trivial changes, feature scratchpad.
  • [16] TCOAKCGG Completed conversion to snap.
  • [17] 5W5M56VJ Move library code to 'lib'

Change contents

  • file move: Auction.hs (----------)Auctions.hs (----------)
    [3.18]
    [3.5084]
  • replacement in lib/Quixotic/Auctions.hs at line 1
    [3.5084][3.3:95]()
    {-# LANGUAGE ScopedTypeVariables, OverloadedStrings, NoImplicitPrelude, TemplateHaskell #-}
    [3.5084]
    [3.5160]
    {-# LANGUAGE TemplateHaskell #-}
  • replacement in lib/Quixotic/Auctions.hs at line 3
    [3.5161][3.5161:5191]()
    module Quixotic.Auction where
    [3.5161]
    [3.5191]
    module Quixotic.Auctions where
  • replacement in lib/Quixotic/Database/PostgreSQL.hs at line 18
    [3.1028][3.1028:1052]()
    import Quixotic.Auction
    [3.1028]
    [3.1052]
    import Quixotic.Auctions
  • replacement in lib/Quixotic/Database/SQLite.hs at line 14
    [3.3837][3.1046:1070]()
    import Quixotic.Auction
    [3.3837]
    [3.4]
    import Quixotic.Auctions
  • replacement in lib/Quixotic/Database.hs at line 8
    [3.838][3.5521:5567](),[3.6577][3.5521:5567](),[3.5020][3.5521:5567]()
    import Quixotic.Auction
    import Quixotic.Users
    [3.6577]
    [3.5020]
    import Quixotic.Auctions
    import Quixotic.Projects
  • edit in lib/Quixotic/Database.hs at line 11
    [3.5044]
    [3.5044]
    import Quixotic.Users
  • replacement in lib/Quixotic/Database.hs at line 20
    [3.6687][3.6687:7012]()
    { recordEvent :: UserId -> LogEntry -> m ()
    , readWorkIndex :: m WorkIndex
    , newAuction :: Auction -> m AuctionId
    , readAuction :: AuctionId -> m (Maybe Auction)
    , recordBid :: AuctionId -> Bid -> m ()
    , readBids :: AuctionId -> m [Bid]
    , createUser :: User -> m UserId
    , findUser :: UserId -> m (Maybe User)
    [3.6687]
    [3.799]
    { recordEvent :: ProjectId -> UserId -> LogEntry -> m ()
    , readWorkIndex :: ProjectId -> m WorkIndex
    , newAuction :: ProjectId -> Auction -> m AuctionId
    , readAuction :: ProjectId -> AuctionId -> m (Maybe Auction)
    , recordBid :: ProjectId -> AuctionId -> Bid -> m ()
    , readBids :: ProjectId -> AuctionId -> m [Bid]
    , createUser :: User -> m UserId
    , findUser :: UserId -> m (Maybe User)
  • file addition: Projects.hs (----------)
    [3.18]
    {-# LANGUAGE TemplateHaskell #-}
    module Quixotic.Projects where
    import ClassyPrelude
    import Control.Lens
    import Network.Bitcoin
    import Quixotic
    import Quixotic.Users
    newtype ProjectId = ProjectId Int64 deriving (Show, Eq)
    makePrisms ''ProjectId
    data Project = Project
    { _projectName :: Text
    , _inceptionDate :: UTCTime
    , _initiator :: UserId
    }
    makeLenses ''Project
    data Invitation = Invitation
    { _projectId :: ProjectId
    , _currentMember :: UserId
    , _sentAt :: UTCTime
    , _toAddr :: BtcAddr
    , _amount :: BTC
    }
    makeLenses ''Invitation
    data Acceptance = Acceptance
    { _acceptedInvitation :: Int64
    , _blockHeight :: Integer
    , _observedAt :: UTCTime
    }
    makeLenses ''Acceptance
    data Cancellation = Cancellation
    { _cancelledInvitation :: Int64
    , _requestedAt :: UTCTime
    }
    makeLenses ''Cancellation
  • edit in quixotic.cabal at line 23
    [3.585][3.1:40]()
    Quixotic.Auction
  • edit in quixotic.cabal at line 30
    [3.751]
    [3.857]
    Quixotic.Auctions
    Quixotic.Projects
  • replacement in server/Quixotic/Api/Users.hs at line 59
    [2.4618][2.4618:4727]()
    (AuthHeader uname pwd) <- either (throwDenied . AU.AuthError) pure $ parseOnly authHeaderParser rawHeader
    [2.4618]
    [2.4727]
    let parsedHeader = parseOnly authHeaderParser rawHeader
    (AuthHeader uname pwd) <- either (throwDenied . AU.AuthError) pure parsedHeader