Autoformat everything with brittany.
[?]
May 29, 2020, 2:18 PM
EFSXYZPOGA5M4DN65IEIDO7JK6U34DMQELAPHOIL2UAT6HRC66BACDependencies
- [2]
4R7XIYK3Switch from ClassyPrelude to Relude - [3]
64C6AWH6Rename Ananke -> Quixotic, project reboot. - [4]
VJPT6HDRFix remaining type errors after addition of login handler. - [5]
WZUHEZSBStart of migration back toward snap. - [6]
GCVQD44VCreate amends endpoint, switch to UUID primary keys - [7]
RN7EI6INUpdate database layer to use CreditTo - [8]
Z3MK2PJ5Add GET handler for retrieving auction data. - [9]
MJ6R42RCUtility methods for reading key & cert data. - [10]
BXGLKYRXAdded primitive user registration handler. - [11]
Z3M53KTLAdrift. - [12]
NAS4BFL4Trivial stylish-haskell reformat. - [13]
POX3UAMTEnabling logging of time to contributor/project accounts - [14]
4IQVQL4TAdded client for payouts endpoint. - [15]
QADKFHARAdds CreatePayment handler implementation. - [16]
FXJQACESEnsure that auction is not ended at the time of bid - [17]
7XN3I3QJAdd 'loggedIntervals' endpoint. - [18]
ADMKQQGCInitial empty Snap project. - [19]
SCXG6TJWMake log reduction safer in presence of overlapping events. - [20]
SPJCFHXWUpdate shell scripts to point to https://aftok.com and prompt for input. - [21]
BROSTG5KBeginning of modularization of server. - [22]
5DRIWGLUImproving TimeLog specs - [23]
HALRDT2FAdded initial auction create route. - [24]
B6HWAPDPModularize & update to recent haskoin. - [25]
BSIUHCGFAdd payment response handler. - [26]
Q5X5RYQLstylish-haskell reformatting - [27]
HO2PFRABClient login now handles response correctly. - [28]
EMVTF2IWWIP moving back to snap. - [29]
64VI73NPServer now compiles using abstracted SQLite - [30]
RPAJLHMTChange to use UUIDs instead of ints for primary keys. - [31]
TCOAKCGGCompleted conversion to snap. - [32]
75N3UJ4JMore progression toward lenses. - [33]
TJEUE7TYAdded OverloadedStrings to eliminate Text fiddling. - [34]
EKY7U7SKFinish conversion to stack. - [35]
JV3UEPNCFix Aeson constructors. - [36]
Y35QCWYWMinor improvement in WorkIndex type to eliminate duplicated information. - [37]
6L5BK5EHUse generic SMTP rather than Sendmail-specific mail client. - [38]
M4KM76DGMerge branch 'stackify' - [39]
4B66XH43Add sample billing config - [40]
NLZ3JXLOFix formatting with stylish-haskell. - [41]
FD7SV5I6Fix handling of event_t columns. - [42]
7HPY3QPFFix linting errors. (yay hlint!) - [43]
MB5SHULBAdd route for accepting an invitation with an existing account - [44]
2KZPOGRBOnce you get Haskell to compile, the tests pass! - [45]
HMDM3B55Implement core of payments/billing infrastructure. - [46]
EW2XN7KUUpdate docker build, clean up migration for payments tables. - [47]
2XQD6KKKAdd invitation logic and clean up DBProg error handling. - [48]
PBD7LZYQPostgres & auth are beginning to function. - [49]
WJO37T74Restored the single test to functionality. - [50]
2G3GNDDUEvent logging is now functioning in postgres. - [51]
LCBJULKEFix swapped default and key in QConfig. - [52]
MGOF7IUFUpdate TASKS list to reflect completed projects. - [53]
OV5AKJHARemove unused LogInterval type. - [54]
GLFF5ZDKFactor winningBids for easier testing. - [55]
JFOEOFGAstylish-haskell formatting. - [56]
7KZP4RHZSwitch from Data.Time to Data.Thyme - [57]
TLQ72DSJLenses, sqlite-simple - [58]
O5FVTOM6Undo JSON silliness, enable a couple more routes. - [59]
3GBSDS5PFix out-of-date test code, add skeleton for payments spec. - [60]
DFOBMSAOInitial work on payments API - [61]
LD4GLVSFMore database stuff. - [62]
LAROLAYUWIP - [63]
LHJ2HFXVAdd property test for auction algorithm. - [64]
WZFQDWW4Add retrieval/storage of current exchange rate data to payment recording. - [65]
2MNO5FUYUpgrade LTS version - [66]
SEWTRB6SImplement payment request creation functions. - [67]
5OI44E4EAdd authentication to auction search. - [68]
Z7KS5XHHVery WIP. Wow. - [69]
RSEB2NFGReplacing Snap with Scotty. - [70]
KNSI575VCleanup of EventLog types. - [71]
W35DDBFYFactor common JSON conversions up into client lib module. - [72]
EKI57EJRAdd alternative implementation of auction winner determination. - [73]
O722AOKEAdd route to allow crediting of events to users/projects. - [74]
4U7F3CPITHE GREAT RENAMING OF THINGS! - [75]
NMWWP4ZNTrying out Hspec - [76]
F2XLL7XWRemove Ord Bid & sort in favor of sortBy - [77]
5ZSKPQ3KAdd created_at and auction_start timestamps to auction - [78]
EZQG2APBUpdate task list. - [79]
3QVT6MA6Add database support for event amend operations. - [80]
BWN72T44Don't accept work timestamp from an external source. - [81]
IZEVQF62Work in progress replacing sqlite with postgres. - [82]
GMYPBCWEMake docker-compose work. - [83]
TNR3TEHKSwitch to Postgres + snaplet arch compiles. - [84]
NEDDHXUKReformat via stylish-haskell - [85]
A6HKMINBAttempting to improve JSON handling. - [86]
V2VDN77HEnable postgres configuration via environment variable for Heroku. - [87]
WAIX6AGNAdd event serialization for PaymentRequest & Payment - [88]
I2KHGVD4Require project permissions for access to most data. - [89]
4FDQGIXNMake payment request retrieval key an opaque 32-bit hash. - [90]
UILI6PILThe route-based logStart/logStop is nicer. - [91]
P6NR2CGXBeginning of implementation of depreciation. - [92]
7VGYLTMUClean up schema version handling. - [93]
73NDXDEZBegin implementation of billing event persistence. - [94]
N4NDAZYTInitial implementation of payouts. - [95]
HBULCDN6Add tests for auction winner determination algorithm. - [96]
UOG5H2TWDefault work logging credit to logged-in user. - [97]
ASF3UPJLAdd auction creation and bid handlers - [98]
NVOCQVASInitial failing tests. - [99]
GKGVYBZGAdded JSON serialization to TimeLog - [100]
ZP62WC47Begin conversion to build with stack. - [101]
KEP5WUFJConvert project to stack-based build. - [102]
XTBSG4C7Adding serveJSON combinator to eliminate some boilerplate from handlers. - [103]
UUR6SMCAAdd start of specs for auctions. - [104]
AL37SVTCImplement payments service endpoints. - [105]
PGZJ736CUpdate aftok.cfg.example and revise INSTALL instructions - [106]
4ZLEDBK7Initial attempts at dockerizing, cabal isn't cooperating. - [107]
WO2MINIFAuctions now compile! - [108]
DXIGERDTChange order of Docker build to avoid rebuilding the universe. - [109]
Y3LIJ5USAdd handler for CreatePaymentRequest - [110]
O227CEAVAdds storage of original event JSON for some DBOp constructors. - [111]
EQXRXRZDChanged to use tasty instead of test-framework - [112]
4SCFOJGNSpecs for recovering intervals from the log now pass. - [113]
MMRVIM3FRemoves copy/paste error from email invitation subject. - [114]
IPG33FAWAdd billing daemon - [115]
QMRKFEPGRefactor QDB to use a free monad algebra instead.
Change contents
- replacement in daemon/AftokD/AftokM.hs at line 9
import Control.Error.Util (maybeT)import Control.Lens ((^.), makeLenses, makeClassyPrisms, traverseOf, to)import Control.Monad.IO.Class (MonadIO(..))import Control.Monad.Except (MonadError, throwError)import Control.Monad.Reader (MonadReader)import Control.Monad.Trans.Except (ExceptT, withExceptT, runExceptT)import Control.Monad.Trans.Reader (mapReaderT, withReaderT)import Control.Error.Util ( maybeT )import Control.Lens ( (^.), makeLenses, makeClassyPrisms, traverseOf, to)import Control.Monad.IO.Class ( MonadIO(..) )import Control.Monad.Except ( MonadError, throwError)import Control.Monad.Reader ( MonadReader )import Control.Monad.Trans.Except ( ExceptT, withExceptT, runExceptT)import Control.Monad.Trans.Reader ( mapReaderT, withReaderT) - replacement in daemon/AftokD/AftokM.hs at line 29
import Crypto.Random.Types (MonadRandom(..))import Crypto.Random.Types ( MonadRandom(..) ) - replacement in daemon/AftokD/AftokM.hs at line 31[3.2103]→[3.2103:2209](∅→∅),[3.2209]→[2.444:505](∅→∅),[2.505]→[3.427:531](∅→∅),[3.2238]→[3.427:531](∅→∅),[3.531]→[3.2325:2360](∅→∅),[3.2325]→[3.2325:2360](∅→∅),[3.2360]→[3.532:668](∅→∅),[3.668]→[3.2397:2445](∅→∅),[3.2397]→[3.2397:2445](∅→∅)
import Database.PostgreSQL.Simple (Connection, connect)import Data.Thyme.Clock as Cimport Data.Thyme.Time as Cimport qualified Data.Text as Timport qualified Network.Mail.Mime as Mimeimport qualified Network.Mail.SMTP as SMTPimport Network.URI (URI, parseURI)import Network.Haskoin.Address (Address)import Text.StringTemplate (directoryGroup, newSTMP, getStringTemplate, setManyAttrib, render)import Filesystem.Path.CurrentOS (encodeString)import Database.PostgreSQL.Simple ( Connection, connect)import Data.Thyme.Clock as Cimport Data.Thyme.Time as Cimport qualified Data.Text as Timport qualified Network.Mail.Mime as Mimeimport qualified Network.Mail.SMTP as SMTPimport Network.URI ( URI, parseURI)import Network.Haskoin.Address ( Address )import Text.StringTemplate ( directoryGroup, newSTMP, getStringTemplate, setManyAttrib, render)import Filesystem.Path.CurrentOS ( encodeString ) - replacement in daemon/AftokD/AftokM.hs at line 51
import Network.Bippy.Types (Satoshi)import Network.Bippy.Types ( Satoshi ) - replacement in daemon/AftokD/AftokM.hs at line 53[3.2484]→[3.669:799](∅→∅),[3.799]→[3.2571:2991](∅→∅),[3.2571]→[3.2571:2991](∅→∅),[3.2991]→[3.800:854](∅→∅),[3.854]→[3.3060:3089](∅→∅),[3.3060]→[3.3060:3089](∅→∅)
import Aftok.Types (User, UserId, ProjectId(..), userEmail, _Email)import Aftok.Currency.Bitcoin (NetworkId, satoshi)import qualified Aftok.Config as ACimport Aftok.Billables (Billable, Billable', Subscription', customer, name, billable, project, paymentRequestEmailTemplate, paymentRequestMemoTemplate)import qualified Aftok.Database as DBimport Aftok.Database.PostgreSQL (QDBM(..))import qualified Aftok.Payments as Pimport Aftok.Payments.Types (PaymentKey(..), subscription, paymentRequestTotal, paymentKey)import Aftok.Project (Project, projectName)import qualified AftokD as Dimport Aftok.Types ( User, UserId, ProjectId(..), userEmail, _Email)import Aftok.Currency.Bitcoin ( NetworkId, satoshi)import qualified Aftok.Config as ACimport Aftok.Billables ( Billable, Billable', Subscription', customer, name, billable, project, paymentRequestEmailTemplate, paymentRequestMemoTemplate)import qualified Aftok.Database as DBimport Aftok.Database.PostgreSQL ( QDBM(..) )import qualified Aftok.Payments as Pimport Aftok.Payments.Types ( PaymentKey(..), subscription, paymentRequestTotal, paymentKey)import Aftok.Project ( Project, projectName)import qualified AftokD as D - replacement in daemon/AftokD/AftokM.hs at line 94
_Overdue = _PaymentErr . P._Overdue_Overdue = _PaymentErr . P._Overdue - replacement in daemon/AftokD/AftokM.hs at line 105
networkMode = pcfg . P.networkModesigningKey = pcfg . P.signingKeypkiData = pcfg . P.pkiDatanetworkMode = pcfg . P.networkModesigningKey = pcfg . P.signingKeypkiData = pcfg . P.pkiData - replacement in daemon/AftokD/AftokM.hs at line 129
void . runExceptT $ (runReaderT . runAftokM) createProjectsPaymentRequests $ envvoid. runExceptT$ (runReaderT . runAftokM) createProjectsPaymentRequests$ env - replacement in daemon/AftokD/AftokM.hs at line 141
now <- liftIO C.getCurrentTimelet ops = P.BillingOps memoGen (fmap Just . paymentURL) payloadGensubscribers <- liftQDBM $ DB.findSubscribers pidrequests <- traverse (\uid -> P.createPaymentRequests ops now uid pid) $ subscriberstraverse_ sendPaymentRequestEmail (join requests)now <- liftIO C.getCurrentTimelet ops = P.BillingOps memoGen (fmap Just . paymentURL) payloadGensubscribers <- liftQDBM $ DB.findSubscribers pidrequests <-traverse (\uid -> P.createPaymentRequests ops now uid pid) $ subscriberstraverse_ sendPaymentRequestEmail (join requests) - replacement in daemon/AftokD/AftokM.hs at line 151
let AC.SmtpConfig{..} = cfg ^. (dcfg . D.smtpConfig)preqCfg = cfg ^. (dcfg . D.paymentRequestConfig)reqMay = dopreq <- DB.findPaymentRequestId reqIdpreq' <- traverseOf P.subscription DB.findSubscriptionBillable preqlet AC.SmtpConfig {..} = cfg ^. (dcfg . D.smtpConfig)preqCfg = cfg ^. (dcfg . D.paymentRequestConfig)reqMay = dopreq <- DB.findPaymentRequestId reqIdpreq' <- traverseOf P.subscription DB.findSubscriptionBillable preq - replacement in daemon/AftokD/AftokM.hs at line 158
req <- maybeT (throwError $ DBErr DB.SubjectNotFound) pure reqMayreq <- maybeT (throwError $ DBErr DB.SubjectNotFound) pure reqMay - replacement in daemon/AftokD/AftokM.hs at line 160
mail <- buildPaymentRequestEmail preqCfg req bip70URLlet mailer = maybe (SMTP.sendMailWithLogin _smtpHost) (SMTP.sendMailWithLogin' _smtpHost) _smtpPortmail <- buildPaymentRequestEmail preqCfg req bip70URLlet mailer = maybe (SMTP.sendMailWithLogin _smtpHost)(SMTP.sendMailWithLogin' _smtpHost)_smtpPort - replacement in daemon/AftokD/AftokM.hs at line 166[3.1181]→[3.5808:5923](∅→∅),[3.5808]→[3.5808:5923](∅→∅),[3.5923]→[3.1182:1307](∅→∅),[3.1307]→[3.6025:6057](∅→∅),[3.6025]→[3.6025:6057](∅→∅),[3.6057]→[3.1308:1348](∅→∅)
buildPaymentRequestEmail :: (MonadIO m, MonadError AftokDErr m)=> D.PaymentRequestConfig-> P.PaymentRequest' (Subscription' (User (NetworkId, Address)) (Billable' Project UserId Satoshi))-> URI-> m Mime.MailbuildPaymentRequestEmail:: (MonadIO m, MonadError AftokDErr m)=> D.PaymentRequestConfig-> P.PaymentRequest'( Subscription'(User (NetworkId, Address))(Billable' Project UserId Satoshi))-> URI-> m Mime.Mail - replacement in daemon/AftokD/AftokM.hs at line 178
let billTemplate = (newSTMP . T.unpack) <$> req ^. (subscription . billable . paymentRequestEmailTemplate)let billTemplate =(newSTMP . T.unpack)<$> req^. (subscription . billable . paymentRequestEmailTemplate) - replacement in daemon/AftokD/AftokM.hs at line 184
Nothing -> throwError $ ConfigError "Could not find template for invitation email"Nothing ->throwError $ ConfigError "Could not find template for invitation email" - replacement in daemon/AftokD/AftokM.hs at line 188[3.6596]→[3.6596:6805](∅→∅),[3.6805]→[3.1371:1406](∅→∅),[3.1406]→[3.6841:6891](∅→∅),[3.6841]→[3.6841:6891](∅→∅)
toEmail = req ^. (subscription . customer . userEmail)pname = req ^. (subscription . billable . project . projectName)total = req ^. (P.paymentRequest . to paymentRequestTotal)setAttrs = setManyAttrib[ ("from_email", fromEmail ^. _Email)toEmail = req ^. (subscription . customer . userEmail)pname = req ^. (subscription . billable . project . projectName)total = req ^. (P.paymentRequest . to paymentRequestTotal)setAttrs = setManyAttrib[ ("from_email" , fromEmail ^. _Email) - replacement in daemon/AftokD/AftokM.hs at line 194
, ("to_email", toEmail ^. _Email), ("amount_due", show $ total ^. satoshi), ("payment_url", show paymentUrl), ("to_email" , toEmail ^. _Email), ("amount_due" , show $ total ^. satoshi), ("payment_url" , show paymentUrl) - replacement in daemon/AftokD/AftokM.hs at line 200
subject = "Payment is due for your "<>pname<>" subscription!"subject = "Payment is due for your " <> pname <> " subscription!" - replacement in daemon/AftokD/AftokM.hs at line 204[3.7418]→[3.1604:1645](∅→∅),[3.1645]→[2.718:735](∅→∅),[2.735]→[3.1662:1683](∅→∅),[3.1662]→[3.1662:1683](∅→∅),[3.1683]→[3.7500:7531](∅→∅),[3.7500]→[3.7500:7531](∅→∅)
memoGen :: Subscription' UserId Billable-> C.Day-> C.UTCTime-> AftokM (Maybe Text)memoGen:: Subscription' UserId Billable -> C.Day -> C.UTCTime -> AftokM (Maybe Text) - replacement in daemon/AftokD/AftokM.hs at line 208
let template = (newSTMP . T.unpack) <$> (sub ^. (billable . paymentRequestMemoTemplate))let template =(newSTMP . T.unpack)<$> (sub ^. (billable . paymentRequestMemoTemplate)) - replacement in daemon/AftokD/AftokM.hs at line 215
, ("issue_time", show requestTime), ("issue_time" , show requestTime) - replacement in daemon/AftokD/AftokM.hs at line 224
let hostname = env ^. (dcfg . D.paymentRequestConfig . D.aftokHost)let hostname = env ^. (dcfg . D.paymentRequestConfig . D.aftokHost) - replacement in daemon/AftokD/AftokM.hs at line 227
(throwError . ConfigError $ "Could not parse path " <> paymentRequestPath <> " to a valid URI")( throwError. ConfigError$ "Could not parse path "<> paymentRequestPath<> " to a valid URI") - replacement in daemon/AftokD/AftokM.hs at line 236
payloadGen :: Monad m => Subscription' UserId Billable -> C.Day -> C.UTCTime -> m (Maybe ByteString)payloadGen:: Monad m=> Subscription' UserId Billable-> C.Day-> C.UTCTime-> m (Maybe ByteString) - replacement in daemon/AftokD.hs at line 5
import Control.Lensimport Control.Lens - replacement in daemon/AftokD.hs at line 9
import Database.PostgreSQL.Simple (ConnectInfo)import Filesystem.Path.CurrentOS (fromText, encodeString)import qualified Filesystem.Path.CurrentOS as Pimport Database.PostgreSQL.Simple ( ConnectInfo )import Filesystem.Path.CurrentOS ( fromText, encodeString)import qualified Filesystem.Path.CurrentOS as P - replacement in daemon/AftokD.hs at line 15
import Aftok.Types (Email(..))import qualified Aftok.Config as ACimport Aftok.Types ( Email(..) )import qualified Aftok.Config as AC - replacement in daemon/AftokD.hs at line 34[2.1198]→[3.1749:1770](∅→∅),[3.9494]→[3.1749:1770](∅→∅),[3.1770]→[3.9516:9576](∅→∅),[3.9516]→[3.9516:9576](∅→∅)
loadConfig cfgFile =readConfig =<< C.load [C.Required $ encodeString cfgFile]loadConfig cfgFile = readConfig =<< C.load [C.Required $ encodeString cfgFile] - replacement in daemon/AftokD.hs at line 37[3.9614]→[3.1771:1795](∅→∅),[3.1795]→[3.9639:9690](∅→∅),[3.9639]→[3.9639:9690](∅→∅),[3.9690]→[3.1796:1853](∅→∅),[3.1853]→[3.9748:9868](∅→∅),[3.9748]→[3.9748:9868](∅→∅)
readConfig cfg = Config<$> (AC.readSmtpConfig $ C.subconfig "smtp" cfg)<*> (AC.readBillingConfig $ C.subconfig "billing" cfg)<*> (AC.readConnectInfo $ C.subconfig "db" cfg)<*> (readPaymentRequestConfig $ C.subconfig "payment_requests" cfg)readConfig cfg =Config<$> (AC.readSmtpConfig $ C.subconfig "smtp" cfg)<*> (AC.readBillingConfig $ C.subconfig "billing" cfg)<*> (AC.readConnectInfo $ C.subconfig "db" cfg)<*> (readPaymentRequestConfig $ C.subconfig "payment_requests" cfg) - replacement in daemon/AftokD.hs at line 45
readPaymentRequestConfig cfg = PaymentRequestConfig<$> C.require cfg "aftok_host"<*> (fromText <$> C.require cfg "template_path")<*> (Email <$> C.require cfg "payment_from_email")[3.9934]readPaymentRequestConfig cfg =PaymentRequestConfig<$> C.require cfg "aftok_host"<*> (fromText <$> C.require cfg "template_path")<*> (Email <$> C.require cfg "payment_from_email") - replacement in daemon/Main.hs at line 3
module Main (main) wheremodule Main( main)where - replacement in daemon/Main.hs at line 10[3.10247]→[2.1242:1273](∅→∅),[2.1273]→[3.10247:10293](∅→∅),[3.10247]→[3.10247:10293](∅→∅),[3.10293]→[2.1274:1318](∅→∅),[2.1318]→[3.10293:10341](∅→∅),[3.10293]→[3.10293:10341](∅→∅)
import Control.Exception (try)import System.Environment (getEnv)import System.IO.Error (IOError)import Filesystem.Path.CurrentOS (decodeString)import Control.Exception ( try )import System.Environment ( getEnv )import System.IO.Error ( IOError )import Filesystem.Path.CurrentOS ( decodeString ) - replacement in daemon/Main.hs at line 15
import qualified AftokD as Dimport AftokD.AftokM (createAllPaymentRequests)import qualified AftokD as Dimport AftokD.AftokM ( createAllPaymentRequests ) - replacement in daemon/Main.hs at line 21
cfg <- D.loadConfig . decodeString $ either (const "conf/aftok.cfg") id cfgPathcfg <- D.loadConfig . decodeString $ either (const "conf/aftok.cfg")idcfgPath - replacement in lib/Aftok/Auction.hs at line 6
import Data.Hourglass (Seconds(..))import Data.Ratio ((%))import Data.Traversable (for)import Data.Thyme.Clock as Cimport Data.Thyme.Format ()import Data.Hourglass ( Seconds(..) )import Data.Ratio ( (%) )import Data.Traversable ( for )import Data.Thyme.Clock as Cimport Data.Thyme.Format ( ) - replacement in lib/Aftok/Auction.hs at line 13
import Aftok.Types (UserId, ProjectId)import Aftok.Currency.Bitcoin (satoshi, ssub)import Network.Bippy.Types (Satoshi(..))import Aftok.Types ( UserId, ProjectId)import Aftok.Currency.Bitcoin ( satoshi, ssub)import Network.Bippy.Types ( Satoshi(..) ) - replacement in lib/Aftok/Auction.hs at line 57
bidsTotal bids =foldl' (\s b -> s <> (b^.bidAmount)) (Satoshi 0) bidsbidsTotal bids = foldl' (\s b -> s <> (b ^. bidAmount)) (Satoshi 0) bids - replacement in lib/Aftok/Auction.hs at line 60[3.38]→[3.38:49](∅→∅),[3.49]→[3.67:122](∅→∅),[3.122]→[3.71:125](∅→∅),[3.71]→[3.71:125](∅→∅),[3.125]→[3.2287:2342](∅→∅),[3.2342]→[3.170:209](∅→∅),[3.170]→[3.170:209](∅→∅)
bidOrder =comparing costRatio `mappend` comparing (^. bidTime)wheresecs bid = toRational $ bid ^. bidSecondsbtc bid = toRational $ bid ^. bidAmount . satoshicostRatio bid = secs bid / btc bidbidOrder = comparing costRatio `mappend` comparing (^. bidTime)wheresecs bid = toRational $ bid ^. bidSecondsbtc bid = toRational $ bid ^. bidAmount . satoshicostRatio bid = secs bid / btc bid - replacement in lib/Aftok/Auction.hs at line 72[3.141]→[3.323:374](∅→∅),[3.325]→[3.323:374](∅→∅),[3.443]→[3.323:374](∅→∅),[3.397]→[3.323:374](∅→∅),[3.374]→[3.123:162](∅→∅),[3.162]→[3.481:538](∅→∅),[3.481]→[3.481:538](∅→∅),[3.538]→[3.2343:2463](∅→∅)
let takeWinningBids :: Satoshi -> [Bid] -> [Bid]takeWinningBids total (bid : xs)-- if the total is fully within the raise amount| total <> (bid ^. bidAmount) < raiseAmount' =bid : takeWinningBids (total <> (bid ^. bidAmount)) xslettakeWinningBids :: Satoshi -> [Bid] -> [Bid]takeWinningBids total (bid : xs)|-- if the total is fully within the raise amounttotal <> (bid ^. bidAmount) < raiseAmount'= bid : takeWinningBids (total <> (bid ^. bidAmount)) xs| - replacement in lib/Aftok/Auction.hs at line 81[3.653]→[3.653:727](∅→∅),[3.727]→[3.195:228](∅→∅),[3.228]→[2.1385:1644](∅→∅),[2.1644]→[3.2737:2800](∅→∅),[3.2737]→[3.2737:2800](∅→∅),[3.2800]→[3.1081:1106](∅→∅),[3.1081]→[3.1081:1106](∅→∅)
-- if the last bid will exceed the raise amount, reduce it to fit| total < raiseAmount' =let winFraction r = r % (bid ^. bidAmount . satoshi)remainderSeconds (Satoshi r) = Seconds . round $ winFraction r * fromIntegral (bid ^. bidSeconds)adjustBid r = bid & bidSeconds .~ remainderSeconds r & bidAmount .~ rin toList $ adjustBid <$> raiseAmount' `ssub` total| otherwise = []-- if the last bid will exceed the raise amount, reduce it to fittotal < raiseAmount'= letwinFraction r = r % (bid ^. bidAmount . satoshi)remainderSeconds (Satoshi r) =Seconds . round $ winFraction r * fromIntegral (bid ^. bidSeconds)adjustBid r = bid & bidSeconds .~ remainderSeconds r & bidAmount .~ rintoList $ adjustBid <$> raiseAmount' `ssub` total| otherwise= [] - replacement in lib/Aftok/Auction.hs at line 93
takeWinningBids _ [] = []takeWinningBids _ [] = [] - replacement in lib/Aftok/Auction.hs at line 95
submittedTotal = bidsTotal bidsin maybe(WinningBids $ takeWinningBids (Satoshi 0) $ sortBy bidOrder bids)InsufficientBids(raiseAmount' `ssub` submittedTotal)submittedTotal = bidsTotal bidsinmaybe (WinningBids $ takeWinningBids (Satoshi 0) $ sortBy bidOrder bids)InsufficientBids(raiseAmount' `ssub` submittedTotal) - replacement in lib/Aftok/Auction.hs at line 107[3.3009]→[3.3009:3046](∅→∅),[3.454]→[3.588:664](∅→∅),[3.3046]→[3.588:664](∅→∅),[3.588]→[3.588:664](∅→∅)
put (x <> bid ^. bidAmount) >>(pure . Just $ Commitment bid (bid ^. bidSeconds) (bid ^. bidAmount))put (x <> bid ^. bidAmount)>> (pure . Just $ Commitment bid (bid ^. bidSeconds) (bid ^. bidAmount)) - replacement in lib/Aftok/Auction.hs at line 113
remainderSeconds (Satoshi r) = Seconds . round $ winFraction r * fromIntegral (bid ^. bidSeconds)remainderSeconds (Satoshi r) =Seconds . round $ winFraction r * fromIntegral (bid ^. bidSeconds) - replacement in lib/Aftok/Auction.hs at line 116
put (x <> remainder) *>(pure $ Commitment bid (remainderSeconds remainder) remainder)put (x <> remainder)*> (pure $ Commitment bid (remainderSeconds remainder) remainder) - replacement in lib/Aftok/Config.hs at line 5
import Control.Lens (makeClassy, (^.))import Control.Lens ( makeClassy, (^.)) - replacement in lib/Aftok/Config.hs at line 11
import Data.X509.File (readKeyFile, readSignedObject)import Database.PostgreSQL.Simple (ConnectInfo(..))import Filesystem.Path.CurrentOS (fromText, encodeString)import qualified Filesystem.Path.CurrentOS as Pimport Safe (headMay)import Data.X509.File ( readKeyFile, readSignedObject)import Database.PostgreSQL.Simple ( ConnectInfo(..) )import Filesystem.Path.CurrentOS ( fromText, encodeString)import qualified Filesystem.Path.CurrentOS as Pimport Safe ( headMay ) - replacement in lib/Aftok/Config.hs at line 25
import Aftok.Currency.Bitcoin (NetworkMode)import Aftok.Payments (PaymentsConfig(..))import Aftok.Currency.Bitcoin ( NetworkMode )import Aftok.Payments ( PaymentsConfig(..) ) - replacement in lib/Aftok/Config.hs at line 46
SmtpConfig <$> C.require cfg "smtpHost"<*> ((fmap . fmap) fromInteger $ C.lookup cfg "smtpPort")<*> C.require cfg "smtpUser"<*> C.require cfg "smtpKey"SmtpConfig<$> C.require cfg "smtpHost"<*> ((fmap . fmap) fromInteger $ C.lookup cfg "smtpPort")<*> C.require cfg "smtpUser"<*> C.require cfg "smtpKey" - replacement in lib/Aftok/Config.hs at line 54
BillingConfig <$> C.require cfg "networkMode"<*> (fromText <$> C.require cfg "signingKeyFile")<*> (fromText <$> C.require cfg "certsFile")<*> C.require cfg "exchangeRateServiceURI"BillingConfig<$> C.require cfg "networkMode"<*> (fromText <$> C.require cfg "signingKeyFile")<*> (fromText <$> C.require cfg "certsFile")<*> C.require cfg "exchangeRateServiceURI" - replacement in lib/Aftok/Config.hs at line 62
ConnectInfo <$> C.require cfg "host"<*> C.require cfg "port"<*> C.require cfg "user"<*> C.require cfg "password"<*> C.require cfg "database"ConnectInfo<$> C.require cfg "host"<*> C.require cfg "port"<*> C.require cfg "user"<*> C.require cfg "password"<*> C.require cfg "database" - replacement in lib/Aftok/Config.hs at line 73
privKey <- case headMay privKeys ofprivKey <- case headMay privKeys of - replacement in lib/Aftok/Config.hs at line 75
Just _ -> fail $ "Only RSA keys are currently supported for payment request signing."Nothing -> fail $ "No keys found in private key file " <> encodeString (c ^. signingKeyFile)Just _ ->fail$ "Only RSA keys are currently supported for payment request signing."Nothing -> fail $ "No keys found in private key file " <> encodeString(c ^. signingKeyFile) - replacement in lib/Aftok/Currency/Bitcoin.hs at line 8
import qualified Data.Configurator.Types as Cimport qualified Data.Configurator.Types as C - replacement in lib/Aftok/Currency/Bitcoin.hs at line 10
import Network.Bippy.Types (Satoshi (..))import Network.Bippy.Types ( Satoshi(..) ) - replacement in lib/Aftok/Currency/Bitcoin.hs at line 18
ssub _ _ = Nothingssub _ _ = Nothing - replacement in lib/Aftok/Currency/Bitcoin.hs at line 34
_ -> Nothing_ -> Nothing - replacement in lib/Aftok/Currency/Bitcoin.hs at line 44
_ -> Nothing_ -> Nothing - replacement in lib/Aftok/Currency/Bitcoin.hs at line 48
convert _ = Nothingconvert _ = Nothing - replacement in lib/Aftok/Currency/Bitcoin.hs at line 60
"btc" -> Just BTC"btc" -> Just BTC - replacement in lib/Aftok/Currency/Bitcoin.hs at line 62
"bch" -> Just BCH"bch" -> Just BCH - replacement in lib/Aftok/Currency/Bitcoin.hs at line 64
_ -> Nothing[3.5756]_ -> Nothing - replacement in lib/Aftok/Currency.hs at line 3
import Data.Aeson (Value)import Data.Aeson.Types (Parser)import Data.Aeson ( Value )import Data.Aeson.Types ( Parser ) - replacement in lib/Aftok/Database/PostgreSQL/Types.hs at line 3
import Data.Aeson (FromJSON(..), ToJSON(..))import Aftok.TimeLog.Serialization (depfFromJSON, depfToJSON)import Aftok.Types (DepreciationFunction)import Data.Aeson ( FromJSON(..), ToJSON(..))import Aftok.TimeLog.Serialization ( depfFromJSON, depfToJSON)import Aftok.Types ( DepreciationFunction ) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 6
module Aftok.Database.PostgreSQL (QDBM(..), runQDBM) wheremodule Aftok.Database.PostgreSQL( QDBM(..), runQDBM)where - replacement in lib/Aftok/Database/PostgreSQL.hs at line 12
import Prelude hiding (null)import Prelude hiding ( null ) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 14[3.999]→[3.13602:13690](∅→∅),[3.13690]→[3.4:143](∅→∅),[3.1043]→[3.4:143](∅→∅),[3.143]→[3.511:581](∅→∅),[3.163]→[3.511:581](∅→∅),[3.1043]→[3.511:581](∅→∅)
import Control.Monad.Trans.Except (ExceptT(..), throwE, runExceptT)import Crypto.Random.Types (MonadRandom,getRandomBytes)import Data.Aeson (Value, toJSON)import Control.Monad.Trans.Except ( ExceptT(..), throwE, runExceptT)import Crypto.Random.Types ( MonadRandom, getRandomBytes)import Data.Aeson ( Value, toJSON) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 25[3.1197]→[3.1205:1264](∅→∅),[3.1264]→[3.789:929](∅→∅),[3.929]→[3.1349:1412](∅→∅),[3.1349]→[3.1349:1412](∅→∅),[3.652]→[3.109:172](∅→∅),[3.1412]→[3.109:172](∅→∅),[3.109]→[3.109:172](∅→∅),[3.172]→[3.1256:1315](∅→∅),[3.1256]→[3.1256:1315](∅→∅)
import qualified Data.List as Limport Data.ProtocolBuffers (decodeMessage,encodeMessage)import Data.Serialize.Get (runGet)import Data.Serialize.Put (runPut)import Data.Thyme.Clock as Cimport qualified Data.List as Limport Data.ProtocolBuffers ( decodeMessage, encodeMessage)import Data.Serialize.Get ( runGet )import Data.Serialize.Put ( runPut )import Data.Thyme.Clock as C - replacement in lib/Aftok/Database/PostgreSQL.hs at line 33
import Data.UUID (UUID)import Data.UUID ( UUID ) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 37[3.1559]→[3.13691:13751](∅→∅),[3.13751]→[3.4:65](∅→∅),[3.1559]→[3.4:65](∅→∅),[3.65]→[2.2173:2237](∅→∅)
import Database.PostgreSQL.Simple.SqlQQ (sql)import Database.PostgreSQL.Simple.Types (Null)import Safe (headMay)import Database.PostgreSQL.Simple.SqlQQ( sql )import Database.PostgreSQL.Simple.Types( Null )import Safe ( headMay ) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 43
import qualified Aftok.Auction as Aimport qualified Aftok.Billables as Bimport qualified Aftok.Auction as Aimport qualified Aftok.Billables as B - replacement in lib/Aftok/Database/PostgreSQL.hs at line 47
import Aftok.Database.PostgreSQL.Types (SerDepFunction(..))import Aftok.Database.PostgreSQL.Types( SerDepFunction(..) ) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 50[3.1678]→[3.723:792](∅→∅),[3.792]→[3.930:1009](∅→∅),[3.1009]→[3.792:860](∅→∅),[3.792]→[3.792:860](∅→∅),[3.860]→[3.1010:1085](∅→∅)
import Aftok.Json (billableJSON,createSubscriptionJSON,paymentJSON,paymentRequestJSON)import Aftok.Json ( billableJSON, createSubscriptionJSON, paymentJSON, paymentRequestJSON) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 56[3.205]→[3.1208:1267](∅→∅),[3.1123]→[3.1208:1267](∅→∅),[3.1471]→[3.1208:1267](∅→∅),[3.1678]→[3.1208:1267](∅→∅)
import qualified Aftok.Project as Pimport qualified Aftok.Project as P - replacement in lib/Aftok/Database/PostgreSQL.hs at line 59
import Network.Bippy.Types (Satoshi(..))import Network.Haskoin.Address (Address, stringToAddr, addrToString)import Network.Haskoin.Constants (Network)import Network.Bippy.Types ( Satoshi(..) )import Network.Haskoin.Address ( Address, stringToAddr, addrToString)import Network.Haskoin.Constants ( Network ) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 82
null = fieldnull = field - replacement in lib/Aftok/Database/PostgreSQL.hs at line 93
Just other -> returnError ConversionFailed f ("Network identifier " <> other <> " is not supported.")Nothing -> pure BTCJust other -> returnErrorConversionFailedf("Network identifier " <> other <> " is not supported.")Nothing -> pure BTC - replacement in lib/Aftok/Database/PostgreSQL.hs at line 102
address <- fieldWith $ addrFieldParser (toNetwork mode networkId)address <- fieldWith $ addrFieldParser (toNetwork mode networkId) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 108
let err = returnError ConversionFailed f "could not deserialize value to a valid BTC address"let err = returnError ConversionFailedf"could not deserialize value to a valid BTC address" - replacement in lib/Aftok/Database/PostgreSQL.hs at line 127
else maybe (returnError UnexpectedNull f "event type may not be null")(maybe (returnError Incompatible f "unrecognized event type value") pure . nameEvent . decodeUtf8)velse maybe(returnError UnexpectedNull f "event type may not be null")( maybe (returnError Incompatible f "unrecognized event type value") pure. nameEvent. decodeUtf8)v - replacement in lib/Aftok/Database/PostgreSQL.hs at line 136
nominalDiffTimeParser f v =C.fromSeconds' <$> fromField f vnominalDiffTimeParser f v = C.fromSeconds' <$> fromField f v - replacement in lib/Aftok/Database/PostgreSQL.hs at line 141
creditToParser' :: NetworkMode -> FieldParser (RowParser (CreditTo (NetworkId, Address)))creditToParser':: NetworkMode -> FieldParser (RowParser (CreditTo (NetworkId, Address))) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 144[3.8444]→[3.8444:8867](∅→∅),[3.1742]→[3.2409:2461](∅→∅),[3.2606]→[3.2409:2461](∅→∅),[3.8867]→[3.2409:2461](∅→∅),[3.2409]→[3.2409:2461](∅→∅),[3.2461]→[3.1349:1376](∅→∅),[3.1376]→[3.2489:2618](∅→∅),[3.2489]→[3.2489:2618](∅→∅)
let parser :: Text -> RowParser (CreditTo (NetworkId, Address))parser "credit_to_address" =CreditToCurrency <$> (addressParser mode <* nullField <* nullField)parser "credit_to_user" =CreditToUser <$> (nullField *> nullField *> idParser UserId <* nullField)parser "credit_to_project" =CreditToProject <$> (nullField *> nullField *> nullField *> idParser ProjectId)parser _ = emptyin dotn <- typename fif tn /= "credit_to_t"then returnError Incompatible f "column was not of type credit_to_t"else maybe empty (pure . parser . decodeUtf8) vletparser :: Text -> RowParser (CreditTo (NetworkId, Address))parser "credit_to_address" =CreditToCurrency <$> (addressParser mode <* nullField <* nullField)parser "credit_to_user" =CreditToUser <$> (nullField *> nullField *> idParser UserId <* nullField)parser "credit_to_project" =CreditToProject<$> (nullField *> nullField *> nullField *> idParser ProjectId)parser _ = emptyindotn <- typename fif tn /= "credit_to_t"then returnError Incompatible f "column was not of type credit_to_t"else maybe empty (pure . parser . decodeUtf8) v - replacement in lib/Aftok/Database/PostgreSQL.hs at line 163[3.8965]→[3.8965:9000](∅→∅),[3.9000]→[3.2607:2664](∅→∅),[3.402]→[3.2607:2664](∅→∅),[3.2664]→[3.403:424](∅→∅),[3.403]→[3.403:424](∅→∅)
LogEntry <$> creditToParser mode<*> (fieldWith eventTypeParser <*> utcParser)<*> fieldLogEntry<$> creditToParser mode<*> (fieldWith eventTypeParser <*> utcParser)<*> field - replacement in lib/Aftok/Database/PostgreSQL.hs at line 168
qdbLogEntryParser :: NetworkMode -> RowParser (KeyedLogEntry (NetworkId, Address))qdbLogEntryParser:: NetworkMode -> RowParser (KeyedLogEntry (NetworkId, Address)) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 171[3.9109]→[3.9109:9139](∅→∅),[3.9139]→[3.1775:1802](∅→∅),[3.1775]→[3.1775:1802](∅→∅),[3.1802]→[3.9140:9171](∅→∅)
(,,) <$> idParser ProjectId<*> idParser UserId<*> logEntryParser mode(,,) <$> idParser ProjectId <*> idParser UserId <*> logEntryParser mode - replacement in lib/Aftok/Database/PostgreSQL.hs at line 175[3.2039]→[3.9172:9207](∅→∅),[3.9207]→[3.1840:1872](∅→∅),[3.1840]→[3.1840:1872](∅→∅),[3.1872]→[3.2760:2864](∅→∅),[3.2760]→[3.2760:2864](∅→∅)
A.Auction <$> idParser ProjectId<*> idParser UserId<*> utcParser<*> btcParser<*> utcParser<*> utcParserA.Auction<$> idParser ProjectId<*> idParser UserId<*> utcParser<*> btcParser<*> utcParser<*> utcParser - replacement in lib/Aftok/Database/PostgreSQL.hs at line 185
A.Bid <$> idParser UserId<*> (Seconds <$> field)<*> btcParser<*> utcParserA.Bid <$> idParser UserId <*> (Seconds <$> field) <*> btcParser <*> utcParser - replacement in lib/Aftok/Database/PostgreSQL.hs at line 189[3.9273]→[3.2964:2996](∅→∅),[3.2160]→[3.2964:2996](∅→∅),[3.2996]→[3.9274:9353](∅→∅),[3.3183]→[3.2210:2239](∅→∅),[3.9353]→[3.2210:2239](∅→∅),[3.993]→[3.2210:2239](∅→∅)
User <$> (UserName <$> field)<*> ((null *> null *> pure Nothing) <|> fmap Just (addressParser mode))<*> (Email <$> field)User<$> (UserName <$> field)<*> ((null *> null *> pure Nothing) <|> fmap Just (addressParser mode))<*> (Email <$> field) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 196[3.2224]→[3.3075:3097](∅→∅),[3.3097]→[3.3018:3044](∅→∅),[3.3044]→[3.1902:1934](∅→∅),[3.1934]→[3.9354:9417](∅→∅)
P.Project <$> field<*> utcParser<*> idParser UserId<*> (unSerDepFunction <$> fieldWith fromJSONField)P.Project<$> field<*> utcParser<*> idParser UserId<*> (unSerDepFunction <$> fieldWith fromJSONField) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 204[3.2298]→[3.9418:9456](∅→∅),[3.9456]→[3.1975:2010](∅→∅),[3.1975]→[3.1975:2010](∅→∅),[3.2010]→[3.3129:3194](∅→∅),[3.3129]→[3.3129:3194](∅→∅),[3.3194]→[3.3412:3457](∅→∅),[3.3412]→[3.3412:3457](∅→∅)
P.Invitation <$> idParser ProjectId<*> idParser UserId<*> fmap Email field<*> utcParser<*> fmap (fmap toThyme) fieldP.Invitation<$> idParser ProjectId<*> idParser UserId<*> fmap Email field<*> utcParser<*> fmap (fmap toThyme) field - replacement in lib/Aftok/Database/PostgreSQL.hs at line 213[3.3516]→[3.9457:9493](∅→∅),[3.9493]→[3.2049:2082](∅→∅),[3.2049]→[3.2049:2082](∅→∅),[3.2082]→[3.3310:3417](∅→∅),[3.3310]→[3.3310:3417](∅→∅),[3.3417]→[3.2083:2106](∅→∅),[3.2106]→[3.3451:3516](∅→∅),[3.3451]→[3.3451:3516](∅→∅),[3.3516]→[3.14032:14078](∅→∅)
B.Billable <$> idParser ProjectId<*> idParser UserId<*> field<*> field<*> recurrenceParser<*> btcParser<*> field<*> fieldWith (optionalField nominalDiffTimeParser)<*> field<*> fieldB.Billable<$> idParser ProjectId<*> idParser UserId<*> field<*> field<*> recurrenceParser<*> btcParser<*> field<*> fieldWith (optionalField nominalDiffTimeParser)<*> field<*> field - replacement in lib/Aftok/Database/PostgreSQL.hs at line 239
B.Subscription <$> idParser UserId<*> idParser B.BillableId<*> (toThyme <$> field)<*> ((fmap toThyme) <$> field)B.Subscription<$> idParser UserId<*> idParser B.BillableId<*> (toThyme <$> field)<*> ((fmap toThyme) <$> field) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 247[3.1466]→[3.214:263](∅→∅),[3.263]→[2.2528:2612](∅→∅),[2.2612]→[3.338:461](∅→∅),[3.338]→[3.338:461](∅→∅)
PaymentRequest <$> fmap B.SubscriptionId field<*> ((either (const empty) pure . runGet decodeMessage) =<< field)<*> fmap PaymentKey field<*> fmap toThyme field<*> fmap toThyme fieldPaymentRequest<$> fmap B.SubscriptionId field<*> ((either (const empty) pure . runGet decodeMessage) =<< field)<*> fmap PaymentKey field<*> fmap toThyme field<*> fmap toThyme field - replacement in lib/Aftok/Database/PostgreSQL.hs at line 256[3.1483]→[3.2581:2624](∅→∅),[3.2581]→[3.2581:2624](∅→∅),[3.2624]→[2.2613:2690](∅→∅),[2.2690]→[3.2692:2726](∅→∅),[3.2692]→[3.2692:2726](∅→∅),[3.2726]→[3.265:285](∅→∅)
Payment <$> (PaymentRequestId <$> field)<*> (field >>= (either (const empty) pure . runGet decodeMessage))<*> (toThyme <$> field)<*> fieldPayment<$> (PaymentRequestId <$> field)<*> (field >>= (either (const empty) pure . runGet decodeMessage))<*> (toThyme <$> field)<*> field - replacement in lib/Aftok/Database/PostgreSQL.hs at line 287
storeEvent (CreateSubscription uid bid t) =Just $ storeEventJSON (Just uid) "create_subscription" (createSubscriptionJSON uid bid t)storeEvent (CreateSubscription uid bid t) = Just $ storeEventJSON(Just uid)"create_subscription"(createSubscriptionJSON uid bid t) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 292
storeEvent (CreatePaymentRequest req) =Just $ storeEventJSON Nothing "create_payment_request" (paymentRequestJSON req)storeEvent (CreatePaymentRequest req) = Just$ storeEventJSON Nothing "create_payment_request" (paymentRequestJSON req) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 305
pinsert EventIdpinsertEventId - replacement in lib/Aftok/Database/PostgreSQL.hs at line 316[3.4296]→[3.9829:9898](∅→∅),[3.4367]→[3.4161:4173](∅→∅),[3.9898]→[3.4161:4173](∅→∅),[3.4161]→[3.4161:4173](∅→∅),[3.4173]→[3.9899:10066](∅→∅)
pgEval (CreateEvent (ProjectId pid) (UserId uid) (LogEntry c e m)) =case c ofCreditToCurrency (nid, addr) -> domode <- askNetworkModelet network = toNetwork mode nidpinsert EventId[sql| INSERT INTO work_eventspgEval (CreateEvent (ProjectId pid) (UserId uid) (LogEntry c e m)) = case c ofCreditToCurrency (nid, addr) -> domode <- askNetworkModelet network = toNetwork mode nidpinsertEventId[sql| INSERT INTO work_events - replacement in lib/Aftok/Database/PostgreSQL.hs at line 327
( pid, uid, creditToName c, addrToString network addr, eventName e, fromThyme $ e ^. eventTime, m)( pid, uid, creditToName c, addrToString network addr, eventName e, fromThyme $ e ^. eventTime, m) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 336
CreditToProject pid' ->pinsert EventId[sql| INSERT INTO work_eventsCreditToProject pid' -> pinsertEventId[sql| INSERT INTO work_events - replacement in lib/Aftok/Database/PostgreSQL.hs at line 343
( pid, uid, creditToName c, pid' ^. _ProjectId, eventName e, fromThyme $ e ^. eventTime, m)( pid, uid, creditToName c, pid' ^. _ProjectId, eventName e, fromThyme $ e ^. eventTime, m) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 352
CreditToUser uid' ->pinsert EventId[sql| INSERT INTO work_eventsCreditToUser uid' -> pinsertEventId[sql| INSERT INTO work_events - replacement in lib/Aftok/Database/PostgreSQL.hs at line 358
( pid, uid, creditToName c, uid' ^. _UserId, eventName e, fromThyme $ e ^. eventTime, m)( pid, uid, creditToName c, uid' ^. _UserId, eventName e, fromThyme $ e ^. eventTime, m) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 369
headMay <$> pquery (qdbLogEntryParser mode)headMay <$> pquery(qdbLogEntryParser mode) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 379
let q (Before e) = pquery (logEntryParser mode)[sql| SELECT credit_to_type, credit_to_address, credit_to_user_id, credit_to_project_id,letq (Before e) = pquery(logEntryParser mode)[sql| SELECT credit_to_type, credit_to_address, credit_to_user_id, credit_to_project_id, - replacement in lib/Aftok/Database/PostgreSQL.hs at line 387
(pid, uid, fromThyme e)q (During s e) = pquery (logEntryParser mode)[sql| SELECT credit_to_type, credit_to_address, credit_to_user_id, credit_to_project_id,(pid, uid, fromThyme e)q (During s e) = pquery(logEntryParser mode)[sql| SELECT credit_to_type, credit_to_address, credit_to_user_id, credit_to_project_id, - replacement in lib/Aftok/Database/PostgreSQL.hs at line 395
(pid, uid, fromThyme s, fromThyme e)q (After s) = pquery (logEntryParser mode)[sql| SELECT credit_to_type, credit_to_address, credit_to_user_id, credit_to_project_id,(pid, uid, fromThyme s, fromThyme e)q (After s) = pquery(logEntryParser mode)[sql| SELECT credit_to_type, credit_to_address, credit_to_user_id, credit_to_project_id, - replacement in lib/Aftok/Database/PostgreSQL.hs at line 402
(pid, uid, fromThyme s)(pid, uid, fromThyme s) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 405
pgEval (AmendEvent (EventId eid) (TimeChange mt t)) =pinsert AmendmentId[sql| INSERT INTO event_time_amendmentspgEval (AmendEvent (EventId eid) (TimeChange mt t)) = pinsertAmendmentId[sql| INSERT INTO event_time_amendments - replacement in lib/Aftok/Database/PostgreSQL.hs at line 410
( eid, fromThyme $ mt ^. _ModTime, fromThyme t )(eid, fromThyme $ mt ^. _ModTime, fromThyme t) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 417
pinsert AmendmentIdpinsertAmendmentId - replacement in lib/Aftok/Database/PostgreSQL.hs at line 422
( eid, fromThyme $ mt ^. _ModTime, creditToName c, addrToString network addr )( eid, fromThyme $ mt ^. _ModTime, creditToName c, addrToString network addr) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 428
CreditToProject pid ->pinsert AmendmentId[sql| INSERT INTO event_credit_to_amendmentsCreditToProject pid -> pinsertAmendmentId[sql| INSERT INTO event_credit_to_amendments - replacement in lib/Aftok/Database/PostgreSQL.hs at line 433
( eid, fromThyme $ mt ^. _ModTime, creditToName c, pid ^. _ProjectId )(eid, fromThyme $ mt ^. _ModTime, creditToName c, pid ^. _ProjectId) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 435
CreditToUser uid ->pinsert AmendmentId[sql| INSERT INTO event_credit_to_amendmentsCreditToUser uid -> pinsertAmendmentId[sql| INSERT INTO event_credit_to_amendments - replacement in lib/Aftok/Database/PostgreSQL.hs at line 440
( eid, fromThyme $ mt ^. _ModTime, creditToName c, uid ^. _UserId )(eid, fromThyme $ mt ^. _ModTime, creditToName c, uid ^. _UserId) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 442
pgEval (AmendEvent (EventId eid) (MetadataChange mt v)) =pinsert AmendmentId[sql| INSERT INTO event_metadata_amendmentspgEval (AmendEvent (EventId eid) (MetadataChange mt v)) = pinsertAmendmentId[sql| INSERT INTO event_metadata_amendments - replacement in lib/Aftok/Database/PostgreSQL.hs at line 447
( eid, fromThyme $ mt ^. _ModTime, v)(eid, fromThyme $ mt ^. _ModTime, v) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 450
mode <- askNetworkModelogEntries <- pquery (logEntryParser mode)mode <- askNetworkModelogEntries <- pquery(logEntryParser mode) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 460
pgEval (CreateAuction auc) =pinsert A.AuctionId[sql| INSERT INTO auctions (project_id, initiator_id, raise_amount, end_time)pgEval (CreateAuction auc) = pinsertA.AuctionId[sql| INSERT INTO auctions (project_id, initiator_id, raise_amount, end_time) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 464
( auc ^. (A.projectId . _ProjectId), auc ^. (A.initiator . _UserId), auc ^. (A.raiseAmount . satoshi), auc ^. (A.auctionEnd . to fromThyme))( auc ^. (A.projectId . _ProjectId), auc ^. (A.initiator . _UserId), auc ^. (A.raiseAmount . satoshi), auc ^. (A.auctionEnd . to fromThyme)) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 470
pgEval (FindAuction aucId) =headMay <$> pquery auctionParser[sql| SELECT project_id, initiator_id, created_at, raise_amount, start_time, end_timepgEval (FindAuction aucId) = headMay <$> pqueryauctionParser[sql| SELECT project_id, initiator_id, created_at, raise_amount, start_time, end_time - replacement in lib/Aftok/Database/PostgreSQL.hs at line 475
(Only (aucId ^. A._AuctionId))(Only (aucId ^. A._AuctionId)) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 477
pgEval (CreateBid (A.AuctionId aucId) bid) =pinsert A.BidId[sql| INSERT INTO bids (auction_id, bidder_id, bid_seconds, bid_amount, bid_time)pgEval (CreateBid (A.AuctionId aucId) bid) = pinsertA.BidId[sql| INSERT INTO bids (auction_id, bidder_id, bid_seconds, bid_amount, bid_time) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 481
( aucId, bid ^. (A.bidUser . _UserId), case bid ^. A.bidSeconds of (Seconds i) -> i, bid ^. (A.bidAmount . satoshi), bid ^. (A.bidTime . to fromThyme))( aucId, bid ^. (A.bidUser . _UserId), case bid ^. A.bidSeconds of(Seconds i) -> i, bid ^. (A.bidAmount . satoshi), bid ^. (A.bidTime . to fromThyme)) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 489[3.668]→[3.2727:2753](∅→∅),[3.2753]→[3.13732:13782](∅→∅),[3.13782]→[3.18097:18197](∅→∅),[3.18097]→[3.18097:18197](∅→∅),[3.2894]→[3.9145:9180](∅→∅),[3.18197]→[3.9145:9180](∅→∅),[3.9145]→[3.9145:9180](∅→∅)
pgEval (FindBids aucId) =pquery ((,) <$> idParser A.BidId <*> bidParser)[sql| SELECT id, bidder_id, bid_seconds, bid_amount, bid_time FROM bids WHERE auction_id = ? |](Only (aucId ^. A._AuctionId))pgEval (FindBids aucId) = pquery((,) <$> idParser A.BidId <*> bidParser)[sql| SELECT id, bidder_id, bid_seconds, bid_amount, bid_time FROM bids WHERE auction_id = ? |](Only (aucId ^. A._AuctionId)) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 502
pinsert UserIdpinsertUserId - replacement in lib/Aftok/Database/PostgreSQL.hs at line 506
( user' ^. (username._UserName)( user' ^. (username . _UserName) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 509
, user' ^. userEmail._Email, user' ^. userEmail . _Email - replacement in lib/Aftok/Database/PostgreSQL.hs at line 514
headMay <$> pquery (userParser mode)headMay <$> pquery(userParser mode) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 521
headMay <$> pquery ((,) <$> idParser UserId <*> userParser mode)headMay <$> pquery((,) <$> idParser UserId <*> userParser mode) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 534
pgEval (FindInvitation ic) =headMay <$> pquery invitationParser[sql| SELECT project_id, invitor_id, invitee_email, invitation_time, acceptance_timepgEval (FindInvitation ic) = headMay <$> pqueryinvitationParser[sql| SELECT project_id, invitor_id, invitee_email, invitation_time, acceptance_time - replacement in lib/Aftok/Database/PostgreSQL.hs at line 538
(Only $ P.renderInvCode ic)(Only $ P.renderInvCode ic) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 552
pgEval (CreateProject p) =pinsert ProjectId[sql| INSERT INTO projects (project_name, inception_date, initiator_id, depreciation_fn)pgEval (CreateProject p) = pinsertProjectId[sql| INSERT INTO projects (project_name, inception_date, initiator_id, depreciation_fn) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 556
( p ^. P.projectName, p ^. (P.inceptionDate . to fromThyme), p ^. (P.initiator . _UserId), toJSON $ p ^. P.depf . to SerDepFunction)( p ^. P.projectName, p ^. (P.inceptionDate . to fromThyme), p ^. (P.initiator . _UserId), toJSON $ p ^. P.depf . to SerDepFunction) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 563
pquery (idParser ProjectId)[sql| SELECT id FROM projects |]()pquery (idParser ProjectId) [sql| SELECT id FROM projects |] () - replacement in lib/Aftok/Database/PostgreSQL.hs at line 565
pgEval (FindSubscribers pid) =pquery (idParser UserId)[sql| SELECT s.user_idpgEval (FindSubscribers pid) = pquery(idParser UserId)[sql| SELECT s.user_id - replacement in lib/Aftok/Database/PostgreSQL.hs at line 571
(Only (pid ^. _ProjectId))(Only (pid ^. _ProjectId)) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 573[3.4291]→[3.15421:15495](∅→∅),[3.15495]→[3.19759:19866](∅→∅),[3.19759]→[3.19759:19866](∅→∅),[3.19866]→[3.11325:11340](∅→∅),[3.11325]→[3.11325:11340](∅→∅)
pgEval (FindProject (ProjectId pid)) =headMay <$> pquery projectParser[sql| SELECT project_name, inception_date, initiator_id, depreciation_fn FROM projects WHERE id = ? |](Only pid)pgEval (FindProject (ProjectId pid)) = headMay <$> pqueryprojectParser[sql| SELECT project_name, inception_date, initiator_id, depreciation_fn FROM projects WHERE id = ? |](Only pid) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 578
pgEval (FindUserProjects (UserId uid)) =pquery ((,) <$> idParser ProjectId <*> projectParser)[sql| SELECT p.id, p.project_name, p.inception_date, p.initiator_id, p.depreciation_fnpgEval (FindUserProjects (UserId uid)) = pquery((,) <$> idParser ProjectId <*> projectParser)[sql| SELECT p.id, p.project_name, p.inception_date, p.initiator_id, p.depreciation_fn - replacement in lib/Aftok/Database/PostgreSQL.hs at line 584
(uid, uid)(uid, uid) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 586[3.1014]→[3.5201:5252](∅→∅),[3.5252]→[3.15763:15771](∅→∅),[3.15771]→[3.20184:20279](∅→∅),[3.20184]→[3.20184:20279](∅→∅),[3.20279]→[3.15772:15832](∅→∅)
pgEval (AddUserToProject pid current new) = void $pexec[sql| INSERT INTO project_companions (project_id, user_id, invited_by) VALUES (?, ?, ?) |](pid ^. _ProjectId, new ^. _UserId, current ^. _UserId)pgEval (AddUserToProject pid current new) = void $ pexec[sql| INSERT INTO project_companions (project_id, user_id, invited_by) VALUES (?, ?, ?) |](pid ^. _ProjectId, new ^. _UserId, current ^. _UserId) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 592
pinsert B.BillableIdpinsertB.BillableId - replacement in lib/Aftok/Database/PostgreSQL.hs at line 613
pgEval (FindBillable bid) =headMay <$> pquery billableParser[sql| SELECT b.project_id, e.created_by, b.name, b.description,pgEval (FindBillable bid) = headMay <$> pquerybillableParser[sql| SELECT b.project_id, e.created_by, b.name, b.description, - replacement in lib/Aftok/Database/PostgreSQL.hs at line 621
(Only (bid ^. B._BillableId))(Only (bid ^. B._BillableId)) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 623
pgEval (FindBillables pid) =pquery ((,) <$> idParser B.BillableId <*> billableParser)[sql| SELECT b.id, b.project_id, e.created_by, b.name, b.description,pgEval (FindBillables pid) = pquery((,) <$> idParser B.BillableId <*> billableParser)[sql| SELECT b.id, b.project_id, e.created_by, b.name, b.description, - replacement in lib/Aftok/Database/PostgreSQL.hs at line 631
(Only (pid ^. _ProjectId))(Only (pid ^. _ProjectId)) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 635
pinsert B.SubscriptionIdpinsertB.SubscriptionId - replacement in lib/Aftok/Database/PostgreSQL.hs at line 640
( view _UserId uid( view _UserId uid - replacement in lib/Aftok/Database/PostgreSQL.hs at line 642
, view _EventId eventId, view _EventId eventId - replacement in lib/Aftok/Database/PostgreSQL.hs at line 646
pgEval (FindSubscription sid) =headMay <$> pquery subscriptionParser[sql| SELECT id, billable_id, start_date, end_datepgEval (FindSubscription sid) = headMay <$> pquerysubscriptionParser[sql| SELECT id, billable_id, start_date, end_date - replacement in lib/Aftok/Database/PostgreSQL.hs at line 651
(Only (sid ^. B._SubscriptionId))(Only (sid ^. B._SubscriptionId)) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 653
pgEval (FindSubscriptions uid pid) =pquery ((,) <$> idParser B.SubscriptionId <*> subscriptionParser)[sql| SELECT s.id, user_id, billable_id, start_date, end_datepgEval (FindSubscriptions uid pid) = pquery((,) <$> idParser B.SubscriptionId <*> subscriptionParser)[sql| SELECT s.id, user_id, billable_id, start_date, end_date - replacement in lib/Aftok/Database/PostgreSQL.hs at line 660
(uid ^. _UserId, pid ^. _ProjectId)(uid ^. _UserId, pid ^. _ProjectId) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 665
pinsert PaymentRequestIdpinsertPaymentRequestId - replacement in lib/Aftok/Database/PostgreSQL.hs at line 678
pgEval (FindPaymentRequest (PaymentKey k)) =headMay <$> pquery ((,) <$> idParser PaymentRequestId <*> paymentRequestParser)pgEval (FindPaymentRequest (PaymentKey k)) = headMay <$> pquery((,) <$> idParser PaymentRequestId <*> paymentRequestParser) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 686
pgEval (FindPaymentRequestId (PaymentRequestId prid)) =headMay <$> pquery paymentRequestParserpgEval (FindPaymentRequestId (PaymentRequestId prid)) = headMay <$> pquerypaymentRequestParser - replacement in lib/Aftok/Database/PostgreSQL.hs at line 693
pgEval (FindPaymentRequests sid) =pquery ((,) <$> idParser PaymentRequestId <*> paymentRequestParser)pgEval (FindPaymentRequests sid) = pquery((,) <$> idParser PaymentRequestId <*> paymentRequestParser) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 702[3.846]→[3.846:892](∅→∅),[3.892]→[3.886:1010](∅→∅),[3.886]→[3.886:1010](∅→∅),[3.1010]→[3.18031:18079](∅→∅)
rowp = (,,,) <$> (PaymentKey <$> field)<*> paymentRequestParser<*> subscriptionParser<*> billableParserin pquery rowp[sql| SELECT r.url_key,rowp =(,,,)<$> (PaymentKey <$> field)<*> paymentRequestParser<*> subscriptionParser<*> billableParserin pqueryrowp[sql| SELECT r.url_key, - replacement in lib/Aftok/Database/PostgreSQL.hs at line 722
(Only (sid ^. B._SubscriptionId))(Only (sid ^. B._SubscriptionId)) - replacement in lib/Aftok/Database/PostgreSQL.hs at line 726
pinsert PaymentIdpinsertPaymentId - replacement in lib/Aftok/Database/PostgreSQL.hs at line 738
pgEval (FindPayments rid) =pquery ((,) <$> idParser PaymentId <*> paymentParser)pgEval (FindPayments rid) = pquery((,) <$> idParser PaymentId <*> paymentParser) - replacement in lib/Aftok/Database.hs at line 11[2.2693]→[3.24463:24549](∅→∅),[3.143]→[3.24463:24549](∅→∅),[3.24549]→[3.1787:1844](∅→∅),[3.1787]→[3.1787:1844](∅→∅)
import Control.Lens (view, (^.), makeClassyPrisms, traverseOf)import Control.Monad.Trans.Maybe (MaybeT (..))import Control.Lens ( view, (^.), makeClassyPrisms, traverseOf)import Control.Monad.Trans.Maybe ( MaybeT(..) ) - replacement in lib/Aftok/Database.hs at line 18
import Data.Thyme.Clock as Cimport Data.Thyme.Time as T (Day)import Safe (headMay)import Data.Thyme.Clock as Cimport Data.Thyme.Time as T( Day )import Safe ( headMay ) - replacement in lib/Aftok/Database.hs at line 24
import Aftok.Auction as Aimport Aftok.Billables as Bimport Aftok.Currency.Bitcoin (NetworkId)import Aftok.Auction as Aimport Aftok.Billables as Bimport Aftok.Currency.Bitcoin ( NetworkId ) - replacement in lib/Aftok/Database.hs at line 29
import Aftok.Project as Pimport Aftok.Project as P - replacement in lib/Aftok/Database.hs at line 33
import Network.Haskoin.Address (Address)import Network.Haskoin.Address ( Address ) - replacement in lib/Aftok/Database.hs at line 36
type InvitingUID = UserIdtype InvitedUID = UserIdtype InvitingUID = UserIdtype InvitedUID = UserId - replacement in lib/Aftok/Database.hs at line 43
CreateUser :: BTCUser -> DBOp UserIdFindUser :: UserId -> DBOp (Maybe BTCUser)FindUserByName :: UserName -> DBOp (Maybe (UserId, BTCUser))CreateUser ::BTCUser -> DBOp UserIdFindUser ::UserId -> DBOp (Maybe BTCUser)FindUserByName ::UserName -> DBOp (Maybe (UserId, BTCUser)) - replacement in lib/Aftok/Database.hs at line 47[3.6306]→[3.6306:6410](∅→∅),[3.6410]→[3.24550:24638](∅→∅),[3.24638]→[3.4711:4771](∅→∅),[3.6410]→[3.4711:4771](∅→∅),[3.4771]→[3.6462:6534](∅→∅),[3.6462]→[3.6462:6534](∅→∅),[3.6534]→[3.4554:4781](∅→∅)
CreateProject :: Project -> DBOp ProjectIdFindProject :: 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 InvitationCodeFindInvitation :: InvitationCode -> DBOp (Maybe Invitation)AcceptInvitation :: UserId -> InvitationCode -> C.UTCTime -> DBOp ()CreateProject ::Project -> DBOp ProjectIdFindProject ::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 InvitationCodeFindInvitation ::InvitationCode -> DBOp (Maybe Invitation)AcceptInvitation ::UserId -> InvitationCode -> C.UTCTime -> DBOp () - replacement in lib/Aftok/Database.hs at line 57
CreateEvent :: ProjectId -> UserId -> LogEntry BTCNet -> DBOp EventIdAmendEvent :: EventId -> EventAmendment BTCNet -> DBOp AmendmentIdFindEvent :: EventId -> DBOp (Maybe (KeyedLogEntry BTCNet))FindEvents :: ProjectId -> UserId -> Interval' -> DBOp [LogEntry BTCNet]ReadWorkIndex :: ProjectId -> DBOp (WorkIndex BTCNet)CreateEvent ::ProjectId -> UserId -> LogEntry BTCNet -> DBOp EventIdAmendEvent ::EventId -> EventAmendment BTCNet -> DBOp AmendmentIdFindEvent ::EventId -> DBOp (Maybe (KeyedLogEntry BTCNet))FindEvents ::ProjectId -> UserId -> Interval' -> DBOp [LogEntry BTCNet]ReadWorkIndex ::ProjectId -> DBOp (WorkIndex BTCNet) - replacement in lib/Aftok/Database.hs at line 63[3.6858]→[3.254:302](∅→∅),[3.302]→[3.6919:7028](∅→∅),[3.6919]→[3.6919:7028](∅→∅),[3.7028]→[3.4772:4827](∅→∅)
CreateAuction :: Auction -> DBOp AuctionIdFindAuction :: AuctionId -> DBOp (Maybe Auction)CreateBid :: AuctionId -> Bid -> DBOp BidIdFindBids :: AuctionId -> DBOp [(BidId, Bid)]CreateAuction ::Auction -> DBOp AuctionIdFindAuction ::AuctionId -> DBOp (Maybe Auction)CreateBid ::AuctionId -> Bid -> DBOp BidIdFindBids ::AuctionId -> DBOp [(BidId, Bid)] - replacement in lib/Aftok/Database.hs at line 68
CreateBillable :: UserId -> Billable -> DBOp BillableIdFindBillable :: BillableId -> DBOp (Maybe Billable)FindBillables :: ProjectId -> DBOp [(BillableId, Billable)]CreateBillable ::UserId -> Billable -> DBOp BillableIdFindBillable ::BillableId -> DBOp (Maybe Billable)FindBillables ::ProjectId -> DBOp [(BillableId, Billable)] - replacement in lib/Aftok/Database.hs at line 72
CreateSubscription :: UserId -> BillableId -> T.Day -> DBOp SubscriptionIdFindSubscription :: SubscriptionId -> DBOp (Maybe Subscription)FindSubscriptions :: UserId -> ProjectId -> DBOp [(SubscriptionId, Subscription)]CreateSubscription ::UserId -> BillableId -> T.Day -> DBOp SubscriptionIdFindSubscription ::SubscriptionId -> DBOp (Maybe Subscription)FindSubscriptions ::UserId -> ProjectId -> DBOp [(SubscriptionId, Subscription)] - replacement in lib/Aftok/Database.hs at line 76[3.4200]→[3.1598:1665](∅→∅),[3.1665]→[3.5107:5194](∅→∅),[3.5107]→[3.5107:5194](∅→∅),[3.5194]→[3.1866:1929](∅→∅),[3.1929]→[3.1666:1755](∅→∅),[3.1755]→[3.24706:24781](∅→∅)
CreatePaymentRequest :: PaymentRequest -> DBOp PaymentRequestIdFindPaymentRequests :: SubscriptionId -> DBOp [(PaymentRequestId, PaymentRequest)]FindUnpaidRequests :: SubscriptionId -> DBOp [BillDetail]FindPaymentRequest :: PaymentKey -> DBOp (Maybe (PaymentRequestId, PaymentRequest))FindPaymentRequestId :: PaymentRequestId -> DBOp (Maybe PaymentRequest)CreatePaymentRequest ::PaymentRequest -> DBOp PaymentRequestIdFindPaymentRequests ::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 82
CreatePayment :: Payment -> DBOp PaymentIdFindPayments :: PaymentRequestId -> DBOp [(PaymentId, Payment)]CreatePayment ::Payment -> DBOp PaymentIdFindPayments ::PaymentRequestId -> DBOp [(PaymentId, Payment)] - replacement in lib/Aftok/Database.hs at line 144
findProjectOrError pid = fromMaybeT(raiseSubjectNotFound $ FindProject pid)(findProject pid)findProjectOrError pid =fromMaybeT (raiseSubjectNotFound $ FindProject pid) (findProject pid) - replacement in lib/Aftok/Database.hs at line 169
addUserToProject :: (MonadDB m) => ProjectId -> InvitingUID -> InvitedUID -> m ()addUserToProject:: (MonadDB m) => ProjectId -> InvitingUID -> InvitedUID -> m () - replacement in lib/Aftok/Database.hs at line 174
createInvitation :: (MonadDB m) => ProjectId -> InvitingUID -> Email -> C.UTCTime -> m InvitationCodecreateInvitation:: (MonadDB m)=> ProjectId-> InvitingUID-> Email-> C.UTCTime-> m InvitationCode - replacement in lib/Aftok/Database.hs at line 187
acceptInvitation :: (MonadDB m) => UserId -> C.UTCTime -> InvitationCode-> m ()acceptInvitation :: (MonadDB m) => UserId -> C.UTCTime -> InvitationCode -> m () - replacement in lib/Aftok/Database.hs at line 192
Nothing ->raiseSubjectNotFound actNothing -> raiseSubjectNotFound act - replacement in lib/Aftok/Database.hs at line 197
Just i ->withProjectAuth (i ^. P.projectId) (i ^. P.invitingUser) actJust i -> withProjectAuth (i ^. P.projectId) (i ^. P.invitingUser) act - replacement in lib/Aftok/Database.hs at line 202
createEvent :: (MonadDB m) => ProjectId -> UserId -> LogEntry BTCNet -> m EventIdcreateEvent:: (MonadDB m) => ProjectId -> UserId -> LogEntry BTCNet -> m EventId - replacement in lib/Aftok/Database.hs at line 206
amendEvent :: (MonadDB m) => UserId -> EventId -> EventAmendment BTCNet -> m AmendmentIdamendEvent:: (MonadDB m) => UserId -> EventId -> EventAmendment BTCNet -> m AmendmentId - replacement in lib/Aftok/Database.hs at line 210
let act = AmendEvent eid alet act = AmendEvent eid a - replacement in lib/Aftok/Database.hs at line 213
maybe missing (\(_, uid', _) -> if uid' == uid then liftdb act else forbidden) evmaybe missing(\(_, uid', _) -> if uid' == uid then liftdb act else forbidden)ev - replacement in lib/Aftok/Database.hs at line 220
findEvents :: (MonadDB m) => ProjectId -> UserId -> Interval' -> m [LogEntry BTCNet]findEvents:: (MonadDB m) => ProjectId -> UserId -> Interval' -> m [LogEntry BTCNet] - replacement in lib/Aftok/Database.hs at line 236
findSubscriptions :: (MonadDB m) => UserId -> ProjectId -> m [(SubscriptionId, Subscription)]findSubscriptions:: (MonadDB m) => UserId -> ProjectId -> m [(SubscriptionId, Subscription)] - replacement in lib/Aftok/Database.hs at line 240
findSubscriptionBillable :: (MonadDB m) => SubscriptionId -> MaybeT m (Subscription' UserId Billable)findSubscriptionBillable:: (MonadDB m) => SubscriptionId -> MaybeT m (Subscription' UserId Billable) - replacement in lib/Aftok/Database.hs at line 246
findPaymentRequests :: (MonadDB m) => SubscriptionId -> m [(PaymentRequestId, PaymentRequest)]findPaymentRequests:: (MonadDB m) => SubscriptionId -> m [(PaymentRequestId, PaymentRequest)] - replacement in lib/Aftok/Database.hs at line 250
findPaymentRequest :: (MonadDB m) => PaymentKey -> MaybeT m (PaymentRequestId, PaymentRequest)findPaymentRequest:: (MonadDB m) => PaymentKey -> MaybeT m (PaymentRequestId, PaymentRequest) - replacement in lib/Aftok/Database.hs at line 254
findPaymentRequestId :: (MonadDB m) => PaymentRequestId -> MaybeT m PaymentRequestfindPaymentRequestId:: (MonadDB m) => PaymentRequestId -> MaybeT m PaymentRequest - replacement in lib/Aftok/Database.hs at line 276[3.892]→[3.26237:26271](∅→∅),[3.26271]→[3.20278:20343](∅→∅),[3.20343]→[3.26337:26350](∅→∅),[3.26337]→[3.26337:26350](∅→∅)
auc <- MaybeT $ liftdb findOp_ <- lift $ checkProjectAuth (auc ^. A.projectId) uid findOppure aucauc <- MaybeT $ liftdb findOp_ <- lift $ checkProjectAuth (auc ^. A.projectId) uid findOppure auc - replacement in lib/Aftok/Database.hs at line 284[3.411]→[3.9820:9850](∅→∅),[3.9850]→[3.437:523](∅→∅),[3.437]→[3.437:523](∅→∅),[3.523]→[3.9851:9905](∅→∅)
maybeAuc <- liftdb findOp_ <- traverse (\auc -> checkProjectAuth (auc ^. A.projectId) uid findOp) maybeAucmaybe (raiseSubjectNotFound findOp) pure maybeAucmaybeAuc <- liftdb findOp_ <- traverse(\auc -> checkProjectAuth (auc ^. A.projectId) uid findOp)maybeAucmaybe (raiseSubjectNotFound findOp) pure maybeAuc - replacement in lib/Aftok/Database.hs at line 294[3.618]→[3.618:650](∅→∅),[3.650]→[3.9973:10019](∅→∅),[3.964]→[3.702:756](∅→∅),[3.10019]→[3.702:756](∅→∅),[3.702]→[3.702:756](∅→∅),[3.756]→[3.10020:10047](∅→∅)
auc <- findAuction' aid uidif view bidTime bid > view auctionEnd aucthen raiseOpForbidden uid AuctionEnded createOpelse liftdb createOp[3.618]auc <- findAuction' aid uidif view bidTime bid > view auctionEnd aucthen raiseOpForbidden uid AuctionEnded createOpelse liftdb createOp - replacement in lib/Aftok/Interval.hs at line 4[3.1609]→[3.3:48](∅→∅),[3.3657]→[3.3:48](∅→∅),[3.5263]→[3.3:48](∅→∅),[3.48]→[3.1316:1359](∅→∅),[3.48]→[3.3192:3228](∅→∅),[3.54]→[3.3192:3228](∅→∅),[3.1359]→[3.3192:3228](∅→∅),[3.44]→[3.3192:3228](∅→∅)
( Interval(..), interval, start, end, ilen, Interval'(..), interval', start', end', intervalJSON, parseIntervalJSON( Interval(..), interval, start, end, ilen, Interval'(..), interval', start', end', intervalJSON, parseIntervalJSON - replacement in lib/Aftok/Interval.hs at line 16[3.44]→[3.1483:1493](∅→∅),[3.77]→[3.1483:1493](∅→∅),[3.3228]→[3.1483:1493](∅→∅),[3.1483]→[3.1483:1493](∅→∅)
) where)where - replacement in lib/Aftok/Interval.hs at line 21
import Control.Lens (makeLenses, (^.))import Control.Lens ( makeLenses, (^.)) - replacement in lib/Aftok/Interval.hs at line 27
import Data.Thyme.Clock as Cimport Data.Thyme.Format.Aeson ()import Data.Thyme.LocalTime ()import Data.Thyme.Clock as Cimport Data.Thyme.Format.Aeson ( )import Data.Thyme.LocalTime ( ) - replacement in lib/Aftok/Json.hs at line 12[3.1966]→[3.20511:20587](∅→∅),[3.20587]→[3.950:1014](∅→∅),[3.1966]→[3.950:1014](∅→∅),[3.1014]→[3.20588:20654](∅→∅)
import Control.FromSum (fromMaybeM, fromEitherM)import Control.Lens hiding ((.=))import Control.Monad.Fail (MonadFail(..))import Control.FromSum ( fromMaybeM, fromEitherM)import Control.Lens hiding ( (.=) )import Control.Monad.Fail ( MonadFail(..) ) - replacement in lib/Aftok/Json.hs at line 19
import qualified Data.Attoparsec.ByteString.Char8 as PCimport qualified Data.ByteString.Base64 as B64import qualified Data.ByteString.Char8 as Cimport qualified Data.Attoparsec.ByteString.Char8as PCimport qualified Data.ByteString.Base64 as B64import qualified Data.ByteString.Char8 as C - replacement in lib/Aftok/Json.hs at line 24[3.1159]→[3.1003:1058](∅→∅),[3.1058]→[3.1159:1270](∅→∅),[3.1159]→[3.1159:1270](∅→∅),[3.1270]→[3.1692:1817](∅→∅),[3.518]→[3.4970:5025](∅→∅),[3.1817]→[3.4970:5025](∅→∅),[3.1270]→[3.4970:5025](∅→∅),[3.5025]→[2.2731:2786](∅→∅),[2.2786]→[3.2070:2136](∅→∅),[3.5025]→[3.2070:2136](∅→∅),[3.2136]→[3.20655:20714](∅→∅),[3.20714]→[3.1554:1610](∅→∅),[3.58]→[3.1554:1610](∅→∅),[3.58]→[3.3094:3149](∅→∅),[3.1610]→[3.3094:3149](∅→∅),[3.6278]→[3.3094:3149](∅→∅),[3.790]→[3.3094:3149](∅→∅)
import Data.HashMap.Strict as Oimport Data.List.NonEmpty as Limport Data.Map.Strict as MSimport Data.ProtocolBuffers (encodeMessage)import Data.Serialize.Put (runPut)import qualified Data.Text as Timport qualified Data.Text.Encoding as Timport Data.Thyme.Calendar (showGregorian)import Data.Thyme.Clock as Clockimport Data.Thyme.Time (Day)import Data.UUID as Uimport Data.HashMap.Strict as Oimport Data.List.NonEmpty as Limport Data.Map.Strict as MSimport Data.ProtocolBuffers ( encodeMessage )import Data.Serialize.Put ( runPut )import qualified Data.Text as Timport qualified Data.Text.Encoding as Timport Data.Thyme.Calendar ( showGregorian )import Data.Thyme.Clock as Clockimport Data.Thyme.Time ( Day )import Data.UUID as U - replacement in lib/Aftok/Json.hs at line 36
import Network.Haskoin.Address (Address, addrToJSON, addrFromJSON, stringToAddr)import Network.Haskoin.Address ( Address, addrToJSON, addrFromJSON, stringToAddr) - replacement in lib/Aftok/Json.hs at line 43
import Aftok.Auction as Aimport qualified Aftok.Billables as Bimport Aftok.Auction as Aimport qualified Aftok.Billables as B - replacement in lib/Aftok/Json.hs at line 47[3.551]→[3.2372:2435](∅→∅),[3.551]→[3.116:171](∅→∅),[3.2435]→[3.116:171](∅→∅),[3.1358]→[3.116:171](∅→∅)
import Aftok.Payments.Types (BillDetail)import Aftok.Project as Pimport Aftok.Payments.Types ( BillDetail )import Aftok.Project as P - replacement in lib/Aftok/Json.hs at line 51
import Aftok.Util (traverseKeys)import Aftok.Util ( traverseKeys ) - replacement in lib/Aftok/Json.hs at line 53
import qualified Language.Haskell.TH as THimport qualified Language.Haskell.TH as TH - replacement in lib/Aftok/Json.hs at line 64
printVersion Version{..} = T.intercalate "." $ fmap (T.pack . show) [majorVersion, minorVersion]printVersion Version {..} =T.intercalate "." $ fmap (T.pack . show) [majorVersion, minorVersion] - replacement in lib/Aftok/Json.hs at line 74
v = QuasiQuoter { quoteExp = quoteVersionExp, quotePat = error "Pattern quasiquotation of versions not supported.", quoteType = error "Type quasiquotation of versions not supported.", quoteDec = error "Dec quasiquotation of versions not supported."}v = QuasiQuoter{ quoteExp = quoteVersionExp, quotePat = error "Pattern quasiquotation of versions not supported.", quoteType = error "Type quasiquotation of versions not supported.", quoteDec = error "Dec quasiquotation of versions not supported."} - replacement in lib/Aftok/Json.hs at line 88
versioned ver o = Object $ uncurry O.insert ("schemaVersion" .= printVersion ver) oversioned ver o =Object $ uncurry O.insert ("schemaVersion" .= printVersion ver) o - replacement in lib/Aftok/Json.hs at line 116
badVersion :: forall v a. String -> Version -> v -> Parser abadVersion :: forall v a . String -> Version -> v -> Parser a - replacement in lib/Aftok/Json.hs at line 118
const . fail $ "Unrecognized " <> name <> " schema version: " <> T.unpack (printVersion ver)const . fail $ "Unrecognized " <> name <> " schema version: " <> T.unpack(printVersion ver) - replacement in lib/Aftok/Json.hs at line 129
idValue :: forall a. Lens' a UUID -> a -> ValueidValue :: forall a . Lens' a UUID -> a -> Value - replacement in lib/Aftok/Json.hs at line 132
idJSON :: forall a. Text -> Lens' a UUID -> a -> ValueidJSON t l a = v1 $ obj [ t .= idValue l a ]idJSON :: forall a . Text -> Lens' a UUID -> a -> ValueidJSON t l a = v1 $ obj [t .= idValue l a] - replacement in lib/Aftok/Json.hs at line 136
qdbJSON name l f (xid, x) = v1 $obj [ (name <> "Id") .= idValue l xid, name .= f x]qdbJSON name l f (xid, x) =v1 $ obj [(name <> "Id") .= idValue l xid, name .= f x] - replacement in lib/Aftok/Json.hs at line 143[3.5298]→[3.5319:5340](∅→∅),[3.5340]→[3.1349:1445](∅→∅),[3.1445]→[2.3062:3119](∅→∅),[2.3119]→[3.1508:1516](∅→∅),[3.1508]→[3.1508:1516](∅→∅)
projectJSON p = v1 $obj [ "projectName" .= (p ^. projectName), "inceptionDate" .= (p ^. inceptionDate), "initiator" .= (p ^. P.initiator . _UserId)]projectJSON p = v1 $ obj[ "projectName" .= (p ^. projectName), "inceptionDate" .= (p ^. inceptionDate), "initiator" .= (p ^. P.initiator . _UserId)] - replacement in lib/Aftok/Json.hs at line 156[3.571]→[3.571:592](∅→∅),[3.592]→[3.1945:2064](∅→∅),[3.2064]→[3.5070:5127](∅→∅),[3.1694]→[3.5070:5127](∅→∅),[3.5127]→[3.1750:1758](∅→∅),[3.1750]→[3.1750:1758](∅→∅)
auctionJSON x = v1 $obj [ "projectId" .= idValue (A.projectId._ProjectId) x, "initiator" .= idValue (A.initiator._UserId) x, "raiseAmount" .= (x ^. (raiseAmount . satoshi))]auctionJSON x = v1 $ obj[ "projectId" .= idValue (A.projectId . _ProjectId) x, "initiator" .= idValue (A.initiator . _UserId) x, "raiseAmount" .= (x ^. (raiseAmount . satoshi))] - replacement in lib/Aftok/Json.hs at line 163
bidIdJSON pid = v1 $obj [ "bidId" .= (pid ^. _BidId) ]bidIdJSON pid = v1 $ obj ["bidId" .= (pid ^. _BidId)] - replacement in lib/Aftok/Json.hs at line 170
creditToJSON nmode (CreditToCurrency (netId, addr)) =v2 $ obj [ "creditToAddress" .= addrToJSON (toNetwork nmode netId) addr, "creditToNetwork" .= renderNetworkId netId]creditToJSON nmode (CreditToCurrency (netId, addr)) = v2 $ obj[ "creditToAddress" .= addrToJSON (toNetwork nmode netId) addr, "creditToNetwork" .= renderNetworkId netId] - replacement in lib/Aftok/Json.hs at line 175
v2 $ obj [ "creditToUser" .= idValue _UserId uid ]v2 $ obj ["creditToUser" .= idValue _UserId uid] - replacement in lib/Aftok/Json.hs at line 177
v2 $ obj [ "creditToProject" .= projectIdJSON pid ]v2 $ obj ["creditToProject" .= projectIdJSON pid] - replacement in lib/Aftok/Json.hs at line 186[3.22616]→[3.22616:22744](∅→∅),[3.22744]→[2.3158:3254](∅→∅),[2.3254]→[3.22838:22927](∅→∅),[3.22838]→[3.22838:22927](∅→∅)
:: NetworkMode-> NetworkId-> Text-> Parser (CreditTo (NetworkId, Address))parseBtcAddr nmode net addrText =maybe(fail . T.unpack $ "Address " <> addrText <> " cannot be parsed as a BTC network address.")(pure . CreditToCurrency . (net,))(stringToAddr (toNetwork nmode net) addrText):: NetworkMode -> NetworkId -> Text -> Parser (CreditTo (NetworkId, Address))parseBtcAddr nmode net addrText = maybe( fail. T.unpack$ "Address "<> addrText<> " cannot be parsed as a BTC network address.")(pure . CreditToCurrency . (net, ))(stringToAddr (toNetwork nmode net) addrText) - replacement in lib/Aftok/Json.hs at line 198
:: NetworkMode-> Object-> Parser (CreditTo (NetworkId, Address)):: NetworkMode -> Object -> Parser (CreditTo (NetworkId, Address)) - replacement in lib/Aftok/Json.hs at line 202
parseCreditToV2 :: NetworkMode -> Object -> Parser (CreditTo (NetworkId, Address))parseCreditToV2:: NetworkMode -> Object -> Parser (CreditTo (NetworkId, Address)) - replacement in lib/Aftok/Json.hs at line 205
let parseCreditToAddr = donetName <- o .: "creditToNetwork"net <- fromMaybeM(fail . T.unpack $ "Currency network " <> netName <> " not recognized.")(parseNetworkId netName)addrValue <- o .: "creditToAddress"CreditToCurrency . (net,) <$> addrFromJSON (toNetwork nmode net) addrValueletparseCreditToAddr = donetName <- o .: "creditToNetwork"net <- fromMaybeM(fail . T.unpack $ "Currency network " <> netName <> " not recognized.")(parseNetworkId netName)addrValue <- o .: "creditToAddress"CreditToCurrency. (net, )<$> addrFromJSON (toNetwork nmode net) addrValue - replacement in lib/Aftok/Json.hs at line 216
parseCreditToUser =fmap CreditToUser . parseId _UserId =<< o .: "creditToUser"parseCreditToUser =fmap CreditToUser . parseId _UserId =<< o .: "creditToUser" - replacement in lib/Aftok/Json.hs at line 219
parseCreditToProject =fmap CreditToProject . parseId _ProjectId =<< o .: "creditToProject"parseCreditToProject =fmap CreditToProject . parseId _ProjectId =<< o .: "creditToProject" - replacement in lib/Aftok/Json.hs at line 222
notFound = fail $ "Value " <> show o <> " does not represent a CreditTo value."notFound =fail $ "Value " <> show o <> " does not represent a CreditTo value."inparseCreditToAddr<|> parseCreditToUser<|> parseCreditToProject<|> notFound - edit in lib/Aftok/Json.hs at line 230
in parseCreditToAddr <|> parseCreditToUser <|> parseCreditToProject <|> notFound - replacement in lib/Aftok/Json.hs at line 234[3.581]→[3.23935:24180](∅→∅),[3.24180]→[3.3488:3577](∅→∅),[3.3488]→[3.3488:3577](∅→∅),[3.3577]→[3.2080:2139](∅→∅)
payoutsJSON :: NetworkMode -> Payouts (NetworkId, Address)-> ValuepayoutsJSON nmode (Payouts m) = v2 $let payoutsRec :: (CreditTo (NetworkId, Address), Rational) -> ValuepayoutsRec (c, r) = object [ "creditTo" .= creditToJSON nmode c, "payoutRatio" .= r]in obj $ [ "payouts" .= fmap payoutsRec (MS.assocs m) ]payoutsJSON :: NetworkMode -> Payouts (NetworkId, Address) -> ValuepayoutsJSON nmode (Payouts m) =v2$ let payoutsRec :: (CreditTo (NetworkId, Address), Rational) -> ValuepayoutsRec (c, r) =object ["creditTo" .= creditToJSON nmode c, "payoutRatio" .= r]in obj $ ["payouts" .= fmap payoutsRec (MS.assocs m)] - replacement in lib/Aftok/Json.hs at line 242
parsePayoutsJSON :: NetworkMode -> Value -> Parser (Payouts (NetworkId, Address))parsePayoutsJSON:: NetworkMode -> Value -> Parser (Payouts (NetworkId, Address)) - replacement in lib/Aftok/Json.hs at line 246
p (Version 1 _) val =Payouts <$> join (traverseKeys (parseBtcAddr nmode BTC) <$> parseJSON (Object val))p (Version 1 _) val = Payouts <$> join(traverseKeys (parseBtcAddr nmode BTC) <$> parseJSON (Object val)) - replacement in lib/Aftok/Json.hs at line 250
let parsePayoutRecord x = (,) <$> (parseCreditToV2 nmode =<< (x .: "creditTo"))<*> (x .: "payoutRatio")in Payouts . MS.fromList <$> (traverse parsePayoutRecord =<< parseJSON (Object val))let parsePayoutRecord x =(,)<$> (parseCreditToV2 nmode =<< (x .: "creditTo"))<*> (x .: "payoutRatio")in Payouts. MS.fromList<$> (traverse parsePayoutRecord =<< parseJSON (Object val)) - replacement in lib/Aftok/Json.hs at line 258
p ver x =badVersion "Payouts" ver xp ver x = badVersion "Payouts" ver x - replacement in lib/Aftok/Json.hs at line 265[3.24892]→[3.24892:25081](∅→∅),[3.25081]→[3.3815:3924](∅→∅),[3.3815]→[3.3815:3924](∅→∅),[3.3924]→[3.2140:2201](∅→∅)
workIndexJSON nmode (WorkIndex widx) = v2 $let widxRec :: (CreditTo (NetworkId, Address), NonEmpty Interval) -> ValuewidxRec (c, l) = object [ "creditTo" .= creditToJSON nmode c, "intervals" .= (intervalJSON <$> L.toList l)]in obj $ [ "workIndex" .= fmap widxRec (MS.assocs widx) ]workIndexJSON nmode (WorkIndex widx) =v2$ let widxRec :: (CreditTo (NetworkId, Address), NonEmpty Interval) -> ValuewidxRec (c, l) = object[ "creditTo" .= creditToJSON nmode c, "intervals" .= (intervalJSON <$> L.toList l)]in obj $ ["workIndex" .= fmap widxRec (MS.assocs widx)] - replacement in lib/Aftok/Json.hs at line 278
logEventJSON' ev = object [ eventName ev .= object [ "eventTime" .= (ev ^. eventTime) ] ]logEventJSON' ev =object [eventName ev .= object ["eventTime" .= (ev ^. eventTime)]] - replacement in lib/Aftok/Json.hs at line 282[3.25152]→[3.25152:25240](∅→∅),[3.25240]→[3.1531:1567](∅→∅),[3.2274]→[3.1531:1567](∅→∅),[3.1567]→[3.2309:2342](∅→∅),[3.2309]→[3.2309:2342](∅→∅)
logEntryJSON nmode (LogEntry c ev m) = v2 $obj [ "creditTo" .= creditToJSON nmode c, "event" .= logEventJSON' ev, "eventMeta" .= m]logEntryJSON nmode (LogEntry c ev m) = v2 $ obj[ "creditTo" .= creditToJSON nmode c, "event" .= logEventJSON' ev, "eventMeta" .= m] - replacement in lib/Aftok/Json.hs at line 299
[ "projectId" .= idValue (B.project . _ProjectId) b, "name" .= (b ^. B.name)[ "projectId" .= idValue (B.project . _ProjectId) b, "name" .= (b ^. B.name) - replacement in lib/Aftok/Json.hs at line 302
, "recurrence" .= recurrenceJSON' (b ^. B.recurrence), "amount" .= (b ^. (B.amount . satoshi)), "recurrence" .= recurrenceJSON' (b ^. B.recurrence), "amount" .= (b ^. (B.amount . satoshi)) - replacement in lib/Aftok/Json.hs at line 312
recurrenceJSON' B.Annually = object [ "annually" .= Null ]recurrenceJSON' (B.Monthly i) = object [ "monthly " .= object [ "months" .= i ] ]recurrenceJSON' B.Annually = object ["annually" .= Null]recurrenceJSON' (B.Monthly i) = object ["monthly " .= object ["months" .= i]] - replacement in lib/Aftok/Json.hs at line 315
recurrenceJSON' (B.Weekly i) = object [ "weekly " .= object [ "weeks" .= i ] ]recurrenceJSON' B.OneTime = object [ "onetime" .= Null ]recurrenceJSON' (B.Weekly i) = object ["weekly " .= object ["weeks" .= i]]recurrenceJSON' B.OneTime = object ["onetime" .= Null] - replacement in lib/Aftok/Json.hs at line 319[3.2374]→[3.2374:2551](∅→∅),[3.2551]→[3.621:629](∅→∅),[3.3188]→[3.621:629](∅→∅),[3.10521]→[3.621:629](∅→∅),[3.2422]→[3.621:629](∅→∅)
createSubscriptionJSON uid bid d = v1 $obj [ "user_id" .= idValue _UserId uid, "billable_id" .= idValue B._BillableId bid, "start_date" .= showGregorian d]createSubscriptionJSON uid bid d = v1 $ obj[ "user_id" .= idValue _UserId uid, "billable_id" .= idValue B._BillableId bid, "start_date" .= showGregorian d] - replacement in lib/Aftok/Json.hs at line 330
[ "user_id" .= idValue (B.customer . _UserId) sub[ "user_id" .= idValue (B.customer . _UserId) sub - replacement in lib/Aftok/Json.hs at line 332
, "start_time" .= view B.startTime sub, "end_time" .= view B.endTime sub, "start_time" .= view B.startTime sub, "end_time" .= view B.endTime sub - replacement in lib/Aftok/Json.hs at line 350
whereprBytes = paymentRequest . to (T.decodeUtf8 . B64.encode . runPut . encodeMessage)whereprBytes =paymentRequest . to (T.decodeUtf8 . B64.encode . runPut . encodeMessage) - replacement in lib/Aftok/Json.hs at line 355
billDetailsJSON r = v1 $obj ["payment_requests" .= fmap billDetailJSON r ]billDetailsJSON r = v1 $ obj ["payment_requests" .= fmap billDetailJSON r] - replacement in lib/Aftok/Json.hs at line 358[3.4171]→[3.4171:4205](∅→∅),[3.4205]→[3.1120:1178](∅→∅),[3.1178]→[3.4274:4377](∅→∅),[3.4274]→[3.4274:4377](∅→∅)
billDetailJSON r =obj $ concat[ ["payment_request_id" .= view (_1 . _PaymentKey) r], paymentRequestKV $ view _2 r, subscriptionKV $ view _3 r, billableKV $ view _4 r]billDetailJSON r = obj $ concat[ ["payment_request_id" .= view (_1 . _PaymentKey) r], paymentRequestKV $ view _2 r, subscriptionKV $ view _3 r, billableKV $ view _4 r] - replacement in lib/Aftok/Json.hs at line 369[3.1008]→[3.1008:1029](∅→∅),[3.1029]→[3.2891:3017](∅→∅),[3.3017]→[3.1216:1261](∅→∅),[3.1216]→[3.1216:1261](∅→∅),[3.1261]→[3.2422:2430](∅→∅),[3.2422]→[3.2422:2430](∅→∅),[3.2430]→[3.25332:25340](∅→∅),[3.25340]→[2.3343:3428](∅→∅)
paymentJSON r = v1 $obj [ "payment_request_id" .= idValue (request . _PaymentRequestId) r, "payment_protobuf_64" .= view paymentBytes r, "payment_date" .= (r ^. paymentDate)]wherepaymentBytes = payment . to (T.decodeUtf8 . B64.encode . runPut . encodeMessage)paymentJSON r = v1 $ obj[ "payment_request_id" .= idValue (request . _PaymentRequestId) r, "payment_protobuf_64" .= view paymentBytes r, "payment_date" .= (r ^. paymentDate)]wherepaymentBytes =payment . to (T.decodeUtf8 . B64.encode . runPut . encodeMessage) - replacement in lib/Aftok/Json.hs at line 384
maybe (fail $ "Value " <> str <> "Could not be parsed as a valid UUID.") pure $ U.fromString strmaybe (fail $ "Value " <> str <> "Could not be parsed as a valid UUID.") pure$ U.fromString str - replacement in lib/Aftok/Json.hs at line 387
parseId :: forall a. Prism' a UUID -> Value -> Parser aparseId :: forall a . Prism' a UUID -> Value -> Parser a - replacement in lib/Aftok/Json.hs at line 406[3.25852]→[3.25852:25921](∅→∅),[3.25921]→[3.4081:4151](∅→∅),[3.2109]→[3.4081:4151](∅→∅),[3.4151]→[3.25922:25999](∅→∅),[3.25999]→[3.4222:4292](∅→∅),[3.4222]→[3.4222:4292](∅→∅),[3.4292]→[2.3429:3513](∅→∅),[2.3513]→[3.1328:1362](∅→∅),[3.26082]→[3.1328:1362](∅→∅),[3.4481]→[3.1328:1362](∅→∅)
let parseA :: Text -> Parser (EventAmendment (NetworkId, Address))parseA "timeChange" = TimeChange t <$> o .: "eventTime"parseA "addrChange" = CreditToChange t <$> parseCreditToV1 nmode oparseA "metadataChange" = MetadataChange t <$> o .: "eventMeta"parseA tid = fail . T.unpack $ "Amendment type " <> tid <> " not recognized."in o .: "amendment" >>= parseAletparseA :: Text -> Parser (EventAmendment (NetworkId, Address))parseA "timeChange" = TimeChange t <$> o .: "eventTime"parseA "addrChange" = CreditToChange t <$> parseCreditToV1 nmode oparseA "metadataChange" = MetadataChange t <$> o .: "eventMeta"parseA tid =fail . T.unpack $ "Amendment type " <> tid <> " not recognized."ino .: "amendment" >>= parseA - replacement in lib/Aftok/Json.hs at line 422[3.26231]→[3.26231:26300](∅→∅),[3.26300]→[3.4426:4496](∅→∅),[3.2665]→[3.4426:4496](∅→∅),[3.4496]→[3.26301:26378](∅→∅),[3.26378]→[3.4567:4637](∅→∅),[3.4567]→[3.4567:4637](∅→∅),[3.4637]→[2.3514:3599](∅→∅),[2.3599]→[3.1363:1397](∅→∅),[3.26462]→[3.1363:1397](∅→∅),[3.4591]→[3.1363:1397](∅→∅)
let parseA :: Text -> Parser (EventAmendment (NetworkId, Address))parseA "timeChange" = TimeChange t <$> o .: "eventTime"parseA "creditToChange" = CreditToChange t <$> parseCreditToV2 nmode oparseA "metadataChange" = MetadataChange t <$> o .: "eventMeta"parseA tid = fail . T.unpack $ "Amendment type " <> tid <> " not recognized."in o .: "amendment" >>= parseAletparseA :: Text -> Parser (EventAmendment (NetworkId, Address))parseA "timeChange" = TimeChange t <$> o .: "eventTime"parseA "creditToChange" = CreditToChange t <$> parseCreditToV2 nmode oparseA "metadataChange" = MetadataChange t <$> o .: "eventMeta"parseA tid =fail . T.unpack $ "Amendment type " <> tid <> " not recognized."ino .: "amendment" >>= parseA - replacement in lib/Aftok/Json.hs at line 440
creditTo' <- o .:? "creditTo" >>= maybe (pure $ CreditToUser uid) (parseCreditToV2 nmode)creditTo' <- o .:? "creditTo" >>= maybe (pure $ CreditToUser uid)(parseCreditToV2 nmode) - replacement in lib/Aftok/Json.hs at line 449
let parseAnnually o' = const (pure B.Annually) <$> O.lookup "annually" o'parseMonthly o' = fmap B.Monthly . parseJSON <$> O.lookup "monthly" o'parseWeekly o' = fmap B.Weekly . parseJSON <$> O.lookup "weekly" o'parseOneTime o' = const (pure B.OneTime) <$> O.lookup "one-time" o'letparseAnnually o' = const (pure B.Annually) <$> O.lookup "annually" o'parseMonthly o' = fmap B.Monthly . parseJSON <$> O.lookup "monthly" o'parseWeekly o' = fmap B.Weekly . parseJSON <$> O.lookup "weekly" o'parseOneTime o' = const (pure B.OneTime) <$> O.lookup "one-time" o' - replacement in lib/Aftok/Json.hs at line 455[3.988]→[3.27851:27939](∅→∅),[3.27939]→[3.26817:26961](∅→∅),[3.26961]→[3.28028:28064](∅→∅),[3.28028]→[3.28028:28064](∅→∅)
notFound = fail $ "Value " <> show o <> " does not represent a Recurrence value."parseV val = parseAnnually val<|> parseMonthly val<|> parseWeekly val<|> parseOneTime valin fromMaybe notFound $ parseV onotFound =fail $ "Value " <> show o <> " does not represent a Recurrence value."parseV val =parseAnnually val<|> parseMonthly val<|> parseWeekly val<|> parseOneTime valinfromMaybe notFound $ parseV o - replacement in lib/Aftok/Payments/Types.hs at line 11
import Control.Lens (makeLenses, makePrisms, view)import Control.Lens ( makeLenses, makePrisms, view) - replacement in lib/Aftok/Payments/Types.hs at line 16[3.10704]→[3.773:821](∅→∅),[3.821]→[3.1974:2019](∅→∅),[3.10704]→[3.1974:2019](∅→∅),[3.2019]→[2.3604:3694](∅→∅)
import Data.Aeson (Value)import Data.Thyme.Clock as Cimport Data.Thyme.Time as Cimport qualified Data.Text as Timport Data.Aeson ( Value )import Data.Thyme.Clock as Cimport Data.Thyme.Time as Cimport qualified Data.Text as T - replacement in lib/Aftok/Payments/Types.hs at line 22
import qualified Network.Bippy.Proto as Pimport Network.Bippy.Types (expiryTime, getExpires,getPaymentDetails, Satoshi(..))import Network.Haskoin.Address.Base58 (decodeBase58Check)import qualified Network.Bippy.Proto as Pimport Network.Bippy.Types ( expiryTime, getExpires, getPaymentDetails, Satoshi(..))import Network.Haskoin.Address.Base58 ( decodeBase58Check ) - replacement in lib/Aftok/Payments/Types.hs at line 30
import Aftok.Billables (Billable, Subscription, SubscriptionId)import Aftok.Billables ( Billable, Subscription, SubscriptionId) - replacement in lib/Aftok/Payments/Types.hs at line 72
isExpired :: forall s. C.UTCTime -> PaymentRequest' s -> BoolisExpired :: forall s . C.UTCTime -> PaymentRequest' s -> Bool - replacement in lib/Aftok/Payments/Types.hs at line 75[2.3782]→[3.2510:2570](∅→∅),[3.7223]→[3.2510:2570](∅→∅),[3.2570]→[3.7284:7313](∅→∅),[3.7284]→[3.7284:7313](∅→∅),[3.7313]→[2.3783:3880](∅→∅)
-- using error here is reasonable since it would indicate-- a serialization problemin either (error . T.pack) (check . getExpires) $ getPaymentDetails (view paymentRequest req)-- using error here is reasonable since it would indicate-- a serialization problemin either (error . T.pack) (check . getExpires)$ getPaymentDetails (view paymentRequest req) - replacement in lib/Aftok/Payments/Types.hs at line 81
parsePaymentKey bs = (PaymentKey . decodeUtf8) <$> decodeBase58Check (decodeUtf8 bs)parsePaymentKey bs =(PaymentKey . decodeUtf8) <$> decodeBase58Check (decodeUtf8 bs) - replacement in lib/Aftok/Project.hs at line 7
import Control.Lens (makeLenses, makePrisms)import Crypto.Random.Types (MonadRandom, getRandomBytes)import Control.Lens ( makeLenses, makePrisms)import Crypto.Random.Types ( MonadRandom, getRandomBytes) - replacement in lib/Aftok/Project.hs at line 14[3.6469]→[2.3887:3937](∅→∅),[2.3937]→[3.1198:1298](∅→∅),[3.6469]→[3.1198:1298](∅→∅),[3.1198]→[3.1198:1298](∅→∅)
import qualified Data.ByteString as BSimport Data.ByteString.Base64.URL as B64import Data.Thyme.Clock as Cimport qualified Data.ByteString as BSimport Data.ByteString.Base64.URL as B64import Data.Thyme.Clock as C - replacement in lib/Aftok/TimeLog/Serialization.hs at line 6
) where)where - replacement in lib/Aftok/TimeLog/Serialization.hs at line 10
import Control.Applicative ((<*>))import Control.Applicative ( (<*>) ) - replacement in lib/Aftok/TimeLog/Serialization.hs at line 12
import Data.Aeson (Value(..), (.=), (.:), object)import Data.Aeson.Types (Parser)import Data.Functor ((<$>))import Data.Text (unpack)import Data.Aeson ( Value(..), (.=), (.:), object)import Data.Aeson.Types ( Parser )import Data.Functor ( (<$>) )import Data.Text ( unpack ) - replacement in lib/Aftok/TimeLog/Serialization.hs at line 21
import Aftok.Typesimport Aftok.Types - replacement in lib/Aftok/TimeLog/Serialization.hs at line 25
LinearDepreciation (Months up) (Months dp) ->object [ "type" .= ("LinearDepreciation" :: Text), "arguments" .= object [ "undep" .= up, "dep" .= dp]]LinearDepreciation (Months up) (Months dp) -> object[ "type" .= ("LinearDepreciation" :: Text), "arguments" .= object ["undep" .= up, "dep" .= dp]] - replacement in lib/Aftok/TimeLog/Serialization.hs at line 33
t <- v .: "type" :: Parser Textt <- v .: "type" :: Parser Text - replacement in lib/Aftok/TimeLog/Serialization.hs at line 42
_ ->fail $ "Cannot interpret non-object value as a depreciation function."_ -> fail $ "Cannot interpret non-object value as a depreciation function." - replacement in lib/Aftok/Types.hs at line 6
import Control.Lens (makeLenses, makePrisms)import Data.Maybe (Maybe)import Data.Eq (Eq)import Data.Functor (Functor)import Data.Ord (Ord)import Data.Text (Text)import Data.UUID (UUID)import Prelude (Integer)import Text.Show (Show)import Control.Lens ( makeLenses, makePrisms)import Data.Maybe ( Maybe )import Data.Eq ( Eq )import Data.Functor ( Functor )import Data.Ord ( Ord )import Data.Text ( Text )import Data.UUID ( UUID )import Prelude ( Integer )import Text.Show ( Show ) - replacement in lib/Aftok/Types.hs at line 50
creditToName (CreditToUser _) = "credit_to_user"creditToName (CreditToProject _) = "credit_to_project"creditToName (CreditToUser _) = "credit_to_user"creditToName (CreditToProject _) = "credit_to_project" - replacement in lib/Aftok/Util/Http.hs at line 6
import Data.ByteString (split)import qualified Data.ByteString.Base64 as B64import Data.ByteString ( split )import qualified Data.ByteString.Base64 as B64 - replacement in lib/Aftok/Util/Http.hs at line 13
let isBase64Char w = (w >= 47 && w <= 57 ) ||(w >= 64 && w <= 90 ) ||(w >= 97 && w <= 122) ||(w == 43 || w == 61 )let isBase64Char w =(w >= 47 && w <= 57)|| (w >= 64 && w <= 90)|| (w >= 97 && w <= 122)|| (w == 43 || w == 61) - replacement in lib/Aftok/Util/Http.hs at line 22
_ -> fail "Could not unpack auth header into username and password components"_ ->fail "Could not unpack auth header into username and password components" - replacement in lib/Aftok/Util.hs at line 8
import Control.Error.Util (maybeT)import Control.Error.Util ( maybeT ) - replacement in lib/Aftok/Util.hs at line 10
import Control.Monad.Trans.Maybe (MaybeT)import Control.Monad.Trans.Maybe ( MaybeT ) - replacement in lib/Aftok/Util.hs at line 13
import Data.Map.Strict as Mimport Data.Map.Strict as M - replacement in lib/Aftok/Util.hs at line 20
interpret :: Monad m => (forall x. f x -> m x) -> Program f a -> m ainterpret :: Monad m => (forall x . f x -> m x) -> Program f a -> m a - replacement in lib/Aftok/Util.hs at line 22
let eval (Coyoneda cf cm) = nt cm >>= cfin iterM eval (runProgram p)let eval (Coyoneda cf cm) = nt cm >>= cf in iterM eval (runProgram p) - replacement in server/Aftok/QConfig.hs at line 7
import Control.Lens (makeLenses, (^.))import Control.Lens ( makeLenses, (^.)) - replacement in server/Aftok/QConfig.hs at line 14[2.4120]→[3.32480:32544](∅→∅),[3.25085]→[3.32480:32544](∅→∅),[3.6698]→[3.32480:32544](∅→∅),[3.32544]→[2.4121:4237](∅→∅)
import System.Environment (getEnvironment)import Filesystem.Path.CurrentOS (fromText, encodeString)import qualified Filesystem.Path.CurrentOS as Pimport System.Environment ( getEnvironment )import Filesystem.Path.CurrentOS ( fromText, encodeString)import qualified Filesystem.Path.CurrentOS as P - replacement in server/Aftok/QConfig.hs at line 48[3.7411]→[3.5402:5459](∅→∅),[3.5402]→[3.5402:5459](∅→∅),[3.5459]→[3.7412:7458](∅→∅),[3.7458]→[3.32904:32957](∅→∅),[3.32957]→[3.7459:7502](∅→∅),[3.5544]→[3.7459:7502](∅→∅),[3.7502]→[3.5588:5653](∅→∅),[3.5588]→[3.5588:5653](∅→∅),[3.5653]→[3.539:572](∅→∅),[3.572]→[3.204:266](∅→∅),[3.266]→[3.32958:33148](∅→∅)
QConfig <$> C.lookupDefault "localhost" cfg "hostname"<*> C.lookupDefault 8000 cfg "port"<*> (fromText <$> C.require cfg "siteKey")<*> C.lookup cfg "cookieTimeout"<*> maybe (mkPGSConfig $ C.subconfig "db" cfg) pure pc<*> readSmtpConfig cfg<*> (readBillingConfig $ C.subconfig "billing" cfg)<*> (fromText <$> C.lookupDefault "/opt/aftok/server/templates/" cfg "templatePath")<*> (fromText <$> C.lookupDefault "/opt/aftok/server/static/" cfg "staticAssetPath")QConfig<$> C.lookupDefault "localhost" cfg "hostname"<*> C.lookupDefault 8000 cfg "port"<*> (fromText <$> C.require cfg "siteKey")<*> C.lookup cfg "cookieTimeout"<*> maybe (mkPGSConfig $ C.subconfig "db" cfg) pure pc<*> readSmtpConfig cfg<*> (readBillingConfig $ C.subconfig "billing" cfg)<*> (fromText <$> C.lookupDefault "/opt/aftok/server/templates/"cfg"templatePath")<*> (fromText <$> C.lookupDefault "/opt/aftok/server/static/"cfg"staticAssetPath") - replacement in server/Aftok/QConfig.hs at line 66
baseSnapConfig qc =SC.setHostname (qc ^. hostname) .SC.setPort (qc ^. port)baseSnapConfig qc = SC.setHostname (qc ^. hostname) . SC.setPort (qc ^. port) - replacement in server/Aftok/Snaplet/Auctions.hs at line 7
) where)where - replacement in server/Aftok/Snaplet/Auctions.hs at line 12
import Control.Monad.Trans.Maybe (mapMaybeT)import Control.Monad.Trans.Maybe ( mapMaybeT ) - replacement in server/Aftok/Snaplet/Auctions.hs at line 16
import Data.Hourglass.Types (Seconds (..))import Data.Thyme.Clock as Cimport Data.Hourglass.Types ( Seconds(..) )import Data.Thyme.Clock as C - replacement in server/Aftok/Snaplet/Auctions.hs at line 19
import Snap.Snaplet as Simport Snap.Snaplet as S - replacement in server/Aftok/Snaplet/Auctions.hs at line 21
import Aftok.Types (UserId)import Aftok.Auction (Auction (..), AuctionId, Bid (..), BidId)import Aftok.Database (createAuction, createBid, findAuction)import Aftok.Types ( UserId )import Aftok.Auction ( Auction(..), AuctionId, Bid(..), BidId)import Aftok.Database ( createAuction, createBid, findAuction) - replacement in server/Aftok/Snaplet/Auctions.hs at line 32
import Aftok.Util (fromMaybeT)import Aftok.Util ( fromMaybeT ) - replacement in server/Aftok/Snaplet/Auctions.hs at line 36
import Network.Bippy.Types (Satoshi(..))import Network.Bippy.Types ( Satoshi(..) ) - replacement in server/Aftok/Snaplet/Auctions.hs at line 42
p o = CA <$> o .: "raiseAmount"<*> o .: "auctionStart"<*> o .: "auctionEnd"p o = CA <$> o .: "raiseAmount" <*> o .: "auctionStart" <*> o .: "auctionEnd" - replacement in server/Aftok/Snaplet/Auctions.hs at line 44
bidCreateParser :: UserId -> C.UTCTime-> Value -> Parser BidbidCreateParser :: UserId -> C.UTCTime -> Value -> Parser Bid - replacement in server/Aftok/Snaplet/Auctions.hs at line 46
p o = Bid uid <$> (Seconds <$> o .: "bidSeconds")<*> (Satoshi <$> o .: "bidAmount")<*> pure tp o =Bid uid<$> (Seconds <$> o .: "bidSeconds")<*> (Satoshi <$> o .: "bidAmount")<*> pure t - replacement in server/Aftok/Snaplet/Auctions.hs at line 54
uid <- requireUserIdpid <- requireProjectIduid <- requireUserIdpid <- requireProjectId - replacement in server/Aftok/Snaplet/Auctions.hs at line 57
req <- either (snapError 400 . show) pure $ parseEither auctionCreateParser requestBodyreq <- either (snapError 400 . show) pure$ parseEither auctionCreateParser requestBody - replacement in server/Aftok/Snaplet/Auctions.hs at line 60
snapEval . createAuction $Auction pid uid t (Satoshi . raiseAmount $ req) (auctionStart req) (auctionEnd req)snapEval . createAuction $ Auction piduidt(Satoshi . raiseAmount $ req)(auctionStart req)(auctionEnd req) - replacement in server/Aftok/Snaplet/Auctions.hs at line 71[3.1105]→[3.33250:33263](∅→∅),[3.33263]→[2.4618:4680](∅→∅),[2.4680]→[3.33326:33408](∅→∅),[3.33326]→[3.33326:33408](∅→∅)
fromMaybeT(snapError 404 $ "Auction not found for id " <> show aid)(mapMaybeT snapEval $ findAuction aid uid) -- this will verify auction accessfromMaybeT (snapError 404 $ "Auction not found for id " <> show aid)(mapMaybeT snapEval $ findAuction aid uid) -- this will verify auction access - replacement in server/Aftok/Snaplet/Auctions.hs at line 76
uid <- requireUserIdaid <- requireAuctionIdtimestamp <- liftIO C.getCurrentTimeuid <- requireUserIdaid <- requireAuctionIdtimestamp <- liftIO C.getCurrentTime - replacement in server/Aftok/Snaplet/Auctions.hs at line 80
bid <- either (snapError 400 . show) pure $ parseEither (bidCreateParser uid timestamp) requestBodybid <- either (snapError 400 . show) pure$ parseEither (bidCreateParser uid timestamp) requestBody - replacement in server/Aftok/Snaplet/Auth.hs at line 6
import Control.Error.Util (maybeT)import Control.Monad.Trans.Maybe (mapMaybeT)import Data.Attoparsec.ByteString (parseOnly)import Control.Error.Util ( maybeT )import Control.Monad.Trans.Maybe ( mapMaybeT )import Data.Attoparsec.ByteString ( parseOnly ) - replacement in server/Aftok/Snaplet/Auth.hs at line 13
import Aftok.Util.Http (authHeaderParser)import Aftok.Util.Http ( authHeaderParser ) - replacement in server/Aftok/Snaplet/Auth.hs at line 16
import Snap.Snaplet as Simport qualified Snap.Snaplet.Auth as AUimport Snap.Snaplet as Simport qualified Snap.Snaplet.Auth as AU - replacement in server/Aftok/Snaplet/Auth.hs at line 21
req <- getRequestreq <- getRequest - replacement in server/Aftok/Snaplet/Auth.hs at line 23
(uname, pwd) <- either (throwDenied . AU.AuthError) pure $ parseOnly authHeaderParser rawHeaderauthResult <- with auth $ AU.loginByUsername uname (AU.ClearText pwd) False(uname, pwd) <- either (throwDenied . AU.AuthError) pure$ parseOnly authHeaderParser rawHeaderauthResult <- with auth $ AU.loginByUsername uname (AU.ClearText pwd) False - replacement in server/Aftok/Snaplet/Auth.hs at line 43[3.2616]→[3.8513:8575](∅→∅),[3.8575]→[3.2268:2340](∅→∅),[3.2679]→[3.2268:2340](∅→∅),[3.2340]→[3.2754:2785](∅→∅),[3.2754]→[3.2754:2785](∅→∅)
modifyResponse $ (setResponseStatus 401 "Unauthorized") .(setHeader "WWW-Authenticate" "Basic realm=aftok")getResponse >>= finishWithmodifyResponse$ (setResponseStatus 401 "Unauthorized"). (setHeader "WWW-Authenticate" "Basic realm=aftok")getResponse >>= finishWith - replacement in server/Aftok/Snaplet/Auth.hs at line 50[3.2863]→[3.2863:2922](∅→∅),[3.2922]→[2.4787:4837](∅→∅),[2.4837]→[3.2973:3004](∅→∅),[3.2973]→[3.2973:3004](∅→∅)
modifyResponse $ setResponseStatus 403 "Access Denied"writeText $ "Access Denied: " <> show failuregetResponse >>= finishWithmodifyResponse $ setResponseStatus 403 "Access Denied"writeText $ "Access Denied: " <> show failuregetResponse >>= finishWith - replacement in server/Aftok/Snaplet/Billing.hs at line 7
) where)where - replacement in server/Aftok/Snaplet/Billing.hs at line 12
import Control.Lens ((^.))import Control.Lens ( (^.) ) - replacement in server/Aftok/Snaplet/Billing.hs at line 15
import Data.Thyme.Clock as Cimport Data.Thyme.Time.Core (toThyme)import Data.Thyme.Clock as Cimport Data.Thyme.Time.Core ( toThyme ) - replacement in server/Aftok/Snaplet/Billing.hs at line 18
import Snap.Snaplet as Simport Snap.Snaplet as S - replacement in server/Aftok/Snaplet/Billing.hs at line 20
import Aftok.Types (UserId)import Aftok.Types ( UserId ) - replacement in server/Aftok/Snaplet/Billing.hs at line 22
import Network.Bippy.Types (Satoshi(..))import Network.Bippy.Types ( Satoshi(..) ) - replacement in server/Aftok/Snaplet/Billing.hs at line 25
import Aftok.Database (createBillable, withProjectAuth, liftdb, DBOp(..))import Aftok.Database ( createBillable, withProjectAuth, liftdb, DBOp(..)) - replacement in server/Aftok/Snaplet/Billing.hs at line 37
Billable <$> pure pid<*> pure uid<*> o .: "name"<*> o .: "description"<*> (parseRecurrence' =<< o .: "recurrence")<*> (Satoshi <$> o .: "amount")<*> o .: "gracePeriod"<*> (fmap toThyme <$> o .: "requestExpiryPeriod")<*> o .:? "paymentRequestEmailTemplate"<*> o .:? "paymentRequestMemoTemplate"Billable<$> pure pid<*> pure uid<*> o.: "name"<*> o.: "description"<*> (parseRecurrence' =<< o .: "recurrence")<*> (Satoshi <$> o .: "amount")<*> o.: "gracePeriod"<*> (fmap toThyme <$> o .: "requestExpiryPeriod")<*> o.:? "paymentRequestEmailTemplate"<*> o.:? "paymentRequestMemoTemplate" - replacement in server/Aftok/Snaplet/Billing.hs at line 58
uid <- requireUserIdpid <- requireProjectIduid <- requireUserIdpid <- requireProjectId - replacement in server/Aftok/Snaplet/Billing.hs at line 61
b <- either (snapError 400 . show) pure $ parseEither (parseCreateBillable uid pid) requestBodyb <- either (snapError 400 . show) pure$ parseEither (parseCreateBillable uid pid) requestBody - replacement in server/Aftok/Snaplet/Billing.hs at line 75
t <- liftIO C.getCurrentTimet <- liftIO C.getCurrentTime - replacement in server/Aftok/Snaplet/Payments.hs at line 7
) where)where - replacement in server/Aftok/Snaplet/Payments.hs at line 12
import Control.Lens (view, _1, _2, _Right, _Left, preview, (&), (.~), (^.))import Control.Monad.Trans.Maybe (mapMaybeT)import Control.Exception (try)import Control.Lens ( view, _1, _2, _Right, _Left, preview, (&), (.~), (^.))import Control.Monad.Trans.Maybe ( mapMaybeT )import Control.Exception ( try ) - replacement in server/Aftok/Snaplet/Payments.hs at line 25[3.1383]→[3.3559:3707](∅→∅),[3.36053]→[3.3559:3707](∅→∅),[3.3559]→[3.3559:3707](∅→∅),[3.3707]→[2.4988:5031](∅→∅),[2.5031]→[3.3707:3750](∅→∅),[3.3707]→[3.3707:3750](∅→∅)
import Data.ProtocolBuffers (decodeMessage)import Data.Serialize.Get (runGetLazy)import Data.Thyme.Clock as Cimport qualified Data.Text.Encoding as Timport qualified Network.Bippy.Proto as Pimport Data.ProtocolBuffers ( decodeMessage )import Data.Serialize.Get ( runGetLazy )import Data.Thyme.Clock as Cimport qualified Data.Text.Encoding as Timport qualified Network.Bippy.Proto as P - replacement in server/Aftok/Snaplet/Payments.hs at line 31
import Network.HTTP.Client (defaultManagerSettings, managerResponseTimeout, responseTimeoutMicro, HttpException)import Network.Wreq (asValue, responseBody, defaults, manager, getWith)import OpenSSL.Session (context)import Network.HTTP.Client ( defaultManagerSettings, managerResponseTimeout, responseTimeoutMicro, HttpException)import Network.Wreq ( asValue, responseBody, defaults, manager, getWith)import OpenSSL.Session ( context ) - replacement in server/Aftok/Snaplet/Payments.hs at line 44
import Snap.Core (readRequestBody, logError)import Snap.Snaplet as Simport Snap.Core ( readRequestBody, logError)import Snap.Snaplet as S - replacement in server/Aftok/Snaplet/Payments.hs at line 49
import Aftok.Config as ACimport Aftok.Config as AC - replacement in server/Aftok/Snaplet/Payments.hs at line 53
import Aftok.Util (fromMaybeT)import Aftok.Util ( fromMaybeT ) - replacement in server/Aftok/Snaplet/Payments.hs at line 72[3.4091]→[3.4091:4144](∅→∅),[3.4144]→[2.5065:5151](∅→∅),[2.5151]→[3.4231:4331](∅→∅),[3.4231]→[3.4231:4331](∅→∅)
preq <- getPaymentRequestHandler'pmnt <- either(\msg -> snapError 400 $ "Could not decode payment response: " <> show msg)pure(runGetLazy decodeMessage requestBody)now <- liftIO $ C.getCurrentTimepreq <- getPaymentRequestHandler'pmnt <- either(\msg -> snapError 400 $ "Could not decode payment response: " <> show msg)pure(runGetLazy decodeMessage requestBody)now <- liftIO $ C.getCurrentTime - replacement in server/Aftok/Snaplet/Payments.hs at line 79
let opts = defaults & manager .~ Left (opensslManagerSettings context)& manager .~ Left (defaultManagerSettings { managerResponseTimeout = responseTimeoutMicro 10000 } )letopts =defaults& manager.~ Left (opensslManagerSettings context)& manager.~ Left(defaultManagerSettings{ managerResponseTimeout = responseTimeoutMicro 10000}) - replacement in server/Aftok/Snaplet/Payments.hs at line 91
exchResp <- liftIO . try @HttpException $ asValue =<< (withOpenSSL $ getWith opts (cfg ^. exchangeRateServiceURI))exchResp <-liftIO. try @HttpException$ asValue=<< (withOpenSSL $ getWith opts (cfg ^. exchangeRateServiceURI)) - replacement in server/Aftok/Snaplet/Payments.hs at line 97
let newPayment = Payment (view _1 preq) pmnt now (preview (_Right . responseBody) exchResp)let newPayment = Payment (view _1 preq)pmntnow(preview (_Right . responseBody) exchResp) - replacement in server/Aftok/Snaplet/Payments.hs at line 103
getPaymentRequestHandler' :: S.Handler App App (PaymentRequestId, PaymentRequest)getPaymentRequestHandler':: S.Handler App App (PaymentRequestId, PaymentRequest) - replacement in server/Aftok/Snaplet/Payments.hs at line 107
pkey <- maybe(snapError 400 $ "parameter paymentRequestKey is formatted incorrectly.") pure(parsePaymentKey pkBytes)pkey <- maybe(snapError 400 $ "parameter paymentRequestKey is formatted incorrectly.")pure(parsePaymentKey pkBytes) - replacement in server/Aftok/Snaplet/Payments.hs at line 112
(snapError 404 $ "Outstanding payment request not found for key " <> (view _PaymentKey pkey))( snapError 404$ "Outstanding payment request not found for key "<> (view _PaymentKey pkey)) - replacement in server/Aftok/Snaplet/Projects.hs at line 9
) where)where - replacement in server/Aftok/Snaplet/Projects.hs at line 14[3.2104]→[3.36573:36639](∅→∅),[3.36639]→[3.2104:2263](∅→∅),[3.2104]→[3.2104:2263](∅→∅),[3.2263]→[2.5346:5454](∅→∅)
import Control.Monad.Trans.Maybe (mapMaybeT, runMaybeT)import Data.Aeson as Aimport Data.Attoparsec.ByteString (takeByteString)import Data.Thyme.Clock as Cimport Filesystem.Path.CurrentOS (encodeString)import qualified Filesystem.Path.CurrentOS as Fimport Control.Monad.Trans.Maybe ( mapMaybeT, runMaybeT)import Data.Aeson as Aimport Data.Attoparsec.ByteString ( takeByteString )import Data.Thyme.Clock as Cimport Filesystem.Path.CurrentOS ( encodeString )import qualified Filesystem.Path.CurrentOS as F - replacement in server/Aftok/Snaplet/Projects.hs at line 23
import Network.Mail.SMTP as SMTPimport Network.Mail.SMTP as SMTP - replacement in server/Aftok/Snaplet/Projects.hs at line 30
import Aftok.QConfig as QCimport Aftok.QConfig as QC - replacement in server/Aftok/Snaplet/Projects.hs at line 33
import Aftok.TimeLog.Serialization (depfFromJSON)import Aftok.Util (fromMaybeT)import Aftok.TimeLog.Serialization ( depfFromJSON )import Aftok.Util ( fromMaybeT ) - replacement in server/Aftok/Snaplet/Projects.hs at line 37
import Snap.Snaplet as Simport Snap.Snaplet as S - replacement in server/Aftok/Snaplet/Projects.hs at line 43
CP <$> v .: "projectName"<*> (depfFromJSON =<< v .: "depf")CP <$> v .: "projectName" <*> (depfFromJSON =<< v .: "depf") - replacement in server/Aftok/Snaplet/Projects.hs at line 48
uid <- requireUserIduid <- requireUserId - replacement in server/Aftok/Snaplet/Projects.hs at line 50[3.3231]→[2.5455:5527](∅→∅),[3.446]→[3.8840:8871](∅→∅),[2.5527]→[3.8840:8871](∅→∅),[3.3320]→[3.8840:8871](∅→∅)
cp <- either (snapError 400 . show) pure $ A.eitherDecode requestBodyt <- liftIO C.getCurrentTimecp <- either (snapError 400 . show) pure $ A.eitherDecode requestBodyt <- liftIO C.getCurrentTime - replacement in server/Aftok/Snaplet/Projects.hs at line 63[3.12379]→[3.36820:36833](∅→∅),[3.36833]→[2.5528:5590](∅→∅),[2.5590]→[3.36896:36947](∅→∅),[3.36896]→[3.36896:36947](∅→∅)
fromMaybeT(snapError 404 $ "Project not found for id " <> show pid)(mapMaybeT snapEval $ findUserProject uid pid)fromMaybeT (snapError 404 $ "Project not found for id " <> show pid)(mapMaybeT snapEval $ findUserProject uid pid) - replacement in server/Aftok/Snaplet/Projects.hs at line 68
uid <- requireUserIdpid <- requireProjectIduid <- requireUserIdpid <- requireProjectId - replacement in server/Aftok/Snaplet/Projects.hs at line 71[3.9145]→[3.9145:9176](∅→∅),[3.9176]→[3.2655:2697](∅→∅),[3.2697]→[3.36948:37039](∅→∅),[3.37039]→[3.9278:9326](∅→∅),[3.9278]→[3.9278:9326](∅→∅),[3.9326]→[3.898:988](∅→∅)
t <- liftIO C.getCurrentTime(Just u, Just p, invCode) <- snapEval $(,,) <$> (runMaybeT $ findUser uid)<*> (runMaybeT $ findUserProject uid pid)<*> createInvitation pid uid toEmail tliftIO $ sendProjectInviteEmail cfg (p ^. projectName) (u ^. userEmail) toEmail invCodet <- liftIO C.getCurrentTime(Just u, Just p, invCode) <-snapEval$ (,,)<$> (runMaybeT $ findUser uid)<*> (runMaybeT $ findUserProject uid pid)<*> createInvitation pid uid toEmail tliftIO $ sendProjectInviteEmail cfg(p ^. projectName)(u ^. userEmail)toEmailinvCode - replacement in server/Aftok/Snaplet/Projects.hs at line 85[3.990]→[3.990:1024](∅→∅),[3.1024]→[3.2698:2736](∅→∅),[3.2736]→[3.1063:1199](∅→∅),[3.1063]→[3.1063:1199](∅→∅),[3.1199]→[3.2737:2778](∅→∅),[3.2778]→[3.1241:1273](∅→∅),[3.1241]→[3.1241:1273](∅→∅)
sendProjectInviteEmail :: QConfig-> ProjectName-> Email -- Inviting user's email address-> Email -- Invitee's email address-> InvitationCode-> IO ()sendProjectInviteEmail:: QConfig-> ProjectName-> Email -- Inviting user's email address-> Email -- Invitee's email address-> InvitationCode-> IO () - replacement in server/Aftok/Snaplet/Projects.hs at line 93[3.2837]→[3.26119:26163](∅→∅),[3.26163]→[3.37081:37173](∅→∅),[3.37081]→[3.37081:37173](∅→∅),[3.37173]→[3.26164:26249](∅→∅),[3.26249]→[3.37174:37209](∅→∅),[3.2920]→[3.37174:37209](∅→∅)
let SmtpConfig{..} = cfg ^. QC.smtpConfigmailer = maybe (sendMailWithLogin _smtpHost) (sendMailWithLogin' _smtpHost) _smtpPortin buildProjectInviteEmail (cfg ^. templatePath) pn fromEmail toEmail invCode >>=(mailer _smtpUser _smtpPass)let SmtpConfig {..} = cfg ^. QC.smtpConfigmailer = maybe (sendMailWithLogin _smtpHost)(sendMailWithLogin' _smtpHost)_smtpPortin buildProjectInviteEmail (cfg ^. templatePath) pn fromEmail toEmail invCode>>= (mailer _smtpUser _smtpPass) - replacement in server/Aftok/Snaplet/Projects.hs at line 101[3.9688]→[2.5591:5629](∅→∅),[2.5629]→[3.2969:3008](∅→∅),[3.37246]→[3.2969:3008](∅→∅),[3.2969]→[3.2969:3008](∅→∅),[3.3008]→[3.1666:1804](∅→∅),[3.1666]→[3.1666:1804](∅→∅),[3.1804]→[3.3009:3051](∅→∅),[3.3051]→[3.1847:1882](∅→∅),[3.1847]→[3.1847:1882](∅→∅)
buildProjectInviteEmail :: F.FilePath-> ProjectName-> Email -- Inviting user's email address-> Email -- Invitee's email address-> InvitationCode-> IO MailbuildProjectInviteEmail:: F.FilePath-> ProjectName-> Email -- Inviting user's email address-> Email -- Invitee's email address-> InvitationCode-> IO Mail - replacement in server/Aftok/Snaplet/Projects.hs at line 113
let setAttrs = setAttribute "from_email" (fromEmail ^. _Email) .setAttribute "project_name" pn .setAttribute "to_email" (toEmail ^. _Email) .setAttribute "inv_code" (renderInvCode invCode)let setAttrs =setAttribute "from_email" (fromEmail ^. _Email). setAttribute "project_name" pn. setAttribute "to_email" (toEmail ^. _Email). setAttribute "inv_code" (renderInvCode invCode) - replacement in server/Aftok/Snaplet/Projects.hs at line 120
subject = "Welcome to the "<>pn<>" Aftok!"subject = "Welcome to the " <> pn <> " Aftok!" - replacement in server/Aftok/Snaplet/Users.hs at line 7
) where)where - replacement in server/Aftok/Snaplet/Users.hs at line 13[3.8667]→[3.8667:8708](∅→∅),[3.8708]→[2.5633:5674](∅→∅),[2.5674]→[3.8708:8790](∅→∅),[3.8708]→[3.8708:8790](∅→∅)
import Data.Aeson as Aimport qualified Data.Map.Strict as Mimport Data.Text as Timport Data.Thyme.Clock as Cimport Data.Aeson as Aimport qualified Data.Map.Strict as Mimport Data.Text as Timport Data.Thyme.Clock as C - replacement in server/Aftok/Snaplet/Users.hs at line 18
import Network.Haskoin.Address (stringToAddr)import Network.Haskoin.Address ( stringToAddr ) - replacement in server/Aftok/Snaplet/Users.hs at line 21
import Aftok.Currency.Bitcoin (NetworkId(..), toNetwork)import Aftok.Currency.Bitcoin ( NetworkId(..), toNetwork) - replacement in server/Aftok/Snaplet/Users.hs at line 30
import Snap.Snaplet as Simport qualified Snap.Snaplet.Auth as AUimport Snap.Snaplet as Simport qualified Snap.Snaplet.Auth as AU - replacement in server/Aftok/Snaplet/Users.hs at line 42[3.9104]→[3.10349:10414](∅→∅),[3.10414]→[3.34956:35002](∅→∅),[3.35002]→[3.10478:10540](∅→∅),[3.10478]→[3.10478:10540](∅→∅)
let parseUser = User <$> (UserName <$> v .: "username")<*> (v .: "btcAddr")<*> (Email <$> v .: "email")let parseUser =User<$> (UserName <$> v .: "username")<*> (v .: "btcAddr")<*> (Email <$> v .: "email") - edit in server/Aftok/Snaplet/Users.hs at line 52
in CU<$> parseUser<*> (fromString <$> v .: "password")<*> (parseInvitationCodes =<< v .: "invitation_codes") - edit in server/Aftok/Snaplet/Users.hs at line 57
in CU <$> parseUser<*> (fromString <$> v .: "password")<*> (parseInvitationCodes =<< v .: "invitation_codes") - replacement in server/Aftok/Snaplet/Users.hs at line 63[3.3592]→[3.751:843](∅→∅),[3.11064]→[3.751:843](∅→∅),[3.751]→[3.751:843](∅→∅),[3.843]→[3.11065:11096](∅→∅)
userData <- maybe (snapError 400 "Could not parse user data") pure $ A.decode requestBodyt <- liftIO C.getCurrentTimeuserData <- maybe (snapError 400 "Could not parse user data") pure$ A.decode requestBodyt <- liftIO C.getCurrentTime - replacement in server/Aftok/Snaplet/Users.hs at line 67[3.35029]→[3.35029:35115](∅→∅),[3.11096]→[3.3593:3691](∅→∅),[3.35115]→[3.3593:3691](∅→∅),[3.843]→[3.3593:3691](∅→∅),[3.3691]→[3.11097:11131](∅→∅),[3.11131]→[3.35116:35202](∅→∅),[3.35202]→[3.501:583](∅→∅),[3.11180]→[3.501:583](∅→∅),[3.583]→[3.11270:11292](∅→∅),[3.11270]→[3.11270:11292](∅→∅)
let addr = stringToAddr (toNetwork nmode BTC) =<< (userData ^. cuser . userAddress)let createSUser = AU.createUser (userData ^. (cuser.username._UserName)) (userData ^. password)createQUser = snapEval $ douserId <- createUser ((userData ^. cuser) & userAddress .~ ((BTC,) <$> addr))void $ traverse (acceptInvitation userId t) (userData ^. invitationCodes)return userIdlet addr =stringToAddr (toNetwork nmode BTC) =<< (userData ^. cuser . userAddress)letcreateSUser = AU.createUser (userData ^. (cuser . username . _UserName))(userData ^. password)createQUser = snapEval $ douserId <- createUser((userData ^. cuser) & userAddress .~ ((BTC, ) <$> addr))void $ traverse (acceptInvitation userId t) (userData ^. invitationCodes)return userId - replacement in server/Aftok/Snaplet/Users.hs at line 82[3.660]→[3.660:714](∅→∅),[3.714]→[3.9286:9308](∅→∅),[3.9308]→[3.737:859](∅→∅),[3.737]→[3.737:859](∅→∅),[3.859]→[2.5675:5707](∅→∅)
uid <- requireUserIdt <- liftIO C.getCurrentTimeparams <- getParamsinvCodes <- maybe(snapError 400 "invCode parameter is required")(pure . traverse (parseInvCode . decodeUtf8))(M.lookup "invCode" params)uid <- requireUserIdt <- liftIO C.getCurrentTimeparams <- getParamsinvCodes <- maybe (snapError 400 "invCode parameter is required")(pure . traverse (parseInvCode . decodeUtf8))(M.lookup "invCode" params) - replacement in server/Aftok/Snaplet/Users.hs at line 89
(\e -> snapError 400 $ "Invitation code was rejected as invalid: " <> T.pack e)(\e ->snapError 400 $ "Invitation code was rejected as invalid: " <> T.pack e) - replacement in server/Aftok/Snaplet/Util.hs at line 5
import Data.ByteString.Char8 as Bimport Data.Thyme.Clock as Cimport Data.ByteString.Char8 as Bimport Data.Thyme.Clock as C - replacement in server/Aftok/Snaplet/Util.hs at line 15
t <- MaybeT . pure . parseISO8601 $ B.unpack bst <- MaybeT . pure . parseISO8601 $ B.unpack bs - replacement in server/Aftok/Snaplet/WorkLog.hs at line 6
import Control.Monad.Trans.Maybe (mapMaybeT)import Control.Monad.Trans.Maybe ( mapMaybeT ) - replacement in server/Aftok/Snaplet/WorkLog.hs at line 8
import qualified Data.Aeson as Aimport qualified Data.Aeson as A - replacement in server/Aftok/Snaplet/WorkLog.hs at line 10[3.9730]→[2.5714:5755](∅→∅),[2.5755]→[3.9730:9812](∅→∅),[3.9730]→[3.9730:9812](∅→∅),[3.9812]→[3.35204:35269](∅→∅)
import qualified Data.Text as Timport Data.Thyme.Clock as Cimport Data.UUID as Uimport Network.Haskoin.Address (Address, stringToAddr)import qualified Data.Text as Timport Data.Thyme.Clock as Cimport Data.UUID as Uimport Network.Haskoin.Address ( Address, stringToAddr) - replacement in server/Aftok/Snaplet/WorkLog.hs at line 17
import Aftok.Currency.Bitcoin (NetworkId(..), toNetwork)import Aftok.Currency.Bitcoin ( NetworkId(..), toNetwork) - replacement in server/Aftok/Snaplet/WorkLog.hs at line 25
import Aftok.Types (CreditTo(..))import Aftok.Util (fromMaybeT)import Aftok.Types ( CreditTo(..) )import Aftok.Util ( fromMaybeT ) - replacement in server/Aftok/Snaplet/WorkLog.hs at line 33
import Snap.Snaplet as Simport Snap.Snaplet as S - replacement in server/Aftok/Snaplet/WorkLog.hs at line 37
uid <- requireUserIdpid <- requireProjectIdnmode <- getNetworkModeuid <- requireUserIdpid <- requireProjectIdnmode <- getNetworkMode - replacement in server/Aftok/Snaplet/WorkLog.hs at line 41[3.283]→[3.283:322](∅→∅),[3.322]→[3.35410:35511](∅→∅),[3.35511]→[2.5756:5849](∅→∅),[2.5849]→[3.35606:35680](∅→∅),[3.35606]→[3.35606:35680](∅→∅)
timestamp <- liftIO C.getCurrentTimecase A.eitherDecode requestBody >>= parseEither (parseLogEntry nmode uid evCtr) ofLeft err ->snapError 400 $ "Unable to parse log entry " <> (show requestBody) <> ": " <> show errRight entry ->snapEval $ createEvent pid uid (entry timestamp)timestamp <- liftIO C.getCurrentTimecaseA.eitherDecode requestBody >>= parseEither (parseLogEntry nmode uid evCtr)ofLeft err ->snapError 400$ "Unable to parse log entry "<> (show requestBody)<> ": "<> show errRight entry -> snapEval $ createEvent pid uid (entry timestamp) - replacement in server/Aftok/Snaplet/WorkLog.hs at line 55
uid <- requireUserIdpid <- requireProjectIduid <- requireUserIdpid <- requireProjectId - replacement in server/Aftok/Snaplet/WorkLog.hs at line 59[3.3427]→[3.5971:6005](∅→∅),[3.4127]→[3.5971:6005](∅→∅),[3.4746]→[3.5971:6005](∅→∅),[3.12656]→[3.5971:6005](∅→∅),[3.35743]→[3.5971:6005](∅→∅),[3.5971]→[3.5971:6005](∅→∅)
addrBytes <- getParam "btcAddr"addrBytes <- getParam "btcAddr" - replacement in server/Aftok/Snaplet/WorkLog.hs at line 61
timestamp <- liftIO C.getCurrentTimetimestamp <- liftIO C.getCurrentTime - replacement in server/Aftok/Snaplet/WorkLog.hs at line 64[3.10164]→[2.5850:5932](∅→∅),[2.5932]→[3.10165:10182](∅→∅),[3.12756]→[3.10165:10182](∅→∅),[3.10182]→[3.1103:1142](∅→∅),[3.1142]→[3.35806:35929](∅→∅)
snapError 400 $ "Unable to parse bitcoin address from " <> (show addrBytes)Just addr ->snapEval . createEvent pid uid $LogEntry (CreditToCurrency (BTC, addr))(evCtr timestamp)(A.decode requestBody)snapError 400$ "Unable to parse bitcoin address from "<> (show addrBytes)Just addr -> snapEval . createEvent pid uid $ LogEntry(CreditToCurrency (BTC, addr))(evCtr timestamp)(A.decode requestBody) - replacement in server/Aftok/Snaplet/WorkLog.hs at line 80
uid <- requireUserIdpid <- requireProjectIduid <- requireUserIdpid <- requireProjectId - replacement in server/Aftok/Snaplet/WorkLog.hs at line 83
ival <- case endpoints of(Just s, Just e) -> pure $ During s e(Nothing, Just e) -> pure $ Before e(Just s, Nothing) -> pure $ After s(Nothing, Nothing) -> snapError 400 "You must at least one of the \"after\" or \"before\" query parameter"ival <- case endpoints of(Just s , Just e ) -> pure $ During s e(Nothing, Just e ) -> pure $ Before e(Just s , Nothing) -> pure $ After s(Nothing, Nothing) -> snapError400"You must at least one of the \"after\" or \"before\" query parameter" - replacement in server/Aftok/Snaplet/WorkLog.hs at line 94
uid <- requireUserIdpid <- requireProjectIduid <- requireUserIdpid <- requireProjectId - replacement in server/Aftok/Snaplet/WorkLog.hs at line 99
widx <- snapEval $ readWorkIndex pid uidwidx <- snapEval $ readWorkIndex pid uid - replacement in server/Aftok/Snaplet/WorkLog.hs at line 105
uid <- requireUserIdnmode <- getNetworkModeuid <- requireUserIdnmode <- getNetworkMode - replacement in server/Aftok/Snaplet/WorkLog.hs at line 108[3.8865]→[3.10252:10344](∅→∅),[3.10344]→[3.8960:9000](∅→∅),[3.8960]→[3.8960:9000](∅→∅),[3.9146]→[3.9146:9195](∅→∅)
eventId <- maybe(snapError 400 "eventId parameter is required")(pure . EventId)(eventIdBytes >>= U.fromASCIIBytes)modTime <- ModTime <$> liftIO C.getCurrentTimeeventId <- maybe (snapError 400 "eventId parameter is required")(pure . EventId)(eventIdBytes >>= U.fromASCIIBytes)modTime <- ModTime <$> liftIO C.getCurrentTime - replacement in server/Aftok/Snaplet/WorkLog.hs at line 113[3.9233]→[3.10345:10354](∅→∅),[3.10354]→[2.5996:6025](∅→∅),[2.6025]→[3.13377:13417](∅→∅),[3.13377]→[3.13377:13417](∅→∅),[3.13417]→[3.36175:36241](∅→∅)
either(snapError 400 . T.pack)(snapEval . amendEvent uid eventId)(parseEither (parseEventAmendment nmode modTime) requestJSON)[3.9233]either (snapError 400 . T.pack)(snapEval . amendEvent uid eventId)(parseEither (parseEventAmendment nmode modTime) requestJSON) - replacement in server/Aftok/Snaplet.hs at line 9
import Control.Monad.Trans.Except (runExceptT)import Control.Monad.Trans.Except ( runExceptT ) - replacement in server/Aftok/Snaplet.hs at line 11
import Data.Attoparsec.ByteString (Parser, parseOnly,takeByteString)import Data.Attoparsec.ByteString ( Parser, parseOnly, takeByteString) - replacement in server/Aftok/Snaplet.hs at line 17
import Aftok.Auction (AuctionId (..))import Aftok.Currency.Bitcoin (NetworkMode(..))import Aftok.Auction ( AuctionId(..) )import Aftok.Currency.Bitcoin ( NetworkMode(..) ) - replacement in server/Aftok/Snaplet.hs at line 21
import Aftok.Types (UserId(..), ProjectId(..))import Aftok.Types ( UserId(..), ProjectId(..)) - replacement in server/Aftok/Snaplet.hs at line 51
:: (MonadSnap m, HasPostgres m, HasNetworkMode m)=> Program DBOp a-> m a:: (MonadSnap m, HasPostgres m, HasNetworkMode m) => Program DBOp a -> m a - replacement in server/Aftok/Snaplet.hs at line 55[2.6097]→[3.11124:11164](∅→∅),[3.11748]→[3.11124:11164](∅→∅),[3.11164]→[3.11789:11872](∅→∅),[3.11789]→[3.11789:11872](∅→∅)
handleDBError (SubjectNotFound) =snapError 404 "The subject of the requested operation could not be found."handleDBError (SubjectNotFound) = snapError404"The subject of the requested operation could not be found." - replacement in server/Aftok/Snaplet.hs at line 62
e <- liftPG $ \conn -> liftIO $ runExceptT (runQDBM nmode conn $ interpret liftdb p)e <- liftPG$ \conn -> liftIO $ runExceptT (runQDBM nmode conn $ interpret liftdb p) - replacement in server/Aftok/Snaplet.hs at line 80
maybe (snapError 400 $ "Parameter "<> show name <>" is required") pure maybeBytesmaybe (snapError 400 $ "Parameter " <> show name <> " is required")puremaybeBytes - replacement in server/Aftok/Snaplet.hs at line 84
parseParam :: MonadSnap m=> Text -- ^ the name of the parameter to be parsed-> Parser a -- ^ parser for the value of the parameter-> m a -- ^ the parsed valueparseParam:: MonadSnap m=> Text -- ^ the name of the parameter to be parsed-> Parser a -- ^ parser for the value of the parameter-> m a -- ^ the parsed value - replacement in server/Aftok/Snaplet.hs at line 92
(const . snapError 400 $ "Value of parameter "<> show name <>" could not be parsed to a valid value.")( const. snapError 400$ "Value of parameter "<> show name<> " could not be parsed to a valid value.") - replacement in server/Aftok/Snaplet.hs at line 101
requireId :: MonadSnap m=> Text -- ^ name of the parameter-> (UUID -> a) -- ^ constructor for the identifier-> m arequireId:: MonadSnap m=> Text -- ^ name of the parameter-> (UUID -> a) -- ^ constructor for the identifier-> m a - replacement in server/Aftok/Snaplet.hs at line 108
maybe (snapError 400 $ "Value of parameter \"" <> name <> "\" is not a valid UUID") pure maybeIdwhereidParser = dobs <- takeByteStringpure $ f <$> fromASCIIBytes bsmaybe(snapError 400 $ "Value of parameter \"" <> name <> "\" is not a valid UUID")puremaybeIdwhereidParser = dobs <- takeByteStringpure $ f <$> fromASCIIBytes bs - replacement in server/Aftok/Snaplet.hs at line 121
maybe (snapError 400 "Could not interpret request body as a nonempty JSON value.") pure requestBodymaybe(snapError 400 "Could not interpret request body as a nonempty JSON value.")purerequestBody - replacement in server/Main.hs at line 5[3.5260]→[3.26367:26398](∅→∅),[3.26398]→[2.6368:6399](∅→∅),[2.6399]→[3.11228:11294](∅→∅),[3.26398]→[3.11228:11294](∅→∅),[3.5260]→[3.11228:11294](∅→∅),[3.37783]→[3.7988:8139](∅→∅),[3.11294]→[3.7988:8139](∅→∅),[3.8139]→[3.37784:37846](∅→∅)
import Control.Lens ((^.), to)import Control.Exception (try)import qualified Data.Aeson as Aimport Data.ProtocolBuffers (encodeMessage)import Data.Serialize.Put (runPutLazy)import Filesystem.Path.CurrentOS (decodeString, encodeString)import Control.Lens ( (^.), to)import Control.Exception ( try )import qualified Data.Aeson as Aimport Data.ProtocolBuffers ( encodeMessage )import Data.Serialize.Put ( runPutLazy )import Filesystem.Path.CurrentOS ( decodeString, encodeString) - replacement in server/Main.hs at line 16
import System.IO.Error (IOError)import System.IO.Error ( IOError ) - replacement in server/Main.hs at line 21
import qualified Aftok.Config as Cimport Aftok.QConfig as Qimport qualified Aftok.Config as Cimport Aftok.QConfig as Q - replacement in server/Main.hs at line 37
import Snap.Util.FileServe (serveDirectory)import Snap.Util.FileServe ( serveDirectory ) - replacement in server/Main.hs at line 42[2.6491]→[3.37887:37960](∅→∅),[3.1730]→[3.37887:37960](∅→∅),[3.1117]→[3.8231:8257](∅→∅),[3.1796]→[3.8231:8257](∅→∅),[3.3302]→[3.8231:8257](∅→∅),[3.37960]→[3.8231:8257](∅→∅),[3.8231]→[3.8231:8257](∅→∅)
cfg <- loadQConfig . decodeString $ fromRight "conf/aftok.cfg" cfgPathsconf <- snapConfig cfgcfg <- loadQConfig . decodeString $ fromRight "conf/aftok.cfg" cfgPathsconf <- snapConfig cfg - replacement in server/Main.hs at line 48
sesss <- nestSnaplet "sessions" sess $initCookieSessionManager (cfg ^. authSiteKey . to encodeString)"quookie"(Just "aftok.com")(cfg ^. cookieTimeout)sesss <- nestSnaplet "sessions" sess $ initCookieSessionManager(cfg ^. authSiteKey . to encodeString)"quookie"(Just "aftok.com")(cfg ^. cookieTimeout) - edit in server/Main.hs at line 55[3.8755]→[3.36850:36851](∅→∅),[3.36851]→[3.26732:26783](∅→∅),[3.26783]→[3.2274:2275](∅→∅),[3.36883]→[3.2274:2275](∅→∅),[3.8755]→[3.2274:2275](∅→∅),[3.2275]→[3.36884:37016](∅→∅),[3.37016]→[3.38212:38421](∅→∅),[3.38212]→[3.38212:38421](∅→∅),[3.1884]→[3.212:213](∅→∅),[3.2548]→[3.212:213](∅→∅),[3.38421]→[3.212:213](∅→∅),[3.1145]→[3.212:213](∅→∅),[3.213]→[3.1885:1972](∅→∅),[3.1972]→[3.38422:38514](∅→∅)
let nmode = cfg ^. billingConfig . C.networkModeloginRoute = method GET requireLogin >> redirect "/home"xhrLoginRoute = void $ method POST requireLoginregisterRoute = void $ method POST registerHandlerinviteRoute = void $ method POST (projectInviteHandler cfg)acceptInviteRoute = void $ method POST acceptInvitationHandlerprojectCreateRoute = serveJSON projectIdJSON $ method POST projectCreateHandlerprojectListRoute = serveJSON (fmap qdbProjectJSON) $ method GET projectListHandler - replacement in server/Main.hs at line 56[3.2398]→[3.2065:2146](∅→∅),[3.2146]→[3.37017:37210](∅→∅),[3.37210]→[3.38515:38516](∅→∅),[3.2492]→[3.38515:38516](∅→∅),[3.38516]→[3.37211:37297](∅→∅)
projectRoute = serveJSON projectJSON $ method GET projectGetHandlerlogEntriesRoute = serveJSON (fmap $ logEntryJSON nmode) $ method GET logEntriesHandlerlogIntervalsRoute = serveJSON (workIndexJSON nmode) $ method GET loggedIntervalsHandlerpayoutsRoute = serveJSON (payoutsJSON nmode) $ method GET payoutsHandlerletnmode = cfg ^. billingConfig . C.networkMode - replacement in server/Main.hs at line 59
logWorkRoute f = serveJSON eventIdJSON $ method POST (logWorkHandler f)logWorkBTCRoute f = serveJSON eventIdJSON $ method POST (logWorkBTCHandler f)amendEventRoute = serveJSON amendmentIdJSON $ method PUT amendEventHandlerloginRoute = method GET requireLogin >> redirect "/home"xhrLoginRoute = void $ method POST requireLoginregisterRoute = void $ method POST registerHandler - replacement in server/Main.hs at line 63
auctionCreateRoute = serveJSON auctionIdJSON $ method POST auctionCreateHandlerauctionRoute = serveJSON auctionJSON $ method GET auctionGetHandlerauctionBidRoute = serveJSON bidIdJSON $ method POST auctionBidHandlerinviteRoute = void $ method POST (projectInviteHandler cfg)acceptInviteRoute = void $ method POST acceptInvitationHandler - replacement in server/Main.hs at line 66
billableCreateRoute = serveJSON billableIdJSON $ method POST billableCreateHandlerbillableListRoute = serveJSON (fmap qdbBillableJSON) $ method GET billableListHandlersubscribeRoute = serveJSON subscriptionIdJSON $ method POST subscribeHandlerprojectCreateRoute =serveJSON projectIdJSON $ method POST projectCreateHandlerprojectListRoute =serveJSON (fmap qdbProjectJSON) $ method GET projectListHandler - replacement in server/Main.hs at line 71
payableRequestsRoute = serveJSON billDetailsJSON $ method GET listPayableRequestsHandlergetPaymentRequestRoute = writeLBS . runPutLazy . encodeMessage =<< method GET getPaymentRequestHandlersubmitPaymentRoute = serveJSON paymentIdJSON $ method POST (paymentResponseHandler $ cfg ^. billingConfig)projectRoute = serveJSON projectJSON $ method GET projectGetHandlerlogEntriesRoute =serveJSON (fmap $ logEntryJSON nmode) $ method GET logEntriesHandlerlogIntervalsRoute =serveJSON (workIndexJSON nmode) $ method GET loggedIntervalsHandler - replacement in server/Main.hs at line 77
addRoutes [ ("static", serveDirectory . encodeString $ cfg ^. staticAssetPath)payoutsRoute = serveJSON (payoutsJSON nmode) $ method GET payoutsHandler - replacement in server/Main.hs at line 79[3.2570]→[3.37383:37482](∅→∅),[3.2719]→[3.265:316](∅→∅),[3.11923]→[3.265:316](∅→∅),[3.37482]→[3.265:316](∅→∅),[3.265]→[3.265:316](∅→∅),[3.316]→[3.1146:1201](∅→∅),[3.2968]→[3.1146:1201](∅→∅)
, ("login", loginRoute), ("login", xhrLoginRoute), ("register", registerRoute), ("accept_invitation", acceptInviteRoute)logWorkRoute f = serveJSON eventIdJSON $ method POST (logWorkHandler f)logWorkBTCRoute f =serveJSON eventIdJSON $ method POST (logWorkBTCHandler f)amendEventRoute = serveJSON amendmentIdJSON $ method PUT amendEventHandler - replacement in server/Main.hs at line 84[3.318]→[3.448:613](∅→∅),[3.613]→[3.761:920](∅→∅),[3.13135]→[3.761:920](∅→∅),[3.690]→[3.3631:3779](∅→∅),[3.1085]→[3.3631:3779](∅→∅),[3.3216]→[3.3631:3779](∅→∅),[3.12004]→[3.3631:3779](∅→∅),[3.3631]→[3.3631:3779](∅→∅),[3.3779]→[3.39612:39811](∅→∅),[3.39811]→[3.13136:13275](∅→∅),[3.3779]→[3.13136:13275](∅→∅),[3.13275]→[3.691:761](∅→∅),[3.761]→[3.39812:39909](∅→∅)
, ("projects/:projectId/logStart/:btcAddr", logWorkBTCRoute StartWork), ("projects/:projectId/logEnd/:btcAddr", logWorkBTCRoute StopWork), ("projects/:projectId/logStart", logWorkRoute StartWork), ("projects/:projectId/logEnd", logWorkRoute StopWork), ("projects/:projectId/logEntries", logEntriesRoute), ("projects/:projectId/intervals", logIntervalsRoute), ("projects/:projectId/auctions", auctionCreateRoute) -- <|> auctionListRoute, ("projects/:projectId/billables", billableCreateRoute <|> billableListRoute), ("projects/:projectId/payouts", payoutsRoute), ("projects/:projectId/invite", inviteRoute), ("projects/:projectId", projectRoute), ("projects", projectCreateRoute <|> projectListRoute)auctionCreateRoute =serveJSON auctionIdJSON $ method POST auctionCreateHandlerauctionRoute = serveJSON auctionJSON $ method GET auctionGetHandlerauctionBidRoute = serveJSON bidIdJSON $ method POST auctionBidHandler - replacement in server/Main.hs at line 89
, ("auctions/:auctionId", auctionRoute), ("auctions/:auctionId/bid", auctionBidRoute)billableCreateRoute =serveJSON billableIdJSON $ method POST billableCreateHandlerbillableListRoute =serveJSON (fmap qdbBillableJSON) $ method GET billableListHandlersubscribeRoute =serveJSON subscriptionIdJSON $ method POST subscribeHandler - replacement in server/Main.hs at line 96[3.8386]→[3.39910:39973](∅→∅),[3.39973]→[3.8386:8473](∅→∅),[3.8386]→[3.8386:8473](∅→∅),[3.8473]→[3.39974:40062](∅→∅)
, ("subscribe/:billableId", subscribeRoute), ("subscriptions/:subscriptionId/payment_requests", payableRequestsRoute), ("pay/:paymentRequestKey", getPaymentRequestRoute <|> submitPaymentRoute)payableRequestsRoute =serveJSON billDetailsJSON $ method GET listPayableRequestsHandlergetPaymentRequestRoute =writeLBS. runPutLazy. encodeMessage=<< method GET getPaymentRequestHandlersubmitPaymentRoute = serveJSON paymentIdJSON$ method POST (paymentResponseHandler $ cfg ^. billingConfig) - replacement in server/Main.hs at line 106[3.322]→[3.13275:13332](∅→∅),[3.4300]→[3.13275:13332](∅→∅),[3.13275]→[3.13275:13332](∅→∅),[3.13332]→[3.12005:12019](∅→∅)
, ("events/:eventId/amend", amendEventRoute)]addRoutes[ ("static", serveDirectory . encodeString $ cfg ^. staticAssetPath), ("login" , loginRoute), ("login" , xhrLoginRoute), ("register" , registerRoute), ("accept_invitation" , acceptInviteRoute), ("projects/:projectId/logStart/:btcAddr", logWorkBTCRoute StartWork), ("projects/:projectId/logEnd/:btcAddr", logWorkBTCRoute StopWork), ("projects/:projectId/logStart" , logWorkRoute StartWork), ("projects/:projectId/logEnd" , logWorkRoute StopWork), ("projects/:projectId/logEntries" , logEntriesRoute), ("projects/:projectId/intervals" , logIntervalsRoute), ( "projects/:projectId/auctions", auctionCreateRoute) -- <|> auctionListRoute, ( "projects/:projectId/billables", billableCreateRoute <|> billableListRoute), ("projects/:projectId/payouts", payoutsRoute), ("projects/:projectId/invite" , inviteRoute), ("projects/:projectId" , projectRoute), ("projects" , projectCreateRoute <|> projectListRoute), ("auctions/:auctionId" , auctionRoute), ("auctions/:auctionId/bid" , auctionBidRoute), ("subscribe/:billableId" , subscribeRoute), ("subscriptions/:subscriptionId/payment_requests", payableRequestsRoute), ("pay/:paymentRequestKey", getPaymentRequestRoute <|> submitPaymentRoute), ("events/:eventId/amend" , amendEventRoute)] - replacement in test/Aftok/AuctionSpec.hs at line 1
module Aftok.AuctionSpec (main, spec) wheremodule Aftok.AuctionSpec( main, spec)where - replacement in test/Aftok/AuctionSpec.hs at line 11
import Data.Thyme.Clock ()import Data.Thyme.Clock ( ) - replacement in test/Aftok/AuctionSpec.hs at line 13
import Text.Read (read)import Text.Read ( read ) - replacement in test/Aftok/AuctionSpec.hs at line 22
import Test.HUnit.Base (assertFailure)import Test.HUnit.Base ( assertFailure ) - replacement in test/Aftok/AuctionSpec.hs at line 26
genBid = Bid <$> (UserId <$> genUUID)<*> (Seconds <$> arbitrary `suchThat` (>= 0))<*> genSatoshi `suchThat` (> Satoshi 0)<*> arbitrarygenBid =Bid<$> (UserId <$> genUUID)<*> (Seconds <$> arbitrary `suchThat` (>= 0))<*> genSatoshi`suchThat` (> Satoshi 0)<*> arbitrary - replacement in test/Aftok/AuctionSpec.hs at line 36[3.1231]→[3.695:1190](∅→∅),[3.695]→[3.695:1190](∅→∅),[3.1190]→[3.1232:1240](∅→∅),[3.1240]→[3.1199:1351](∅→∅),[3.1199]→[3.1199:1351](∅→∅),[3.1351]→[3.749:839](∅→∅),[3.749]→[3.749:839](∅→∅)
let testB0 = Bid (UserId nil) (Seconds 3) (Satoshi 100) (read "2016-03-05 15:59:26.033176 UTC")testB1 = Bid (UserId nil) (Seconds 60) (Satoshi 1000)(read "2016-03-05 15:59:26.033177 UTC")testB2 = Bid (UserId nil) (Seconds 60) (Satoshi 100) (read "2016-03-05 15:59:26.033178 UTC")testB3 = Bid (UserId nil) (Seconds 90) (Satoshi 100) (read "2016-03-05 15:59:26.033179 UTC")testB4 = Bid (UserId nil) (Seconds 60) (Satoshi 100) (read "2016-03-05 15:59:26.033180 UTC")in dodescribe "bid ordering" $ doit "ensures that bids with lowest seconds/btc ratio are first" $ dobidOrder testB0 testB1 `shouldBe` LTbidOrder testB1 testB2 `shouldBe` LTbidOrder testB2 testB3 `shouldBe` LTlettestB0 = Bid (UserId nil)(Seconds 3)(Satoshi 100)(read "2016-03-05 15:59:26.033176 UTC")testB1 = Bid (UserId nil)(Seconds 60)(Satoshi 1000)(read "2016-03-05 15:59:26.033177 UTC")testB2 = Bid (UserId nil)(Seconds 60)(Satoshi 100)(read "2016-03-05 15:59:26.033178 UTC")testB3 = Bid (UserId nil)(Seconds 90)(Satoshi 100)(read "2016-03-05 15:59:26.033179 UTC")testB4 = Bid (UserId nil)(Seconds 60)(Satoshi 100)(read "2016-03-05 15:59:26.033180 UTC")indodescribe "bid ordering" $ doit "ensures that bids with lowest seconds/btc ratio are first" $ dobidOrder testB0 testB1 `shouldBe` LTbidOrder testB1 testB2 `shouldBe` LTbidOrder testB2 testB3 `shouldBe` LT - replacement in test/Aftok/AuctionSpec.hs at line 65
it "ensures breaks ties in bid ordering by timestamp" $ dobidOrder testB2 testB4 `shouldBe` LTit "ensures breaks ties in bid ordering by timestamp" $ dobidOrder testB2 testB4 `shouldBe` LT - replacement in test/Aftok/AuctionSpec.hs at line 68
describe "winning bids" $ doit "determines a sufficient number of winners to fulfill the raise amount" $let result = runAuction' (Satoshi 1250) [testB0, testB1, testB2, testB3, testB4]split = Bid (UserId nil) (Seconds 30) (Satoshi 50) (testB4 ^. bidTime)expected = sortBy bidOrder [testB0, testB1, testB2, split]in case result ofWinningBids winners ->sortBy bidOrder winners `shouldBe` expecteddescribe "winning bids" $ doit"determines a sufficient number of winners to fulfill the raise amount"$ letresult = runAuction' (Satoshi 1250)[testB0, testB1, testB2, testB3, testB4]split =Bid (UserId nil) (Seconds 30) (Satoshi 50) (testB4 ^. bidTime)expected = sortBy bidOrder [testB0, testB1, testB2, split]incase result ofWinningBids winners ->sortBy bidOrder winners `shouldBe` expected - replacement in test/Aftok/AuctionSpec.hs at line 82
InsufficientBids _ ->assertFailure "Sufficinent bids were presented, but auction algorithm asserted otherwise."InsufficientBids _ ->assertFailure"Sufficinent bids were presented, but auction algorithm asserted otherwise." - replacement in test/Aftok/AuctionSpec.hs at line 86
it "ensures that the raise amount is fully consumed by the winning bids" $forAll ((,) <$> genSatoshi <*> listOf genBid) $\(raiseAmount', bids) ->case runAuction' raiseAmount' bids ofWinningBids xs -> bidsTotal xs == raiseAmount'InsufficientBids t -> t == (raiseAmount' - bidsTotal bids)it "ensures that the raise amount is fully consumed by the winning bids"$ forAll ((,) <$> genSatoshi <*> listOf genBid)$ \(raiseAmount', bids) -> case runAuction' raiseAmount' bids ofWinningBids xs -> bidsTotal xs == raiseAmount'InsufficientBids t -> t == (raiseAmount' - bidsTotal bids) - replacement in test/Aftok/Generators.hs at line 7
import Network.Haskoin.Test (ArbitraryAddress (..))import Network.Haskoin.Test ( ArbitraryAddress(..) ) - replacement in test/Aftok/Generators.hs at line 9
import Aftok (BtcAddr (..))import Aftok.Types (Satoshi (..))import Aftok ( BtcAddr(..) )import Aftok.Types ( Satoshi(..) ) - replacement in test/Aftok/PaymentsSpec.hs at line 3
module Aftok.PaymentsSpec (main, spec) wheremodule Aftok.PaymentsSpec( main, spec)where - replacement in test/Aftok/PaymentsSpec.hs at line 14
describe "finding unbilled dates" $ dopure ()describe "finding unbilled dates" $ dopure () - replacement in test/Aftok/TimeLogSpec.hs at line 5
module Aftok.TimeLogSpec (main, spec) wheremodule Aftok.TimeLogSpec( main, spec)where - replacement in test/Aftok/TimeLogSpec.hs at line 13
import Control.Lens ((^.))import Control.Lens ( (^.) ) - replacement in test/Aftok/TimeLogSpec.hs at line 15
import qualified Data.List.NonEmpty as Limport qualified Data.Map.Strict as Mimport Data.Thyme.Time as Timport qualified Data.List.NonEmpty as Limport qualified Data.Map.Strict as Mimport Data.Thyme.Time as T - replacement in test/Aftok/TimeLogSpec.hs at line 22
import Aftok.Interval as Iimport Aftok.Interval as I - replacement in test/Aftok/TimeLogSpec.hs at line 31
delta <- arbitrary :: Gen (Positive T.NominalDiffTime)delta <- arbitrary :: Gen (Positive T.NominalDiffTime) - replacement in test/Aftok/TimeLogSpec.hs at line 36
let deltas = fmap T.fromSeconds <$> ((listOf $ choose (0, 72 * 60 * 60)) :: Gen[Int])let deltas =fmap T.fromSeconds<$> ((listOf $ choose (0, 72 * 60 * 60)) :: Gen [Int]) - replacement in test/Aftok/TimeLogSpec.hs at line 42
let ival = I.interval t (t .+^ d)in ival : buildIntervals (ival ^. I.end .+^ s) dxlet ival = I.interval t (t .+^ d)in ival : buildIntervals (ival ^. I.end .+^ s) dx - replacement in test/Aftok/TimeLogSpec.hs at line 46[3.2788]→[3.12638:12665](∅→∅),[3.3800]→[3.12638:12665](∅→∅),[3.236]→[3.3879:3954](∅→∅),[3.3879]→[3.3879:3954](∅→∅),[3.3954]→[3.2789:2821](∅→∅)
startTime <- arbitraryintervals <- suchThat (buildIntervals startTime <$> deltas) (not.null)pure $ L.fromList intervalsstartTime <- arbitraryintervals <- suchThat (buildIntervals startTime <$> deltas) (not . null)pure $ L.fromList intervals - replacement in test/Aftok/TimeLogSpec.hs at line 52
let record = do addr <- genBtcAddrivals <- genIntervalspure (CreditToAddress addr, ivals)let record = doaddr <- genBtcAddrivals <- genIntervalspure (CreditToAddress addr, ivals) - replacement in test/Aftok/TimeLogSpec.hs at line 61[3.198]→[3.12719:12792](∅→∅),[3.39]→[3.2309:2410](∅→∅),[3.12792]→[3.2309:2410](∅→∅),[3.2309]→[3.2309:2410](∅→∅)
it "reduces a log to a work index" $let testAddrs = catMaybes[ parseBtcAddr "123", parseBtcAddr "456", parseBtcAddr "789" ]it "reduces a log to a work index"$ lettestAddrs = catMaybes[parseBtcAddr "123", parseBtcAddr "456", parseBtcAddr "789"] - replacement in test/Aftok/TimeLogSpec.hs at line 68
, parseISO8601 "2014-01-01T00:12:00Z" ], parseISO8601 "2014-01-01T00:12:00Z"] - replacement in test/Aftok/TimeLogSpec.hs at line 71
ends = toThyme <$> catMaybesends = toThyme <$> catMaybes - replacement in test/Aftok/TimeLogSpec.hs at line 73
, parseISO8601 "2014-01-01T00:18:00Z" ], parseISO8601 "2014-01-01T00:18:00Z"] - replacement in test/Aftok/TimeLogSpec.hs at line 78
addr <- testAddrsaddr <- testAddrs - edit in test/Aftok/TimeLogSpec.hs at line 89
in(workIndex testLogEntries) `shouldBe` expected - replacement in test/Aftok/TimeLogSpec.hs at line 92[3.2825]→[3.3331:3387](∅→∅),[3.120]→[3.493:494](∅→∅),[3.1514]→[3.493:494](∅→∅),[3.2990]→[3.493:494](∅→∅),[3.3387]→[3.493:494](∅→∅),[3.493]→[3.493:494](∅→∅),[3.494]→[3.3029:3243](∅→∅)
in (workIndex testLogEntries) `shouldBe` expectedit "recovers a work index from events" $forAll genWorkIndex $ \(WorkIndex widx) ->let mergeAdjacent ((I.Interval s e) : (I.Interval s' e') : xs) | e == s' = mergeAdjacent $ I.Interval s e' : xsit "recovers a work index from events"$ forAll genWorkIndex$ \(WorkIndex widx) ->letmergeAdjacent ((I.Interval s e) : (I.Interval s' e') : xs)| e == s' = mergeAdjacent $ I.Interval s e' : xs - replacement in test/Aftok/TimeLogSpec.hs at line 99
mergeAdjacent [] = []mergeAdjacent [] = [] - replacement in test/Aftok/TimeLogSpec.hs at line 101
ivalEntries addr ival = LogEntry addr <$> [StartWork (ival ^. start), StopWork (ival ^. end)]<*> [Nothing]ivalEntries addr ival =LogEntry addr<$> [StartWork (ival ^. start), StopWork (ival ^. end)]<*> [Nothing] - replacement in test/Aftok/TimeLogSpec.hs at line 108
widx' = fmap (L.fromList . mergeAdjacent . sortOn I._start . L.toList) widxwidx' = fmap(L.fromList . mergeAdjacent . sortOn I._start . L.toList)widx - replacement in test/Aftok/TimeLogSpec.hs at line 112
in workIndex logEntries `shouldBe` (WorkIndex $ fmap (L.reverse . L.sort) widx')inworkIndex logEntries`shouldBe` (WorkIndex $ fmap (L.reverse . L.sort) widx') - replacement in test/Aftok/Util/HttpSpec.hs at line 19
(parseOnly authHeaderParser rawHeader) `shouldBe` (Right ("nuttycom", "kjntest"))(parseOnly authHeaderParser rawHeader)`shouldBe` (Right ("nuttycom", "kjntest"))