Autoformat sources.

[?]
Sep 12, 2020, 12:59 AM
UWMGUJOW5X5HQTS76T2FD7MNAJF7SESPQVU5FDIZO52V75TT2X6AC

Dependencies

  • [2] ZKFETYRK Print network information in address parse failure message.
  • [3] 7OTVLW6G Properly ignore redundant interval starts.
  • [4] DJATFGIC Support client builds in nix-shell --pure.
  • [5] YWNTVA7P Fix broken auction test.
  • [6] Y3LIJ5US Add handler for CreatePaymentRequest
  • [7] TLQ72DSJ Lenses, sqlite-simple
  • [8] 4FDQGIXN Make payment request retrieval key an opaque 32-bit hash.
  • [9] POX3UAMT Enabling logging of time to contributor/project accounts
  • [10] 4R7XIYK3 Switch from ClassyPrelude to Relude
  • [11] EFSXYZPO Autoformat everything with brittany.
  • [12] QMEYU4MW Add display for prior intervals.
  • [13] KNSI575V Cleanup of EventLog types.
  • [14] RSF6UAJK Break out api module for timeline.
  • [15] MGOF7IUF Update TASKS list to reflect completed projects.
  • [16] LTSVBVA2 Update to a recent haskoin-core. Fix Stack build.
  • [17] O722AOKE Add route to allow crediting of events to users/projects.
  • [18] Q5X5RYQL stylish-haskell reformatting
  • [19] O227CEAV Adds storage of original event JSON for some DBOp constructors.
  • [20] GKGVYBZG Added JSON serialization to TimeLog
  • [21] SLL7262C Make depreciation functions more flexible.
  • [22] UILI6PIL The route-based logStart/logStop is nicer.
  • [23] 7KZP4RHZ Switch from Data.Time to Data.Thyme
  • [24] O5FVTOM6 Undo JSON silliness, enable a couple more routes.
  • [25] A6HKMINB Attempting to improve JSON handling.
  • [26] SEWTRB6S Implement payment request creation functions.
  • [27] Z24SZOGZ Return richer information from event logging calls.
  • [28] EW2XN7KU Update docker build, clean up migration for payments tables.
  • [29] 2J37EVJM Check for an open interval on project switch.
  • [30] EMVTF2IW WIP moving back to snap.
  • [31] RN7EI6IN Update database layer to use CreditTo
  • [32] 2KZPOGRB Once you get Haskell to compile, the tests pass!
  • [33] W35DDBFY Factor common JSON conversions up into client lib module.
  • [34] NEDDHXUK Reformat via stylish-haskell
  • [35] ASF3UPJL Add auction creation and bid handlers
  • [36] GMYPBCWE Make docker-compose work.
  • [37] NLZ3JXLO Fix formatting with stylish-haskell.
  • [38] AWWC6P5Z Add migration to include payment network with addresses.
  • [39] 3GBSDS5P Fix out-of-date test code, add skeleton for payments spec.
  • [40] GLFF5ZDK Factor winningBids for easier testing.
  • [41] LAROLAYU WIP
  • [42] NAS4BFL4 Trivial stylish-haskell reformat.
  • [43] JFOEOFGA stylish-haskell formatting.
  • [44] XTBSG4C7 Adding serveJSON combinator to eliminate some boilerplate from handlers.
  • [45] NMWWP4ZN Trying out Hspec
  • [46] DFOBMSAO Initial work on payments API
  • [47] PBD7LZYQ Postgres & auth are beginning to function.
  • [48] Y35QCWYW Minor improvement in WorkIndex type to eliminate duplicated information.
  • [49] NJNMO72S Add zcash.com submodule and update client to modern halogen.
  • [50] UUR6SMCA Add start of specs for auctions.
  • [51] J6S23MDG Use server timestamps for interval start and end.
  • [52] RSEB2NFG Replacing Snap with Scotty.
  • [53] SCXG6TJW Make log reduction safer in presence of overlapping events.
  • [54] LHJ2HFXV Add property test for auction algorithm.
  • [55] B6HWAPDP Modularize & update to recent haskoin.
  • [56] AL37SVTC Implement payments service endpoints.
  • [57] P6NR2CGX Beginning of implementation of depreciation.
  • [58] 5DRIWGLU Improving TimeLog specs
  • [59] 5OI44E4E Add authentication to auction search.
  • [60] 2OIPAQCB Merge branch 'master' of github.com:nuttycom/ananke
  • [61] ZIG57EE6 Fix project selection, end log end on project switch.
  • [62] HO2PFRAB Client login now handles response correctly.
  • [63] BROSTG5K Beginning of modularization of server.
  • [64] QADKFHAR Adds CreatePayment handler implementation.
  • [65] Z7KS5XHH Very WIP. Wow.
  • [66] RPAJLHMT Change to use UUIDs instead of ints for primary keys.
  • [67] FXJQACES Ensure that auction is not ended at the time of bid
  • [68] PT4276XC Add logout functionality.
  • [69] WZFQDWW4 Add retrieval/storage of current exchange rate data to payment recording.
  • [70] GCVQD44V Create amends endpoint, switch to UUID primary keys
  • [71] I2KHGVD4 Require project permissions for access to most data.
  • [72] HMDM3B55 Implement core of payments/billing infrastructure.
  • [73] 64C6AWH6 Rename Ananke -> Quixotic, project reboot.
  • [74] 4U7F3CPI THE GREAT RENAMING OF THINGS!
  • [75] QMRKFEPG Refactor QDB to use a free monad algebra instead.
  • [76] BSIUHCGF Add payment response handler.
  • [77] 7DBNV3GV Initial, stack-based impl of time log event reduction.
  • [78] NVOCQVAS Initial failing tests.
  • [79] IPG33FAW Add billing daemon
  • [80] 4QX5E5AC Initial compilation of payouts function succeeds.
  • [81] N4NDAZYT Initial implementation of payouts.
  • [82] EQXRXRZD Changed to use tasty instead of test-framework
  • [83] IZEVQF62 Work in progress replacing sqlite with postgres.
  • [84] 2XQD6KKK Add invitation logic and clean up DBProg error handling.
  • [85] HALRDT2F Added initial auction create route.
  • [86] HBULCDN6 Add tests for auction winner determination algorithm.
  • [87] 7HPY3QPF Fix linting errors. (yay hlint!)
  • [88] 73NDXDEZ Begin implementation of billing event persistence.
  • [*] ADMKQQGC Initial empty Snap project.
  • [*] RFYEVKZQ Add nix-shell based build environment.

Change contents

  • replacement in daemon/AftokD/AftokM.hs at line 19
    [6.645][6.57477:57539](),[6.57539][6.890:1001](),[6.890][6.890:1001](),[6.1063][6.1063:1113]()
    import Control.Monad.Trans.Except ( withExceptT
    )
    import Control.Monad.Trans.Reader ( mapReaderT
    )
    [6.645]
    [6.2042]
    import Control.Monad.Trans.Except ( withExceptT )
    import Control.Monad.Trans.Reader ( mapReaderT )
  • replacement in daemon/AftokD/AftokM.hs at line 35
    [6.1781][6.57540:57592]()
    import Haskoin.Address ( Address )
    [6.1781]
    [6.1841]
    import Haskoin.Address ( Address )
  • replacement in daemon/AftokD/AftokM.hs at line 44
    [6.2446][6.57593:57645]()
    import Bippy.Types ( Satoshi )
    [6.2446]
    [6.2483]
    import Bippy.Types ( Satoshi )
  • replacement in lib/Aftok/Auction.hs at line 19
    [6.9106][6.57715:57771]()
    import Bippy.Types ( Satoshi(..) )
    [6.9106]
    [6.5213]
    import Bippy.Types ( Satoshi(..) )
  • replacement in lib/Aftok/Billables.hs at line 95
    [6.645][6.725:728](),[6.728][6.649:708](),[6.649][6.649:708](),[6.708][6.729:786](),[6.786][6.766:787](),[6.766][6.766:787]()
    {-
    - A stream of dates upon which the specified subscription
    - should be billed, beginning with the first day of the
    - subscription.
    -}
    [6.645]
    [6.243]
    -- | A stream of dates upon which the specified subscription
    -- should be billed, beginning with the first day of the
    -- subscription.
  • replacement in lib/Aftok/Billables.hs at line 100
    [6.860][6.860:962]()
    let rec = view (billable . recurrence) s
    subEndDay = preview (endTime . _Just . C._utctDay) s
    [6.860]
    [6.962]
    unfoldr next (Just $ view (startTime . C._utctDay) s)
    where
    rec = view (billable . recurrence) s
    subEndDay = preview (endTime . _Just . C._utctDay) s
  • replacement in lib/Aftok/Billables.hs at line 105
    [6.963][6.963:1138]()
    next :: Maybe T.Day -> Maybe (T.Day, Maybe T.Day)
    next d = do
    d' <- d
    if (all (d' <) subEndDay) then Just (d', nextRecurrence rec d') else Nothing
    [6.963]
    [6.1138]
    next :: Maybe T.Day -> Maybe (T.Day, Maybe T.Day)
    next d = do
    d' <- d
    if (all (d' <) subEndDay) then Just (d', nextRecurrence rec d') else Nothing
  • edit in lib/Aftok/Billables.hs at line 110
    [6.1139][6.1139:1199]()
    in unfoldr next (Just $ view (startTime . C._utctDay) s)
  • replacement in lib/Aftok/Config.hs at line 21
    [6.11259][6.57839:57884]()
    import qualified Bippy.Types as BT
    [6.11259]
    [6.11312]
    import qualified Bippy.Types as BT
  • replacement in lib/Aftok/Currency/Bitcoin.hs at line 10
    [6.4550][6.57887:57943]()
    import Bippy.Types ( Satoshi(..) )
    [6.4550]
    [6.57943]
    import Bippy.Types ( Satoshi(..) )
  • replacement in lib/Aftok/Database/PostgreSQL.hs at line 57
    [6.1738][6.58041:58147]()
    import Bippy.Types ( Satoshi(..) )
    import Haskoin.Address ( Address
    [6.1738]
    [6.58147]
    import Bippy.Types ( Satoshi(..) )
    import Haskoin.Address ( Address
  • replacement in lib/Aftok/Database/PostgreSQL.hs at line 62
    [6.15596][6.58270:58322]()
    import Haskoin.Constants ( Network )
    [6.15596]
    [6.1123]
    import Haskoin.Constants ( Network )
  • replacement in lib/Aftok/Database/PostgreSQL.hs at line 107
    [6.454][6.15891:15958](),[6.58363][6.15891:15958](),[6.7981][6.15891:15958](),[6.15958][2.4:186]()
    let err = returnError ConversionFailed
    f
    ("could not deserialize value " <> T.unpack fieldValue <>
    " to a valid BTC address for network " <> show n
    )
    [6.58363]
    [6.2131]
    let err = returnError
    ConversionFailed
    f
    ( "could not deserialize value "
    <> T.unpack fieldValue
    <> " to a valid BTC address for network "
    <> show n
    )
  • replacement in lib/Aftok/Database/PostgreSQL.hs at line 152
    [6.4400][6.4400:4408](),[6.4408][6.16412:16476](),[6.16412][6.16412:16476](),[6.16476][6.4409:4775]()
    where
    parser :: Text -> RowParser (CreditTo (NetworkId, Address))
    parser = \case
    "credit_to_address" -> CreditToCurrency <$> (addressParser mode <* nullField <* nullField)
    "credit_to_user" -> CreditToUser <$> (nullField *> nullField *> idParser UserId <* nullField)
    "credit_to_project" -> CreditToProject <$> (nullField *> nullField *> nullField *> idParser ProjectId)
    _ -> empty
    [6.4400]
    [6.1409]
    where
    parser :: Text -> RowParser (CreditTo (NetworkId, Address))
    parser = \case
    "credit_to_address" ->
    CreditToCurrency <$> (addressParser mode <* nullField <* nullField)
    "credit_to_user" ->
    CreditToUser <$> (nullField *> nullField *> idParser UserId <* nullField)
    "credit_to_project" ->
    CreditToProject
    <$> (nullField *> nullField *> nullField *> idParser ProjectId)
    _ -> empty
  • replacement in lib/Aftok/Database.hs at line 32
    [6.5920][6.58469:58521]()
    import Haskoin.Address ( Address )
    [6.5920]
    [6.18985]
    import Haskoin.Address ( Address )
  • replacement in lib/Aftok/Database.hs at line 42
    [6.6156][6.26302:26462]()
    CreateUser ::BTCUser -> DBOp UserId
    FindUser ::UserId -> DBOp (Maybe BTCUser)
    FindUserByName ::UserName -> DBOp (Maybe (UserId, BTCUser))
    [6.6156]
    [6.6305]
    CreateUser :: BTCUser -> DBOp UserId
    FindUser :: UserId -> DBOp (Maybe BTCUser)
    FindUserByName :: UserName -> DBOp (Maybe (UserId, BTCUser))
  • replacement in lib/Aftok/Database.hs at line 46
    [6.6306][6.26463:27005]()
    CreateProject ::Project -> DBOp ProjectId
    FindProject ::ProjectId -> DBOp (Maybe Project)
    ListProjects ::DBOp [ProjectId]
    FindSubscribers ::ProjectId -> DBOp [UserId]
    FindUserProjects ::UserId -> DBOp [(ProjectId, Project)]
    AddUserToProject ::ProjectId -> InvitingUID -> InvitedUID -> DBOp ()
    CreateInvitation ::ProjectId -> InvitingUID -> Email -> C.UTCTime -> DBOp InvitationCode
    FindInvitation ::InvitationCode -> DBOp (Maybe Invitation)
    AcceptInvitation ::UserId -> InvitationCode -> C.UTCTime -> DBOp ()
    [6.6306]
    [6.6534]
    CreateProject :: Project -> DBOp ProjectId
    FindProject :: ProjectId -> DBOp (Maybe Project)
    ListProjects :: DBOp [ProjectId]
    FindSubscribers :: ProjectId -> DBOp [UserId]
    FindUserProjects :: UserId -> DBOp [(ProjectId, Project)]
    AddUserToProject :: ProjectId -> InvitingUID -> InvitedUID -> DBOp ()
    CreateInvitation :: ProjectId -> InvitingUID -> Email -> C.UTCTime -> DBOp InvitationCode
    FindInvitation :: InvitationCode -> DBOp (Maybe Invitation)
    AcceptInvitation :: UserId -> InvitationCode -> C.UTCTime -> DBOp ()
  • replacement in lib/Aftok/Database.hs at line 56
    [6.6535][6.27006:27224](),[6.27224][6.3485:3576](),[6.3576][6.27304:27362](),[6.8231][6.27304:27362](),[6.27304][6.27304:27362]()
    CreateEvent ::ProjectId -> UserId -> LogEntry BTCNet -> DBOp EventId
    AmendEvent ::EventId -> EventAmendment BTCNet -> DBOp AmendmentId
    FindEvent ::EventId -> DBOp (Maybe (KeyedLogEntry BTCNet))
    FindEvents ::ProjectId -> UserId -> RangeQuery -> Word32 -> DBOp [LogEntry BTCNet]
    ReadWorkIndex ::ProjectId -> DBOp (WorkIndex BTCNet)
    [6.6535]
    [6.6857]
    CreateEvent :: ProjectId -> UserId -> LogEntry BTCNet -> DBOp EventId
    AmendEvent :: EventId -> EventAmendment BTCNet -> DBOp AmendmentId
    FindEvent :: EventId -> DBOp (Maybe (KeyedLogEntry BTCNet))
    FindEvents :: ProjectId -> UserId -> RangeQuery -> Word32 -> DBOp [LogEntry BTCNet]
    ReadWorkIndex :: ProjectId -> DBOp (WorkIndex BTCNet)
  • replacement in lib/Aftok/Database.hs at line 62
    [6.6858][6.27363:27571]()
    CreateAuction ::Auction -> DBOp AuctionId
    FindAuction ::AuctionId -> DBOp (Maybe Auction)
    CreateBid ::AuctionId -> Bid -> DBOp BidId
    FindBids ::AuctionId -> DBOp [(BidId, Bid)]
    [6.6858]
    [6.4052]
    CreateAuction :: Auction -> DBOp AuctionId
    FindAuction :: AuctionId -> DBOp (Maybe Auction)
    CreateBid :: AuctionId -> Bid -> DBOp BidId
    FindBids :: AuctionId -> DBOp [(BidId, Bid)]
  • replacement in lib/Aftok/Database.hs at line 67
    [6.4053][6.27572:27753]()
    CreateBillable ::UserId -> Billable -> DBOp BillableId
    FindBillable ::BillableId -> DBOp (Maybe Billable)
    FindBillables ::ProjectId -> DBOp [(BillableId, Billable)]
    [6.4053]
    [6.13382]
    CreateBillable :: UserId -> Billable -> DBOp BillableId
    FindBillable :: BillableId -> DBOp (Maybe Billable)
    FindBillables :: ProjectId -> DBOp [(BillableId, Billable)]
  • replacement in lib/Aftok/Database.hs at line 71
    [6.13383][6.27754:27981]()
    CreateSubscription ::UserId -> BillableId -> T.Day -> DBOp SubscriptionId
    FindSubscription ::SubscriptionId -> DBOp (Maybe Subscription)
    FindSubscriptions ::UserId -> ProjectId -> DBOp [(SubscriptionId, Subscription)]
    [6.13383]
    [6.4199]
    CreateSubscription :: UserId -> BillableId -> T.Day -> DBOp SubscriptionId
    FindSubscription :: SubscriptionId -> DBOp (Maybe Subscription)
    FindSubscriptions :: UserId -> ProjectId -> DBOp [(SubscriptionId, Subscription)]
  • replacement in lib/Aftok/Database.hs at line 75
    [6.4200][6.27982:28358]()
    CreatePaymentRequest ::PaymentRequest -> DBOp PaymentRequestId
    FindPaymentRequests ::SubscriptionId -> DBOp [(PaymentRequestId, PaymentRequest)]
    FindUnpaidRequests ::SubscriptionId -> DBOp [BillDetail]
    FindPaymentRequest ::PaymentKey -> DBOp (Maybe (PaymentRequestId, PaymentRequest))
    FindPaymentRequestId ::PaymentRequestId -> DBOp (Maybe PaymentRequest)
    [6.4200]
    [6.5194]
    CreatePaymentRequest :: PaymentRequest -> DBOp PaymentRequestId
    FindPaymentRequests :: SubscriptionId -> DBOp [(PaymentRequestId, PaymentRequest)]
    FindUnpaidRequests :: SubscriptionId -> DBOp [BillDetail]
    FindPaymentRequest :: PaymentKey -> DBOp (Maybe (PaymentRequestId, PaymentRequest))
    FindPaymentRequestId :: PaymentRequestId -> DBOp (Maybe PaymentRequest)
  • replacement in lib/Aftok/Database.hs at line 81
    [6.5195][6.28359:28471]()
    CreatePayment ::Payment -> DBOp PaymentId
    FindPayments ::PaymentRequestId -> DBOp [(PaymentId, Payment)]
    [6.5195]
    [6.7074]
    CreatePayment :: Payment -> DBOp PaymentId
    FindPayments :: PaymentRequestId -> DBOp [(PaymentId, Payment)]
  • replacement in lib/Aftok/Database.hs at line 84
    [6.7075][6.3:65]()
    RaiseDBError :: forall x y. DBError -> DBOp x -> DBOp y
    [6.7075]
    [6.7204]
    RaiseDBError :: forall x y. DBError -> DBOp x -> DBOp y
  • replacement in lib/Aftok/Database.hs at line 220
    [6.29294][6.3577:3664]()
    :: (MonadDB m) => ProjectId -> UserId -> RangeQuery -> Word32 -> m [LogEntry BTCNet]
    [6.29294]
    [6.3664]
    :: (MonadDB m)
    => ProjectId
    -> UserId
    -> RangeQuery
    -> Word32
    -> m [LogEntry BTCNet]
  • replacement in lib/Aftok/Json.hs at line 36
    [6.232][6.58523:58573]()
    import Haskoin.Address ( Address
    [6.232]
    [6.32036]
    import Haskoin.Address ( Address
  • replacement in lib/Aftok/Json.hs at line 136
    [6.4415][6.4415:4497]()
    v1 $ obj
    [(name <> "Id") .= idValue _id x
    , name .= (x ^. _value)
    ]
    [6.4415]
    [6.249]
    v1 $ obj [(name <> "Id") .= idValue _id x, name .= (x ^. _value)]
  • replacement in lib/Aftok/Json.hs at line 264
    [6.24892][6.36226:36265](),[6.36265][6.4576:4849]()
    workIndexJSON nmode (WorkIndex widx) =
    v2 $ obj ["workIndex" .= fmap widxRec (MS.assocs widx)]
    where
    widxRec :: (CreditTo (NetworkId, Address), NonEmpty Interval) -> Value
    widxRec (c, l) = object
    [ "creditTo" .= creditToJSON nmode c
    , "intervals" .= (intervalJSON <$> L.toList l)
    ]
    [6.24892]
    [6.2061]
    workIndexJSON nmode (WorkIndex widx) = v2
    $ obj ["workIndex" .= fmap widxRec (MS.assocs widx)]
    where
    widxRec :: (CreditTo (NetworkId, Address), NonEmpty Interval) -> Value
    widxRec (c, l) = object
    [ "creditTo" .= creditToJSON nmode c
    , "intervals" .= (intervalJSON <$> L.toList l)
    ]
  • replacement in lib/Aftok/Json.hs at line 311
    [6.26772][6.5218:5299]()
    qdbBillableJSON = qdbJSON "billable" (_1 . B._BillableId) (_2 . to billableJSON)
    [6.26772]
    [6.1844]
    qdbBillableJSON =
    qdbJSON "billable" (_1 . B._BillableId) (_2 . to billableJSON)
  • replacement in lib/Aftok/Payments/Types.hs at line 22
    [6.10774][6.58685:58782]()
    import qualified Bippy.Proto as P
    import Bippy.Types ( expiryTime
    [6.10774]
    [6.40434]
    import qualified Bippy.Proto as P
    import Bippy.Types ( expiryTime
  • replacement in lib/Aftok/Payments/Types.hs at line 28
    [6.40675][6.58783:58845]()
    import Haskoin.Address.Base58 ( decodeBase58Check )
    [6.40675]
    [6.10816]
    import Haskoin.Address.Base58 ( decodeBase58Check )
  • replacement in lib/Aftok/Payments.hs at line 8
    [6.11604][6.11604:11614]()
    ) where
    [6.11604]
    [6.5749]
    )
    where
  • replacement in lib/Aftok/Payments.hs at line 13
    [6.3883][6.2715:2845](),[6.5782][6.2715:2845](),[6.2845][6.28500:28572]()
    import Control.Error.Util (maybeT)
    import Control.Lens (makeClassy, makeClassyPrisms, review,
    view, (%~), (^.), traverseOf)
    [6.3883]
    [6.11677]
    import Control.Error.Util ( maybeT )
    import Control.Lens ( makeClassy
    , makeClassyPrisms
    , review
    , view
    , (%~)
    , (^.)
    , traverseOf
    )
  • replacement in lib/Aftok/Payments.hs at line 23
    [6.11713][6.2906:2972](),[6.28643][6.2972:3045](),[6.2972][6.2972:3045](),[6.3045][6.2358:2429]()
    import Control.Monad.Except (MonadError, throwError)
    import qualified Crypto.PubKey.RSA.Types as RSA (Error (..), PrivateKey)
    import Crypto.Random.Types (MonadRandom, getRandomBytes)
    [6.11713]
    [6.5839]
    import Control.Monad.Except ( MonadError
    , throwError
    )
    import qualified Crypto.PubKey.RSA.Types as RSA
    ( Error(..)
    , PrivateKey
    )
    import Crypto.Random.Types ( MonadRandom
    , getRandomBytes
    )
  • replacement in lib/Aftok/Payments.hs at line 34
    [6.5840][6.3101:3292]()
    import Data.AffineSpace ((.+^))
    import Data.Map.Strict (assocs)
    import Data.Thyme.Clock as C
    import Data.Thyme.Time as T
    [6.5840]
    [6.5916]
    import Data.AffineSpace ( (.+^) )
    import Data.Map.Strict ( assocs )
    import Data.Thyme.Clock as C
    import Data.Thyme.Time as T
  • replacement in lib/Aftok/Payments.hs at line 39
    [6.5917][6.58847:59122]()
    import qualified Bippy as B
    import qualified Bippy.Proto as P
    import qualified Bippy.Types as BT
    import Haskoin.Address (Address(..))
    import Haskoin.Address.Base58 (encodeBase58Check)
    import Haskoin.Script (ScriptOutput (..))
    [6.5917]
    [6.12157]
    import qualified Bippy as B
    import qualified Bippy.Proto as P
    import qualified Bippy.Types as BT
    import Haskoin.Address ( Address(..) )
    import Haskoin.Address.Base58 ( encodeBase58Check )
    import Haskoin.Script ( ScriptOutput(..) )
  • replacement in lib/Aftok/Payments.hs at line 47
    [6.5960][6.27324:27398]()
    import Aftok.Types (UserId, ProjectId, userAddress)
    [6.5960]
    [6.2319]
    import Aftok.Types ( UserId
    , ProjectId
    , userAddress
    )
  • replacement in lib/Aftok/Payments.hs at line 52
    [6.2352][6.27399:27489]()
    import Aftok.Currency.Bitcoin (NetworkId(..), NetworkMode, satoshi, toNetwork)
    [6.2352]
    [6.3624]
    import Aftok.Currency.Bitcoin ( NetworkId(..)
    , NetworkMode
    , satoshi
    , toNetwork
    )
  • replacement in lib/Aftok/Payments.hs at line 59
    [6.12334][6.27490:27538](),[6.27538][6.3716:3763](),[6.3716][6.3716:3763]()
    import Aftok.Project (depf)
    import qualified Aftok.TimeLog as TL
    [6.12334]
    [6.12459]
    import Aftok.Project ( depf )
    import qualified Aftok.TimeLog as TL
  • replacement in lib/Aftok/Payments.hs at line 101
    [6.29955][6.8496:8537](),[6.12612][6.8496:8537](),[6.8537][6.29956:30020](),[6.30020][6.8600:8698](),[6.8600][6.8600:8698](),[6.8698][6.4110:4137](),[6.4137][6.8726:9048](),[6.8726][6.8726:9048](),[6.9048][6.13259:13305](),[6.13259][6.13259:13305]()
    createPaymentRequests :: ( MonadRandom m
    , MonadReader r m, HasPaymentsConfig r
    , MonadError e m, AsPaymentError e
    , MonadDB m
    )
    => BillingOps m -- ^ generators for payment request components
    -> C.UTCTime -- ^ timestamp for payment request creation
    -> UserId -- ^ customer responsible for payment
    -> ProjectId -- ^ project whose worklog is to be paid
    -> m [PaymentRequestId]
    [6.29955]
    [6.9049]
    createPaymentRequests
    :: ( MonadRandom m
    , MonadReader r m
    , HasPaymentsConfig r
    , MonadError e m
    , AsPaymentError e
    , MonadDB m
    )
    => BillingOps m -- ^ generators for payment request components
    -> C.UTCTime -- ^ timestamp for payment request creation
    -> UserId -- ^ customer responsible for payment
    -> ProjectId -- ^ project whose worklog is to be paid
    -> m [PaymentRequestId]
  • replacement in lib/Aftok/Payments.hs at line 118
    [6.9183][6.4224:4261](),[6.4261][6.9221:9242](),[6.9221][6.9221:9242](),[6.9242][6.30021:30065](),[6.30065][6.9285:9325](),[6.9285][6.9285:9325]()
    createSubscriptionPaymentRequests ::
    ( MonadRandom m
    , MonadReader r m, HasPaymentsConfig r
    , MonadError e m, AsPaymentError e
    [6.9183]
    [6.9325]
    createSubscriptionPaymentRequests
    :: ( MonadRandom m
    , MonadReader r m
    , HasPaymentsConfig r
    , MonadError e m
    , AsPaymentError e
  • replacement in lib/Aftok/Payments.hs at line 131
    [6.2975][6.9523:9610](),[6.9523][6.9523:9610](),[6.9610][6.30066:30120]()
    billableSub <- maybeT (raiseSubjectNotFound . FindBillable $ sub ^. billable) pure $
    traverseOf billable findBillable sub
    [6.2975]
    [6.9653]
    billableSub <-
    maybeT (raiseSubjectNotFound . FindBillable $ sub ^. billable) pure
    $ traverseOf billable findBillable sub
  • replacement in lib/Aftok/Payments.hs at line 135
    [6.9698][6.9698:9870]()
    billableDates <- findUnbilledDates now (view billable billableSub) paymentRequests $
    takeWhile (< view _utctDay now) $ billingSchedule billableSub
    [6.9698]
    [6.2976]
    billableDates <-
    findUnbilledDates now (view billable billableSub) paymentRequests
    $ takeWhile (< view _utctDay now)
    $ billingSchedule billableSub
  • replacement in lib/Aftok/Payments.hs at line 141
    [6.9950][6.4288:4312](),[6.4312][6.9975:9996](),[6.9975][6.9975:9996](),[6.9996][6.30121:30165](),[6.30165][6.10039:10079](),[6.10039][6.10039:10079]()
    createPaymentRequest ::
    ( MonadRandom m
    , MonadReader r m, HasPaymentsConfig r
    , MonadError e m, AsPaymentError e
    [6.9950]
    [6.10079]
    createPaymentRequest
    :: ( MonadRandom m
    , MonadReader r m
    , HasPaymentsConfig r
    , MonadError e m
    , AsPaymentError e
  • replacement in lib/Aftok/Payments.hs at line 156
    [6.3096][6.13414:13427](),[6.10287][6.13414:13427](),[6.13414][6.13414:13427]()
    cfg <- ask
    [6.3096]
    [6.946]
    cfg <- ask
  • replacement in lib/Aftok/Payments.hs at line 171
    [6.10845][6.10845:11046](),[6.11046][6.4341:4442](),[6.4442][6.11148:11373](),[6.11148][6.11148:11373]()
    findUnbilledDates :: (MonadDB m, MonadError e m, AsPaymentError e)
    => C.UTCTime -- ^ the date against which payment request expiration should be checked
    -> Billable
    -> [(PaymentRequestId, PaymentRequest)] -- ^ the list of existing payment requests
    -> [T.Day] -- ^ the list of expected billing days
    -> m [T.Day] -- ^ the list of billing days for which no payment request exists
    findUnbilledDates now b (px @ (p : ps)) (dx @ (d : ds)) =
    [6.10845]
    [6.11373]
    findUnbilledDates
    :: (MonadDB m, MonadError e m, AsPaymentError e)
    => C.UTCTime -- ^ the date against which payment request expiration should be checked
    -> Billable
    -> [(PaymentRequestId, PaymentRequest)] -- ^ the list of existing payment requests
    -> [T.Day] -- ^ the list of expected billing days
    -> m [T.Day] -- ^ the list of billing days for which no payment request exists
    findUnbilledDates now b (px@(p : ps)) (dx@(d : ds)) =
  • replacement in lib/Aftok/Payments.hs at line 181
    [6.11474][6.4443:4541](),[6.4541][6.11573:11842](),[6.11573][6.11573:11842]()
    Expired r -> if view _utctDay now > addDays (view gracePeriod b) (view billingDate r)
    then throwError (review _Overdue (r ^. subscription))
    else fmap (d :) $ findUnbilledDates now b px dx -- d will be rebilled
    _ -> findUnbilledDates now b ps ds -- if paid or unpaid, nothing to do
    [6.11474]
    [6.4542]
    Expired r ->
    if view _utctDay now > addDays (view gracePeriod b) (view billingDate r)
    then throwError (review _Overdue (r ^. subscription))
    else fmap (d :) $ findUnbilledDates now b px dx -- d will be rebilled
    _ -> findUnbilledDates now b ps ds -- if paid or unpaid, nothing to do
  • replacement in lib/Aftok/Payments.hs at line 194
    [6.12126][6.4596:4628](),[6.4628][6.12159:12397](),[6.12159][6.12159:12397]()
    getRequestStatus :: (MonadDB m)
    => C.UTCTime -- ^ the date against which request expiration should be checked
    -> (PaymentRequestId, PaymentRequest) -- ^ the request for which to find a payment
    -> m PaymentRequestStatus
    [6.12126]
    [6.4629]
    getRequestStatus
    :: (MonadDB m)
    => C.UTCTime -- ^ the date against which request expiration should be checked
    -> (PaymentRequestId, PaymentRequest) -- ^ the request for which to find a payment
    -> m PaymentRequestStatus
  • replacement in lib/Aftok/Payments.hs at line 207
    [6.27914][6.27914:27999]()
    , MonadReader r m , HasPaymentsConfig r
    , MonadError e m, AsPaymentError e
    [6.27914]
    [6.27999]
    , MonadReader r m
    , HasPaymentsConfig r
    , MonadError e m
    , AsPaymentError e
  • replacement in lib/Aftok/Payments.hs at line 223
    [6.13342][6.13342:13434]()
    let expiry = (BT.Expiry . T.fromThyme . (billingTime .+^)) <$> (b ^. requestExpiryPeriod)
    [6.13342]
    [6.14551]
    let expiry =
    (BT.Expiry . T.fromThyme . (billingTime .+^))
    <$> (b ^. requestExpiryPeriod)
  • replacement in lib/Aftok/Payments.hs at line 227
    [6.14564][6.4755:4787](),[6.4787][6.28355:28396](),[6.28396][6.4808:4850](),[6.4808][6.4808:4850](),[6.4850][6.13534:13562](),[6.13534][6.13534:13562](),[6.13562][6.4851:4859](),[6.4859][6.13571:13627](),[6.13571][6.13571:13627]()
    pure $ B.createPaymentDetails
    (toNetwork (cfg ^. networkMode) BTC)
    outputs
    (T.fromThyme billingTime)
    expiry memo uri payload
    where
    payoutTime = T.mkUTCTime payoutDate (fromInteger 0)
    [6.14564]
    [6.14659]
    pure $ B.createPaymentDetails (toNetwork (cfg ^. networkMode) BTC)
    outputs
    (T.fromThyme billingTime)
    expiry
    memo
    uri
    payload
    where payoutTime = T.mkUTCTime payoutDate (fromInteger 0)
  • edit in lib/Aftok/Payments.hs at line 260
    [6.15253][6.15253:15254]()
  • replacement in lib/Aftok/Payments.hs at line 280
    [6.29228][6.29228:29283]()
    other -> throwError $ review _IllegalAddress other
    [6.29228]
    [6.6287]
    other -> throwError $ review _IllegalAddress other
  • replacement in lib/Aftok/Payments.hs at line 290
    [6.5208][6.5208:5302]()
    findPayableRequests :: (MonadDB m) => UserId -> SubscriptionId -> C.UTCTime -> m [BillDetail]
    [6.5208]
    [6.5302]
    findPayableRequests
    :: (MonadDB m) => UserId -> SubscriptionId -> C.UTCTime -> m [BillDetail]
  • replacement in lib/Aftok/Payments.hs at line 294
    [6.5367][6.5367:5641]()
    join <$> (traverse checkAccess $ filter (not . isExpired now . view _2) requests)
    where
    findOp = FindUnpaidRequests sid
    checkAccess d =
    if view (_3 . customer) d == uid
    then pure [d]
    else raiseOpForbidden uid (UserNotSubscriber sid) findOp
    [6.5367]
    join
    <$> (traverse checkAccess $ filter (not . isExpired now . view _2) requests)
    where
    findOp = FindUnpaidRequests sid
    checkAccess d = if view (_3 . customer) d == uid
    then pure [d]
    else raiseOpForbidden uid (UserNotSubscriber sid) findOp
  • replacement in lib/Aftok/TimeLog.hs at line 5
    [6.4159][6.4354:4399](),[6.4399][6.30637:30720](),[6.5248][6.4467:4517](),[6.30720][6.4467:4517](),[6.4467][6.4467:4517](),[6.2069][6.2136:2184](),[6.4517][6.2136:2184](),[6.3594][6.2136:2184](),[6.2184][6.9377:9394](),[6.9394][6.2185:2216](),[6.12][6.2185:2216](),[6.2216][6.5553:5584](),[6.5553][6.5553:5584]()
    ( LogEntry(..), creditTo, event, eventMeta
    , CreditTo(..), _CreditToCurrency, _CreditToUser, _CreditToProject, creditToName
    , LogEvent(..), eventName, nameEvent, eventTime
    , WorkIndex(WorkIndex), _WorkIndex, workIndex
    , DepF, toDepF
    , EventId(EventId), _EventId
    , ModTime(ModTime), _ModTime
    [6.4159]
    [6.6557]
    ( LogEntry(..)
    , creditTo
    , event
    , eventMeta
    , CreditTo(..)
    , _CreditToCurrency
    , _CreditToUser
    , _CreditToProject
    , creditToName
    , LogEvent(..)
    , eventName
    , nameEvent
    , eventTime
    , WorkIndex(WorkIndex)
    , _WorkIndex
    , workIndex
    , DepF
    , toDepF
    , EventId(EventId)
    , _EventId
    , ModTime(ModTime)
    , _ModTime
  • replacement in lib/Aftok/TimeLog.hs at line 28
    [6.6580][6.6580:6623](),[6.5345][6.5609:5635]()
    , AmendmentId(AmendmentId), _AmendmentId
    , Payouts(..), _Payouts
    [6.6580]
    [6.961]
    , AmendmentId(AmendmentId)
    , _AmendmentId
    , Payouts(..)
    , _Payouts
  • replacement in lib/Aftok/TimeLog.hs at line 34
    [6.48][6.987:997](),[6.987][6.987:997]()
    ) where
    [6.48]
    [6.997]
    )
    where
  • replacement in lib/Aftok/TimeLog.hs at line 37
    [6.998][6.30721:30765]()
    import Control.Arrow ((&&&))
    [6.998]
    [6.4192]
    import Control.Arrow ( (&&&) )
  • replacement in lib/Aftok/TimeLog.hs at line 40
    [6.4258][6.4258:4299]()
    import Data.Aeson as A
    [6.4258]
    [6.4299]
    import Data.Aeson as A
  • replacement in lib/Aftok/TimeLog.hs at line 42
    [6.4333][6.30766:30870](),[6.30870][6.4333:4374](),[6.4333][6.4333:4374](),[6.4374][6.30871:30965](),[6.30965][6.4374:4456](),[6.4374][6.4374:4456](),[6.4456][6.30966:31014](),[6.31014][6.4456:4498](),[6.4456][6.4456:4498](),[6.4498][6.31015:31165](),[6.31165][6.4537:4578](),[6.4537][6.4537:4578]()
    import Data.Eq (Eq, (==))
    import Data.Either (Either(..), rights)
    import Data.Foldable as F
    import Data.Function (($), (.), id)
    import Data.Functor (fmap)
    import Data.Heap as H
    import Data.List.NonEmpty as L
    import Data.Maybe (Maybe(..))
    import Data.Map.Strict as MS
    import Data.Ord (Ord(..), Ordering(..))
    import Data.Ratio (Rational)
    import Data.Text (Text)
    import Data.Thyme.Clock as C
    [6.4333]
    [6.4578]
    import Data.Eq ( Eq
    , (==)
    )
    import Data.Either ( Either(..)
    , rights
    )
    import Data.Foldable as F
    import Data.Function ( ($)
    , (.)
    , id
    )
    import Data.Functor ( fmap )
    import Data.Heap as H
    import Data.List.NonEmpty as L
    import Data.Maybe ( Maybe(..) )
    import Data.Map.Strict as MS
    import Data.Ord ( Ord(..)
    , Ordering(..)
    )
    import Data.Ratio ( Rational )
    import Data.Text ( Text )
    import Data.Thyme.Clock as C
  • replacement in lib/Aftok/TimeLog.hs at line 66
    [6.4639][6.31166:31256]()
    import Prelude ((/), (*))
    import Text.Show (Show)
    [6.4639]
    [6.618]
    import Prelude ( (/)
    , (*)
    )
    import Text.Show ( Show )
  • replacement in lib/Aftok/TimeLog.hs at line 136
    [6.9434][6.9434:9528]()
    toDepF (LinearDepreciation undepLength depLength) = linearDepreciation undepLength depLength
    [6.9434]
    [6.9528]
    toDepF (LinearDepreciation undepLength depLength) =
    linearDepreciation undepLength depLength
  • replacement in lib/Aftok/TimeLog.hs at line 154
    [6.16312][6.4872:4956](),[6.960][6.4872:4956]()
    addIntervalDiff total ivals = (^+^ total) &&& id $ workCredit dep ptime ivals
    [6.16312]
    [6.1011]
    addIntervalDiff total ivals =
    (^+^ total) &&& id $ workCredit dep ptime ivals
  • edit in lib/Aftok/TimeLog.hs at line 158
    [6.1402][6.1977:1978](),[6.1977][6.1977:1978]()
  • replacement in lib/Aftok/TimeLog.hs at line 160
    [6.1582][6.32157:32225]()
    workIndex :: (Ord a, Foldable f) => f (LogEntry a) -> (WorkIndex a)
    [6.1582]
    [6.4957]
    workIndex
    :: forall a f . (Ord a, Foldable f) => f (LogEntry a) -> (WorkIndex a)
  • replacement in lib/Aftok/TimeLog.hs at line 164
    [6.1461][6.1461:1525]()
    rawIndex = F.foldl' appendLogEntry MS.empty sortedEntries
    [6.1461]
    [6.844]
    rawIndex = F.foldl' appendLogEntry MS.empty sortedEntries
  • edit in lib/Aftok/TimeLog.hs at line 166
    [6.845]
    [6.4981]
    accum
    :: (CreditTo a)
    -> [Either LogEvent Interval]
    -> Map (CreditTo a) (NonEmpty Interval)
    -> Map (CreditTo a) (NonEmpty Interval)
  • edit in lib/Aftok/TimeLog.hs at line 174
    [6.966][6.966:967]()
  • replacement in lib/Aftok/TimeLog.hs at line 185
    [6.5069][6.2211:2286](),[6.2211][6.2211:2286](),[6.2286][3.3:105](),[3.105][6.2388:2488](),[6.2388][6.2388:2488](),[6.2488][6.973:1002](),[6.973][6.973:1002]()
    let combine (StartWork t) (StopWork t') | t' > t = Right $ Interval t t'
    combine (e1 @ (StartWork _)) (e2 @ (StartWork _)) = Left $ max e1 e2 -- ignore redundant starts
    combine (e1 @ (StopWork _)) (e2 @ (StopWork _)) = Left $ min e1 e2 -- ignore redundant ends
    combine _ e2 = Left e2
    [6.5069]
    [6.2489]
    let combine :: LogEvent -> LogEvent -> Either LogEvent Interval
    combine (StartWork t) (StopWork t') | t' > t = Right $ Interval t t'
    combine (e1@(StartWork _)) (e2@(StartWork _)) = Left $ max e1 e2 -- ignore redundant starts
    combine (e1@(StopWork _)) (e2@(StopWork _)) = Left $ min e1 e2 -- ignore redundant ends
    combine _ e2 = Left e2
  • replacement in lib/Aftok/TimeLog.hs at line 193
    [6.2655][6.2655:2752]()
    extension ival (StartWork t) | containsInclusive t ival = Just $ StartWork (ival ^. start)
    [6.2655]
    [6.2752]
    extension ival (StartWork t) | containsInclusive t ival =
    Just $ StartWork (ival ^. start)
  • replacement in lib/Aftok/TimeLog.hs at line 205
    [6.1093][6.1526:1549](),[6.198][6.869:870](),[6.1089][6.869:870](),[6.1157][6.869:870](),[6.1549][6.869:870](),[6.3145][6.869:870](),[6.4779][6.869:870](),[6.869][6.869:870]()
    _ -> [Left ev]
    [6.1093]
    [6.1158]
    _ -> [Left ev]
  • replacement in lib/Aftok/TimeLog.hs at line 211
    [6.2121][6.9601:9889]()
    linearDepreciation :: Months -- ^ The number of initial months during which no depreciation occurs
    -> Months -- ^ The number of months over which each logged interval will be depreciated
    -> DepF -- ^ The resulting configured depreciation function.
    [6.2121]
    [6.5127]
    linearDepreciation
    :: Months -- ^ The number of initial months during which no depreciation occurs
    -> Months -- ^ The number of months over which each logged interval will be depreciated
    -> DepF -- ^ The resulting configured depreciation function.
  • replacement in lib/Aftok/TimeLog.hs at line 223
    [6.2646][6.5247:5265](),[6.5265][6.10011:10059](),[6.508][6.10011:10059](),[6.10059][6.2647:2733](),[6.556][6.2647:2733](),[6.2733][6.557:558](),[6.586][6.557:558]()
    depPct dt =
    if dt < monthsLength undepLength then 1
    else toSeconds (max zeroV (maxDepreciable ^-^ dt)) / toSeconds maxDepreciable
    [6.2646]
    [6.5266]
    depPct dt = if dt < monthsLength undepLength
    then 1
    else toSeconds (max zeroV (maxDepreciable ^-^ dt))
    / toSeconds maxDepreciable
  • replacement in lib/Aftok/TimeLog.hs at line 228
    [6.5287][6.2756:2812](),[6.2756][6.2756:2812](),[6.2812][6.1550:1584]()
    let depreciation = depPct $ ptime .-. (ival ^. end)
    in depreciation *^ ilen ival
    [6.5287]
    let depreciation = depPct $ ptime .-. (ival ^. end)
    in depreciation *^ ilen ival
  • replacement in server/Aftok/Snaplet/Auctions.hs at line 36
    [6.2962][6.59417:59473]()
    import Bippy.Types ( Satoshi(..) )
    [6.2962]
    [6.2962]
    import Bippy.Types ( Satoshi(..) )
  • replacement in server/Aftok/Snaplet/Auth.hs at line 9
    [6.47528][6.310056:310217]()
    import Data.Aeson ((.:))
    import qualified Data.Aeson as A
    import qualified Data.Aeson.Types as A
    [6.47528]
    [6.47528]
    import Data.Aeson ( (.:) )
    import qualified Data.Aeson as A
    import qualified Data.Aeson.Types as A
  • replacement in server/Aftok/Snaplet/Auth.hs at line 29
    [6.310354][6.310354:310440]()
    parseLoginRequest (A.Object o) = LoginRequest <$> o .: "username" <*> o .: "password"
    [6.310354]
    [6.310440]
    parseLoginRequest (A.Object o) =
    LoginRequest <$> o .: "username" <*> o .: "password"
  • replacement in server/Aftok/Snaplet/Auth.hs at line 37
    [6.10876][6.10876:10967]()
    requireLoginWith :: (forall a. () -> S.Handler App App a) -> S.Handler App App AU.AuthUser
    [6.10876]
    [6.10967]
    requireLoginWith
    :: (forall a . () -> S.Handler App App a) -> S.Handler App App AU.AuthUser
  • replacement in server/Aftok/Snaplet/Auth.hs at line 40
    [6.11006][6.47767:47796](),[6.1227][6.47767:47796](),[6.47796][6.11007:11090]()
    req <- getRequest
    rawHeader <- maybe (throwMissingAuth ()) pure $ getHeader "Authorization" req
    [6.11006]
    [6.47797]
    req <- getRequest
    rawHeader <- maybe (throwMissingAuth ()) pure $ getHeader "Authorization" req
  • replacement in server/Aftok/Snaplet/Auth.hs at line 50
    [6.310668][6.310668:310842]()
    credentials <- case
    A.eitherDecode requestBody >>= A.parseEither parseLoginRequest
    of
    Left _ -> snapError 400 $ "Unable to parse login credentials object."
    [6.310668]
    [6.310842]
    credentials <-
    case A.eitherDecode requestBody >>= A.parseEither parseLoginRequest of
    Left _ -> snapError 400 $ "Unable to parse login credentials object."
  • replacement in server/Aftok/Snaplet/Auth.hs at line 54
    [6.310874][6.310874:311003]()
    authResult <- with auth $ AU.loginByUsername (loginUser credentials) (AU.ClearText (encodeUtf8 $ loginPass credentials)) False
    [6.310874]
    [6.1502]
    authResult <- with auth $ AU.loginByUsername
    (loginUser credentials)
    (AU.ClearText (encodeUtf8 $ loginPass credentials))
    False
  • replacement in server/Aftok/Snaplet/Auth.hs at line 63
    [6.1644][6.11091:11192]()
    maybe (requireLoginWith $ const (throwDenied $ AU.AuthError "Not Authenticated")) pure currentUser
    [6.1644]
    [6.1682]
    maybe
    (requireLoginWith $ const (throwDenied $ AU.AuthError "Not Authenticated"))
    pure
    currentUser
  • replacement in server/Aftok/Snaplet/Billing.hs at line 21
    [6.34401][6.59476:59532]()
    import Bippy.Types ( Satoshi(..) )
    [6.34401]
    [6.34229]
    import Bippy.Types ( Satoshi(..) )
  • replacement in server/Aftok/Snaplet/Payments.hs at line 28
    [6.50445][6.59534:59578]()
    import qualified Bippy.Proto as P
    [6.50445]
    [6.1384]
    import qualified Bippy.Proto as P
  • replacement in server/Aftok/Snaplet/Projects.hs at line 14
    [6.2104][6.52754:52814](),[6.52874][6.52874:52924]()
    import Control.Monad.Trans.Maybe ( mapMaybeT
    )
    [6.2104]
    [6.52924]
    import Control.Monad.Trans.Maybe ( mapMaybeT )
  • replacement in server/Aftok/Snaplet/Users.hs at line 18
    [6.34767][6.59642:59697]()
    import Haskoin.Address ( textToAddr )
    [6.34767]
    [6.10431]
    import Haskoin.Address ( textToAddr )
  • replacement in server/Aftok/Snaplet/Util.hs at line 3
    [6.4267][6.8380:8504]()
    import Data.Attoparsec.ByteString (parseOnly)
    import Data.Attoparsec.ByteString.Char8 (decimal)
    [6.4267]
    [6.5709]
    import Data.Attoparsec.ByteString ( parseOnly )
    import Data.Attoparsec.ByteString.Char8
    ( decimal )
  • replacement in server/Aftok/Snaplet/WorkLog.hs at line 6
    [6.5713][6.7:62]()
    import Control.Lens ((^.))
    [6.5713]
    [6.57438]
    import Control.Lens ( (^.) )
  • replacement in server/Aftok/Snaplet/WorkLog.hs at line 10
    [6.57553][6.63:118]()
    import Data.Aeson ((.=))
    [6.57553]
    [6.311005]
    import Data.Aeson ( (.=) )
  • replacement in server/Aftok/Snaplet/WorkLog.hs at line 15
    [6.57710][6.59779:59829]()
    import Haskoin.Address ( Address
    [6.57710]
    [6.59829]
    import Haskoin.Address ( Address
  • replacement in server/Aftok/Snaplet/WorkLog.hs at line 28
    [6.9959][6.59891:59963]()
    import Aftok.Types ( _ProjectId, _UserId )
    [6.9959]
    [6.58122]
    import Aftok.Types ( _ProjectId
    , _UserId
    )
  • replacement in server/Aftok/Snaplet/WorkLog.hs at line 40
    [6.5831][6.5341:5436]()
    logWorkHandler :: (C.UTCTime -> LogEvent) -> S.Handler App App (EventId, KeyedLogEntry BTCNet)
    [6.5831]
    [6.10122]
    logWorkHandler
    :: (C.UTCTime -> LogEvent)
    -> S.Handler App App (EventId, KeyedLogEntry BTCNet)
  • replacement in server/Aftok/Snaplet/WorkLog.hs at line 50
    [6.58385][6.311058:311141]()
    A.eitherDecode requestBody >>= A.parseEither (parseLogEntry nmode uid evCtr)
    [6.58385]
    [6.58466]
    A.eitherDecode requestBody
    >>= A.parseEither (parseLogEntry nmode uid evCtr)
  • replacement in server/Aftok/Snaplet/WorkLog.hs at line 63
    [6.5579][6.5579:5695]()
    (snapError 500 $ "An error occured retrieving the newly created event record.")
    (pure . (eid,))
    [6.5579]
    [6.5695]
    ( snapError 500
    $ "An error occured retrieving the newly created event record."
    )
    (pure . (eid, ))
  • replacement in server/Aftok/Snaplet/WorkLog.hs at line 104
    [6.4878][6.8862:8914](),[6.8862][6.8862:8914]()
    limit <- fromMaybe 1 <$> decimalParam "limit"
    [6.4878]
    [6.4879]
    limit <- fromMaybe 1 <$> decimalParam "limit"
  • replacement in server/Aftok/Snaplet/WorkLog.hs at line 108
    [6.15119][6.15119:15135](),[6.15135][6.4923:4950]()
    userWorkIndex =
    workIndex <$> userEvents
    [6.15119]
    [6.15166]
    userWorkIndex = workIndex <$> userEvents
  • replacement in server/Aftok/Snaplet/WorkLog.hs at line 135
    [6.270][6.270:574]()
    keyedLogEntryJSON :: NetworkMode -> (EventId, KeyedLogEntry (NetworkId, Address)) -> A.Value
    keyedLogEntryJSON nmode (eid, (pid, uid, ev)) = v2 . obj $
    [ "eventId" .= idValue _EventId eid
    , "projectId" .= idValue _ProjectId pid
    , "loggedBy" .= idValue _UserId uid
    ] <> logEntryFields nmode ev
    [6.270]
    [6.574]
    keyedLogEntryJSON
    :: NetworkMode -> (EventId, KeyedLogEntry (NetworkId, Address)) -> A.Value
    keyedLogEntryJSON nmode (eid, (pid, uid, ev)) =
    v2
    . obj
    $ [ "eventId" .= idValue _EventId eid
    , "projectId" .= idValue _ProjectId pid
    , "loggedBy" .= idValue _UserId uid
    ]
    <> logEntryFields nmode ev
  • replacement in server/Main.hs at line 34
    [6.11663][6.11338:11379]()
    import qualified Snap.Snaplet.Auth as AU
    [6.11663]
    [6.11724]
    import qualified Snap.Snaplet.Auth as AU
  • replacement in server/Main.hs at line 50
    [6.11435][6.11435:11552]()
    sesss <- nestSnaplet "sessions" sess $ initCookieSessionManager cookieKey "quookie" Nothing (cfg ^. cookieTimeout)
    [6.11435]
    [6.26670]
    sesss <- nestSnaplet "sessions" sess
    $ initCookieSessionManager
    cookieKey
    "quookie"
    Nothing
    (cfg ^. cookieTimeout)
  • replacement in server/Main.hs at line 76
    [6.8384][6.15169:15247]()
    projectRoute =
    serveJSON projectJSON $ method GET projectGetHandler
    [6.8384]
    [6.15247]
    projectRoute = serveJSON projectJSON $ method GET projectGetHandler
  • replacement in server/Main.hs at line 86
    [6.15523][6.15523:15608]()
    amendEventRoute =
    serveJSON amendmentIdJSON $ method PUT amendEventHandler
    [6.15523]
    [6.5021]
    amendEventRoute = serveJSON amendmentIdJSON $ method PUT amendEventHandler
  • replacement in server/Main.hs at line 95
    [6.64102][6.9052:9213]()
    auctionRoute =
    serveJSON auctionJSON $ method GET auctionGetHandler
    auctionBidRoute =
    serveJSON bidIdJSON $ method POST auctionBidHandler
    [6.64102]
    [6.321]
    auctionRoute = serveJSON auctionJSON $ method GET auctionGetHandler
    auctionBidRoute = serveJSON bidIdJSON $ method POST auctionBidHandler
  • replacement in server/Main.hs at line 117
    [6.64972][6.64972:65091](),[6.65091][6.11733:11855](),[6.11855][6.65091:65217](),[6.65091][6.65091:65217]()
    , ("login" , loginRoute)
    , ("login" , xhrLoginRoute)
    , ("logout" , logoutRoute)
    , ("login/check" , checkLoginRoute)
    , ("register" , registerRoute)
    , ("accept_invitation" , acceptInviteRoute)
    [6.64972]
    [6.15797]
    , ("login" , loginRoute)
    , ("login" , xhrLoginRoute)
    , ("logout" , logoutRoute)
    , ("login/check", checkLoginRoute)
    , ("register" , registerRoute)
    , ( "accept_invitation"
    , acceptInviteRoute
    )
  • replacement in server/Main.hs at line 127
    [6.15954][6.15954:16099](),[6.16099][6.5113:5179](),[6.5179][6.16169:16733](),[6.16169][6.16169:16733]()
    , ("user/projects/:projectId/logStart" , logWorkRoute StartWork)
    , ("user/projects/:projectId/logEnd" , logWorkRoute StopWork)
    , ("user/projects/:projectId/events" , userEventsRoute)
    , ("user/projects/:projectId/workIndex" , userWorkIndexRoute)
    , ("projects/:projectId/workIndex" , projectWorkIndexRoute)
    , ("projects/:projectId/auctions" , auctionCreateRoute) -- <|> auctionListRoute)
    , ("projects/:projectId/billables" , billableCreateRoute <|> billableListRoute)
    , ("projects/:projectId/payouts" , projectPayoutsRoute)
    , ("projects/:projectId/invite" , inviteRoute)
    , ("projects/:projectId" , projectRoute)
    , ("projects" , projectCreateRoute <|> projectListRoute)
    [6.15954]
    [6.66061]
    , ("user/projects/:projectId/logStart" , logWorkRoute StartWork)
    , ("user/projects/:projectId/logEnd" , logWorkRoute StopWork)
    , ("user/projects/:projectId/events" , userEventsRoute)
    , ("user/projects/:projectId/workIndex", userWorkIndexRoute)
    , ("projects/:projectId/workIndex" , projectWorkIndexRoute)
    , ( "projects/:projectId/auctions"
    , auctionCreateRoute
    ) -- <|> auctionListRoute)
    , ( "projects/:projectId/billables"
    , billableCreateRoute <|> billableListRoute
    )
    , ("projects/:projectId/payouts", projectPayoutsRoute)
    , ("projects/:projectId/invite" , inviteRoute)
    , ("projects/:projectId" , projectRoute)
    , ("projects" , projectCreateRoute <|> projectListRoute)
  • edit in shell.nix at line 22
    [4.38]
    [91.99129]
    haskellPackages.brittany
  • replacement in test/Aftok/AuctionSpec.hs at line 11
    [6.309][5.3:58]()
    import Data.List ((!!))
    [6.309]
    [6.66500]
    import Data.List ( (!!) )
  • replacement in test/Aftok/AuctionSpec.hs at line 13
    [6.66552][5.59:112]()
    import qualified Data.UUID.V4 as U
    [6.66552]
    [6.66553]
    import qualified Data.UUID.V4 as U
  • replacement in test/Aftok/AuctionSpec.hs at line 74
    [5.1335][5.1335:1422]()
    it
    "determines a sufficient number of winners to fulfill the raise amount"
    [5.1335]
    [5.1422]
    it "determines a sufficient number of winners to fulfill the raise amount"
  • replacement in test/Aftok/AuctionSpec.hs at line 76
    [5.1434][5.1434:1552]()
    result = runAuction' (Satoshi 1250)
    [testB0, testB1, testB2, testB3, testB4]
    [5.1434]
    [5.1552]
    result =
    runAuction' (Satoshi 1250) [testB0, testB1, testB2, testB3, testB4]
  • replacement in test/Aftok/AuctionSpec.hs at line 83
    [5.1750][5.1750:1843]()
    WinningBids winners ->
    sortBy bidOrder winners `shouldBe` expected
    [5.1750]
    [6.1605]
    WinningBids winners -> sortBy bidOrder winners `shouldBe` expected
  • replacement in test/Aftok/TimeLogSpec.hs at line 19
    [6.12402][6.64539:64591]()
    import Haskoin.Address ( Address )
    [6.12402]
    [6.1860]
    import Haskoin.Address ( Address )
  • replacement in test/Aftok/TimeLogSpec.hs at line 26
    [6.12560][6.64645:64712]()
    import Haskoin.Util.Arbitrary.Address (arbitraryAddress)
    [6.12560]
    [6.2088]
    import Haskoin.Util.Arbitrary.Address ( arbitraryAddress )