Update auctions to permit zcash as a funding currency.
[?]
Jan 7, 2021, 6:15 AM
MU6WOCCJQWG4A5NLD3GBFATCE3SRE3QQCYXYH6WIKSGLHQOOBVRACDependencies
- [2]
JUFBTX45Add project auction queries. - [3]
BROSTG5KBeginning of modularization of server. - [4]
Z3MK2PJ5Add GET handler for retrieving auction data. - [5]
LHJ2HFXVAdd property test for auction algorithm. - [6]
EKI57EJRAdd alternative implementation of auction winner determination. - [7]
4R7XIYK3Switch from ClassyPrelude to Relude - [8]
4354Y4PEAdd endpoint to list project contributors. - [9]
IZEVQF62Work in progress replacing sqlite with postgres. - [10]
NAS4BFL4Trivial stylish-haskell reformat. - [11]
EW2XN7KUUpdate docker build, clean up migration for payments tables. - [12]
M4PWY5RUPreliminary work to add support for Zcash payments. - [13]
AL37SVTCImplement payments service endpoints. - [14]
NEDDHXUKReformat via stylish-haskell - [15]
LAROLAYUWIP - [16]
GCVQD44VCreate amends endpoint, switch to UUID primary keys - [17]
LTSVBVA2Update to a recent haskoin-core. Fix Stack build. - [18]
UWMGUJOWAutoformat sources. - [19]
HALRDT2FAdded initial auction create route. - [20]
IPG33FAWAdd billing daemon - [21]
FXJQACESEnsure that auction is not ended at the time of bid - [22]
MWUPXTBFA few steps down a road to be abandoned. - [23]
QMEYU4MWAdd display for prior intervals. - [24]
5XFJNUAZStart of addition of project infrastructure. - [25]
WO2MINIFAuctions now compile! - [26]
EFSXYZPOAutoformat everything with brittany. - [27]
Z7KS5XHHVery WIP. Wow. - [28]
F2XLL7XWRemove Ord Bid & sort in favor of sortBy - [29]
GLFF5ZDKFactor winningBids for easier testing. - [30]
7VGYLTMUClean up schema version handling. - [31]
Q5X5RYQLstylish-haskell reformatting - [32]
75N3UJ4JMore progression toward lenses. - [33]
TNR3TEHKSwitch to Postgres + snaplet arch compiles. - [34]
LD4GLVSFMore database stuff. - [35]
O5FVTOM6Undo JSON silliness, enable a couple more routes. - [36]
JFOEOFGAstylish-haskell formatting. - [37]
RSF6UAJKBreak out api module for timeline. - [38]
UUR6SMCAAdd start of specs for auctions. - [39]
3GBSDS5PFix out-of-date test code, add skeleton for payments spec. - [40]
5ZSKPQ3KAdd created_at and auction_start timestamps to auction - [41]
DFOBMSAOInitial work on payments API - [42]
QMRKFEPGRefactor QDB to use a free monad algebra instead. - [43]
W35DDBFYFactor common JSON conversions up into client lib module. - [44]
4U7F3CPITHE GREAT RENAMING OF THINGS! - [45]
2J37EVJMCheck for an open interval on project switch. - [46]
ASF3UPJLAdd auction creation and bid handlers - [47]
HBULCDN6Add tests for auction winner determination algorithm. - [48]
RPAJLHMTChange to use UUIDs instead of ints for primary keys. - [49]
NVOCQVASInitial failing tests. - [50]
TLQ72DSJLenses, sqlite-simple - [51]
ZP62WC47Begin conversion to build with stack. - [52]
5OI44E4EAdd authentication to auction search. - [53]
B6HWAPDPModularize & update to recent haskoin. - [54]
HMDM3B55Implement core of payments/billing infrastructure. - [55]
X3ES7NUAFine. I'll use ormolu. At least it doesn't break the code. - [*]
5IDB3IWSIntegrate zcashd-based zaddr validation. - [*]
64C6AWH6Rename Ananke -> Quixotic, project reboot. - [*]
ADMKQQGCInitial empty Snap project.
Change contents
- replacement in lib/Aftok/Auction.hs at line 5[3.5192]→[3.5634:5664](∅→∅),[3.5664]→[3.5294:5308](∅→∅),[3.5308]→[3.5677:5687](∅→∅),[3.5677]→[3.5677:5687](∅→∅)
import Aftok.Currency.Bitcoin( _Satoshi,ssub,import Aftok.Currency( IsCurrency (..), - edit in lib/Aftok/Auction.hs at line 12
import Bippy.Types (Satoshi (..)) - edit in lib/Aftok/Auction.hs at line 17
import Data.Traversable (for) - replacement in lib/Aftok/Auction.hs at line 23
data Auctiondata Auction c - replacement in lib/Aftok/Auction.hs at line 30
_raiseAmount :: Satoshi,_raiseAmount :: c, - replacement in lib/Aftok/Auction.hs at line 41
data Biddata Bid c - replacement in lib/Aftok/Auction.hs at line 45
_bidAmount :: Satoshi,_bidAmount :: c, - replacement in lib/Aftok/Auction.hs at line 52
data Commitmentdata Commitment c - replacement in lib/Aftok/Auction.hs at line 54
{ _baseBid :: Bid,{ _baseBid :: Bid c, - replacement in lib/Aftok/Auction.hs at line 56
_commitmentAmount :: Satoshi_commitmentAmount :: c - replacement in lib/Aftok/Auction.hs at line 59
data AuctionResult= WinningBids [Bid]| InsufficientBids Satoshidata AuctionResult c= WinningBids [Bid c]| InsufficientBids c - replacement in lib/Aftok/Auction.hs at line 64
bidsTotal :: [Bid] -> SatoshibidsTotal bids = foldl' (\s b -> s <> (b ^. bidAmount)) (Satoshi 0) bidsbidsTotal :: Monoid c => [Bid c] -> cbidsTotal = foldMap (view bidAmount) - replacement in lib/Aftok/Auction.hs at line 67
bidOrder :: Bid -> Bid -> OrderingbidOrder = comparing costRatio `mappend` comparing (^. bidTime)bidOrder ::forall c.IsCurrency c =>Bid c ->Bid c ->OrderingbidOrder = comparing costRatio <> comparing (^. bidTime) - replacement in lib/Aftok/Auction.hs at line 75[3.6571]→[3.6571:6617](∅→∅),[3.6617]→[3.5309:5364](∅→∅),[3.5364]→[3.6671:6710](∅→∅),[3.6671]→[3.6671:6710](∅→∅)
secs bid = toRational $ bid ^. bidSecondsbtc bid = toRational $ bid ^. bidAmount . _SatoshicostRatio bid = secs bid / btc bidcostRatio :: Bid c -> RationalcostRatio bid = (toRational $ bid ^. bidSeconds) / (toRational $ bid ^. bidAmount . _Units) - replacement in lib/Aftok/Auction.hs at line 79
runAuction :: Auction -> [Bid] -> AuctionResultrunAuction :: IsCurrency c => Auction c -> [Bid c] -> AuctionResult c - replacement in lib/Aftok/Auction.hs at line 82
runAuction' :: Satoshi -> [Bid] -> AuctionResultrunAuction' ::forall c.IsCurrency c =>c ->[Bid c] ->AuctionResult c - replacement in lib/Aftok/Auction.hs at line 89
let takeWinningBids :: Satoshi -> [Bid] -> [Bid]let takeWinningBids :: c -> [Bid c] -> [Bid c] - replacement in lib/Aftok/Auction.hs at line 91
| -- if the total is fully within the raise amounttotal <> (bid ^. bidAmount) < raiseAmount' =| total <> (bid ^. bidAmount) < raiseAmount' =-- if the total is fully within the raise amount - replacement in lib/Aftok/Auction.hs at line 94[3.6980]→[3.6980:7089](∅→∅),[3.7089]→[3.5365:5429](∅→∅),[3.5429]→[3.7152:7197](∅→∅),[3.7152]→[3.7152:7197](∅→∅)
| -- if the last bid will exceed the raise amount, reduce it to fittotal < raiseAmount' =let winFraction r = r % (bid ^. bidAmount . _Satoshi)remainderSeconds (Satoshi r) =| total < raiseAmount' =-- if the last bid will exceed the raise amount, reduce it to fitlet winFraction r =(r ^. _Units) % (bid ^. bidAmount . _Units)remainderSeconds r = - replacement in lib/Aftok/Auction.hs at line 100
adjustBid r = bid & bidSeconds .~ remainderSeconds r & bidAmount .~ rin toList $ adjustBid <$> raiseAmount' `ssub` totaladjustBid r =bid & bidSeconds .~ remainderSeconds r & bidAmount .~ rin toList $ adjustBid <$> raiseAmount' `csub` total - replacement in lib/Aftok/Auction.hs at line 108
(WinningBids $ takeWinningBids (Satoshi 0) $ sortBy bidOrder bids)(WinningBids $ takeWinningBids mempty $ sortBy bidOrder bids) - replacement in lib/Aftok/Auction.hs at line 110[3.7644]→[3.7644:7689](∅→∅),[3.2958]→[3.653:654](∅→∅),[3.7689]→[3.653:654](∅→∅),[3.10423]→[3.653:654](∅→∅),[3.653]→[3.653:654](∅→∅),[3.654]→[3.312:502](∅→∅),[3.502]→[3.7690:7865](∅→∅),[3.7865]→[3.665:735](∅→∅),[3.665]→[3.665:735](∅→∅),[3.735]→[3.7866:7900](∅→∅),[3.7900]→[3.5430:5492](∅→∅),[3.5492]→[3.7961:8004](∅→∅),[3.7961]→[3.7961:8004](∅→∅),[3.8004]→[3.10581:10662](∅→∅),[3.10581]→[3.10581:10662](∅→∅),[3.10662]→[3.8005:8178](∅→∅),[3.8178]→[3.455:473](∅→∅),[3.1075]→[3.455:473](∅→∅),[3.473]→[3.1094:1116](∅→∅),[3.1094]→[3.1094:1116](∅→∅)
(raiseAmount' `ssub` submittedTotal)bidCommitment :: Satoshi -> Bid -> State Satoshi (Maybe Commitment)bidCommitment raiseAmount' bid = doraised <- getcase raised of-- if the total is fully within the raise amountx| x <> (bid ^. bidAmount) < raiseAmount' ->put (x <> bid ^. bidAmount)>> (pure . Just $ Commitment bid (bid ^. bidSeconds) (bid ^. bidAmount))-- if the last bid will exceed the raise amount, reduce it to fitx| x < raiseAmount' ->let winFraction r = r % (bid ^. bidAmount . _Satoshi)remainderSeconds (Satoshi r) =Seconds . round $ winFraction r * fromIntegral (bid ^. bidSeconds)in for (raiseAmount' `ssub` x) $ \remainder ->put (x <> remainder)*> (pure $ Commitment bid (remainderSeconds remainder) remainder)-- otherwise,_ -> pure Nothing[3.7644](raiseAmount' `csub` submittedTotal) - edit in lib/Aftok/Currency/Bitcoin.hs at line 13
H.Address, - edit in lib/Aftok/Currency/Bitcoin.hs at line 20
import qualified Haskoin.Address as H - replacement in lib/Aftok/Currency/Bitcoin.hs at line 23
_Satoshi :: Lens' Satoshi Word64_Satoshi inj (Satoshi value) = Satoshi <$> inj value_Satoshi :: Iso' Satoshi Word64_Satoshi = iso (\(Satoshi w) -> w) (Satoshi) - edit in lib/Aftok/Currency/Zcash/Types.hs at line 40
instance Monoid Zatoshi wheremempty = Zatoshi 0 - edit in lib/Aftok/Currency/Zcash/Types.hs at line 44
zsub :: Zatoshi -> Zatoshi -> Maybe Zatoshizsub (Zatoshi a) (Zatoshi b) | a > b = Just . Zatoshi $ (a - b)zsub _ _ = Nothing - edit in lib/Aftok/Currency/Zcash.hs at line 14
Z.zsub, - edit in lib/Aftok/Currency.hs at line 1
{-# LANGUAGE StandaloneDeriving #-} - replacement in lib/Aftok/Currency.hs at line 7
import qualified Aftok.Currency.Zcash as Zcashimport qualified Bippy.Types as Bitcoinimport Control.Lens (view)import qualified Haskoin.Address as Bitcoinimport qualified Aftok.Currency.Bitcoin as Bimport qualified Aftok.Currency.Zcash as Zimport Control.Lens (Iso')import qualified Text.Show - replacement in lib/Aftok/Currency.hs at line 13
BTC :: Currency Bitcoin.Address Bitcoin.SatoshiZEC :: Currency Zcash.Address Zcash.ZatoshiBTC :: Currency B.Address B.SatoshiZEC :: Currency Z.Address Z.Zatoshiinstance Eq (Currency a c) whereBTC == BTC = TrueZEC == ZEC = Trueinstance Show (Currency a c) whereshow = \caseBTC -> "BTC"ZEC -> "ZEC" - edit in lib/Aftok/Currency.hs at line 26
instance Eq (Currency' c) where(Currency' BTC) == (Currency' BTC) = True(Currency' ZEC) == (Currency' ZEC) = Trueinstance Show (Currency' c) whereshow (Currency' c) = show c - edit in lib/Aftok/Currency.hs at line 40
class (Eq c, Ord c, Monoid c) => IsCurrency c wherecsub :: c -> c -> Maybe ccscale :: c -> Rational -> Maybe c_Units :: Iso' c Word64currency' :: Currency' c - replacement in lib/Aftok/Currency.hs at line 47
scaleCurrency :: Currency a c -> c -> Rational -> Maybe cscaleCurrency c amount factor = case c ofBTC -> (\(Bitcoin.Satoshi amt) -> Just $ Bitcoin.Satoshi ((round $ toRational amt * factor) :: Word64)) amountZEC -> (\amt -> Zcash.toZatoshi ((round $ toRational (view Zcash._Zatoshi amt) * factor) :: Word64)) amount[3.16985]instance IsCurrency B.Satoshi wherecsub = B.ssubcscale (B.Satoshi amt) factor =let r = toRational amt * factorin if (r >= 0) then Just (B.Satoshi . round $ r) else Nothing_Units = B._Satoshicurrency' = Currency' BTCinstance IsCurrency Z.Zatoshi wherecsub = Z.zsubcscale (Z.Zatoshi amt) factor =let r = toRational amt * factorin if (r >= 0) then Just (Z.Zatoshi . round $ r) else Nothing_Units = Z._Zatoshicurrency' = Currency' ZEC - edit in lib/Aftok/Database/PostgreSQL/Auctions.hs at line 22
auctionStart, - edit in lib/Aftok/Database/PostgreSQL/Auctions.hs at line 27
description, - edit in lib/Aftok/Database/PostgreSQL/Auctions.hs at line 29
name, - edit in lib/Aftok/Database/PostgreSQL/Auctions.hs at line 32
name,description - replacement in lib/Aftok/Database/PostgreSQL/Auctions.hs at line 33
-- import Aftok.Currency ( Amount(..) )-- import qualified Aftok.Currency.Bitcoin as Bitcoinimport Aftok.Currency.Bitcoin (_Satoshi)-- import qualified Aftok.Currency.Zcash as Zcashimport Aftok.Database (Limit(..))import Aftok.Currency (Amount (..))import Aftok.Database (Limit (..)) - replacement in lib/Aftok/Database/PostgreSQL/Auctions.hs at line 37
btcAmountParser,currencyAmountParser,currencyType,currencyValue, - replacement in lib/Aftok/Database/PostgreSQL/Auctions.hs at line 45
import Aftok.Interval (RangeQuery(..))import Aftok.Interval (RangeQuery (..)) - replacement in lib/Aftok/Database/PostgreSQL/Auctions.hs at line 62
auctionParser :: RowParser AuctionauctionParser :: RowParser (Auction Amount) - replacement in lib/Aftok/Database/PostgreSQL/Auctions.hs at line 70
<*> btcAmountParser<*> currencyAmountParser - replacement in lib/Aftok/Database/PostgreSQL/Auctions.hs at line 74
bidParser :: RowParser BidbidParser :: RowParser (Bid Amount) - replacement in lib/Aftok/Database/PostgreSQL/Auctions.hs at line 76
Bid <$> idParser UserId <*> (Seconds <$> field) <*> btcAmountParser <*> utcParserBid <$> idParser UserId <*> (Seconds <$> field) <*> currencyAmountParser <*> utcParser - replacement in lib/Aftok/Database/PostgreSQL/Auctions.hs at line 78
createAuction :: Auction -> DBM AuctionIdcreateAuction :: Auction Amount -> DBM AuctionId - replacement in lib/Aftok/Database/PostgreSQL/Auctions.hs at line 82
[sql| INSERT INTO auctions (project_id, initiator_id, name, description, raise_amount, end_time)VALUES (?, ?, ?, ?) RETURNING id |]( auc ^. (projectId . _ProjectId),auc ^. (initiator . _UserId),[sql| INSERT INTO auctions (project_id, initiator_id, name, description, currency, raise_amount, start_time, end_time)VALUES (?, ?, ?, ?, ?, ?, ?, ?) RETURNING id |]( auc ^. projectId . _ProjectId,auc ^. initiator . _UserId, - replacement in lib/Aftok/Database/PostgreSQL/Auctions.hs at line 88
auc ^. (raiseAmount . _Satoshi),auc ^. (auctionEnd . to C.fromThyme)auc ^. raiseAmount . to currencyType,auc ^. raiseAmount . to currencyValue,auc ^. auctionStart . to C.fromThyme,auc ^. auctionEnd . to C.fromThyme - replacement in lib/Aftok/Database/PostgreSQL/Auctions.hs at line 94
findAuction :: AuctionId -> DBM (Maybe Auction)findAuction :: AuctionId -> DBM (Maybe (Auction Amount)) - replacement in lib/Aftok/Database/PostgreSQL/Auctions.hs at line 104
listAuctions :: ProjectId -> RangeQuery -> Limit -> DBM [Auction]listAuctions :: ProjectId -> RangeQuery -> Limit -> DBM [Auction Amount] - replacement in lib/Aftok/Database/PostgreSQL/Auctions.hs at line 109
auctionParser[sql| SELECT project_id, initiator_id, created_at, name, description, raise_amount, start_time, end_timeauctionParser[sql| SELECT project_id, initiator_id, created_at, name, description, raise_amount, start_time, end_time - replacement in lib/Aftok/Database/PostgreSQL/Auctions.hs at line 115
(pid ^. _ProjectId, C.fromThyme e, limit)(pid ^. _ProjectId, C.fromThyme e, limit) - replacement in lib/Aftok/Database/PostgreSQL/Auctions.hs at line 118
auctionParser[sql| SELECT project_id, initiator_id, created_at, name, description, raise_amount, start_time, end_timeauctionParser[sql| SELECT project_id, initiator_id, created_at, name, description, raise_amount, start_time, end_time - replacement in lib/Aftok/Database/PostgreSQL/Auctions.hs at line 124
(pid ^. _ProjectId, C.fromThyme s, C.fromThyme e, limit)(pid ^. _ProjectId, C.fromThyme s, C.fromThyme e, limit) - replacement in lib/Aftok/Database/PostgreSQL/Auctions.hs at line 127
auctionParser[sql| SELECT project_id, initiator_id, created_at, name, description, raise_amount, start_time, end_timeauctionParser[sql| SELECT project_id, initiator_id, created_at, name, description, raise_amount, start_time, end_time - replacement in lib/Aftok/Database/PostgreSQL/Auctions.hs at line 133
(pid ^. _ProjectId, C.fromThyme s, limit)(pid ^. _ProjectId, C.fromThyme s, limit) - replacement in lib/Aftok/Database/PostgreSQL/Auctions.hs at line 136
auctionParser[sql| SELECT project_id, initiator_id, created_at, name, description, raise_amount, start_time, end_timeauctionParser[sql| SELECT project_id, initiator_id, created_at, name, description, raise_amount, start_time, end_time - replacement in lib/Aftok/Database/PostgreSQL/Auctions.hs at line 141
(pid ^. _ProjectId, limit)(pid ^. _ProjectId, limit) - replacement in lib/Aftok/Database/PostgreSQL/Auctions.hs at line 143
createBid :: AuctionId -> Bid -> DBM BidIdcreateBid :: AuctionId -> Bid Amount -> DBM BidId - replacement in lib/Aftok/Database/PostgreSQL/Auctions.hs at line 153
bid ^. (bidAmount . _Satoshi),bid ^. bidAmount . to currencyType,bid ^. bidAmount . to currencyValue, - replacement in lib/Aftok/Database/PostgreSQL/Auctions.hs at line 158
findBids :: AuctionId -> DBM [(BidId, Bid)]findBids :: AuctionId -> DBM [(BidId, Bid Amount)] - replacement in lib/Aftok/Database/PostgreSQL/Events.hs at line 26
Limit(..),Limit (..), - replacement in lib/Aftok/Database.hs at line 83
ListAuctions :: ProjectId -> RangeQuery -> Limit -> DBOp [A.Auction]CreateAuction :: A.Auction -> DBOp A.AuctionIdFindAuction :: A.AuctionId -> DBOp (Maybe A.Auction)CreateBid :: A.AuctionId -> A.Bid -> DBOp A.BidIdFindBids :: A.AuctionId -> DBOp [(A.BidId, A.Bid)]ListAuctions :: ProjectId -> RangeQuery -> Limit -> DBOp [A.Auction Amount]CreateAuction :: A.Auction Amount -> DBOp A.AuctionIdFindAuction :: A.AuctionId -> DBOp (Maybe (A.Auction Amount))CreateBid :: A.AuctionId -> A.Bid Amount -> DBOp A.BidIdFindBids :: A.AuctionId -> DBOp [(A.BidId, A.Bid Amount)] - replacement in lib/Aftok/Database.hs at line 313
createAuction :: (MonadDB m) => A.Auction -> m A.AuctionIdcreateAuction :: (MonadDB m) => A.Auction Amount -> m A.AuctionId - replacement in lib/Aftok/Database.hs at line 317
listAuctions :: (MonadDB m) => UserId -> ProjectId -> RangeQuery -> Limit -> m [A.Auction]listAuctions :: (MonadDB m) => UserId -> ProjectId -> RangeQuery -> Limit -> m [A.Auction Amount] - replacement in lib/Aftok/Database.hs at line 321
findAuction :: (MonadDB m) => A.AuctionId -> UserId -> MaybeT m A.AuctionfindAuction :: (MonadDB m) => A.AuctionId -> UserId -> MaybeT m (A.Auction Amount) - replacement in lib/Aftok/Database.hs at line 329
findAuction' :: (MonadDB m) => A.AuctionId -> UserId -> m A.AuctionfindAuction' :: (MonadDB m) => A.AuctionId -> UserId -> m (A.Auction Amount) - replacement in lib/Aftok/Database.hs at line 340
createBid :: (MonadDB m) => A.AuctionId -> UserId -> A.Bid -> m A.BidIdcreateBid :: (MonadDB m) => A.AuctionId -> UserId -> A.Bid Amount -> m A.BidId - edit in lib/Aftok/Json.hs at line 24
import Control.Error.Util (maybeT) - replacement in lib/Aftok/Json.hs at line 45
( Address,textToAddr,( textToAddr, - replacement in lib/Aftok/Json.hs at line 157
auctionJSON :: A.Auction -> ValueauctionJSON :: A.Auction Amount -> Value - replacement in lib/Aftok/Json.hs at line 163
"raiseAmount" .= (x ^. (A.raiseAmount . _Satoshi))"name" .= (x ^. A.name),"description" .= (x ^. A.description),"raiseAmount" .= (x ^. (A.raiseAmount . to amountJSON)),"auctionStart" .= (x ^. A.auctionStart),"auctionEnd" .= (x ^. A.auctionEnd) - edit in lib/Aftok/Json.hs at line 280
parseAmountJSON :: Value -> Parser AmountparseAmountJSON = \caseObject o ->maybeT (fail $ "Expected to find one of [\"satoshi\", \"zatoshi\"] as a key.") pure $MaybeT (fmap (Amount BTC . review _Satoshi) <$> o .:? "satoshi")<|> MaybeT (fmap (Amount ZEC . review _Zatoshi) <$> o .:? "zatoshi")val -> fail $ "Value " <> show val <> " is not a JSON object." - replacement in lib/Aftok/Json.hs at line 416
parseRecurrence' (Object o) = parseRecurrence oparseRecurrence' val = fail $ "Value " <> show val <> " is not a JSON object."[3.28114]parseRecurrence' = \case(Object o) -> parseRecurrence oval -> fail $ "Value " <> show val <> " is not a JSON object." - replacement in lib/Aftok/Payments/Util.hs at line 5
import Aftok.Currency (Currency, scaleCurrency)import Aftok.Currency (Currency, IsCurrency, cscale) - replacement in lib/Aftok/Payments/Util.hs at line 42
(MonadDB m, Ord a, Semigroup c, Ord c) =>(MonadDB m, Ord a, IsCurrency c) => - replacement in lib/Aftok/Payments/Util.hs at line 59
let scaled frac = note AmountInvalid $ scaleCurrency currency amt fraclet scaled frac = note AmountInvalid $ cscale amt frac - replacement in lib/Aftok/Payments/Util.hs at line 64
(MonadDB m, Ord a, Semigroup c, Ord c) =>(MonadDB m, Ord a, IsCurrency c) => - replacement in lib/Aftok/TimeLog.hs at line 41
import Data.AdditiveGroupimport Data.AdditiveGroup () - edit in migrations/2021-01-03_16-15-52_auction-descriptions.txt at line 7[2.2734]
ALTER TABLE auctions ADD COLUMN currency currency_t NOT NULL; - edit in server/Aftok/Snaplet/Auctions.hs at line 7
auctionListHandler, - edit in server/Aftok/Snaplet/Auctions.hs at line 17
import Aftok.Currency (Amount) - replacement in server/Aftok/Snaplet/Auctions.hs at line 19
( createAuction,( Limit (..),createAuction, - edit in server/Aftok/Snaplet/Auctions.hs at line 23
listAuctions, - edit in server/Aftok/Snaplet/Auctions.hs at line 28
import Aftok.Snaplet.Util (decimalParam, rangeQueryParam) - edit in server/Aftok/Snaplet/Auctions.hs at line 31
import Bippy.Types (Satoshi (..)) - replacement in server/Aftok/Snaplet/Auctions.hs at line 38
data AuctionCreateRequest = CA {raiseAmount :: Word64, auctionStart :: C.UTCTime, auctionEnd :: C.UTCTime}data AuctionCreateRequest= CA{ name :: Text,description :: Maybe Text,raiseAmount :: Amount,auctionStart :: C.UTCTime,auctionEnd :: C.UTCTime} - replacement in server/Aftok/Snaplet/Auctions.hs at line 50
p o = CA <$> o .: "raiseAmount" <*> o .: "auctionStart" <*> o .: "auctionEnd"p o =CA<$> o .: "auctionName"<*> o .:? "auctionDesc"<*> (parseAmountJSON =<< o .: "raiseAmount")<*> o .: "auctionStart"<*> o .: "auctionEnd" - replacement in server/Aftok/Snaplet/Auctions.hs at line 58
bidCreateParser :: UserId -> C.UTCTime -> Value -> Parser BidbidCreateParser :: UserId -> C.UTCTime -> Value -> Parser (Bid Amount) - replacement in server/Aftok/Snaplet/Auctions.hs at line 64
<*> (Satoshi <$> o .: "bidAmount")<*> (parseAmountJSON =<< o .: "bidAmount") - replacement in server/Aftok/Snaplet/Auctions.hs at line 75[3.4617]→[3.591:622](∅→∅),[3.46721]→[3.591:622](∅→∅),[3.58443]→[3.591:622](∅→∅),[3.3561]→[3.591:622](∅→∅)
t <- liftIO C.getCurrentTimenow <- liftIO C.getCurrentTime - replacement in server/Aftok/Snaplet/Auctions.hs at line 80
t(Satoshi . raiseAmount $ req)now(name req)(description req)(raiseAmount $ req) - replacement in server/Aftok/Snaplet/Auctions.hs at line 87
auctionListHandler :: S.Handler App App [Auction]auctionListHandler :: S.Handler App App [Auction Amount] - replacement in server/Aftok/Snaplet/Auctions.hs at line 91
snapEval $ listAuctions pid uidrq <- rangeQueryParamlimit <- Limit . fromMaybe 1 <$> decimalParam "limit"snapEval $ listAuctions uid pid rq limit - replacement in server/Aftok/Snaplet/Auctions.hs at line 95
auctionGetHandler :: S.Handler App App AuctionauctionGetHandler :: S.Handler App App (Auction Amount) - edit in server/Aftok/Snaplet/Util.hs at line 3
import Aftok.Interval (RangeQuery (..)) - edit in server/Aftok/Snaplet/Util.hs at line 19
rangeQueryParam :: MonadSnap m => m RangeQueryrangeQueryParam = doendpoints <- (,) <$> timeParam "after" <*> timeParam "before"pure $ case endpoints of(Just s, Just e) -> During s e(Nothing, Just e) -> Before e(Just s, Nothing) -> After s(Nothing, Nothing) -> Always - edit in server/Aftok/Snaplet/WorkLog.hs at line 6
import Aftok.Interval - replacement in server/Aftok/Snaplet/WorkLog.hs at line 63[3.12986]→[3.5005:5069](∅→∅),[3.59141]→[3.5005:5069](∅→∅),[3.72058]→[3.5005:5069](∅→∅),[3.5005]→[3.5005:5069](∅→∅),[3.5069]→[3.4692:4723](∅→∅),[3.4723]→[3.72059:72173](∅→∅),[3.72173]→[3.4841:4878](∅→∅),[3.4841]→[3.4841:4878](∅→∅),[3.4878]→[3.15855:15903](∅→∅)
endpoints <- (,) <$> timeParam "after" <*> timeParam "before"let ival = case endpoints of(Just s, Just e) -> During s e(Nothing, Just e) -> Before e(Just s, Nothing) -> After s(Nothing, Nothing) -> Alwayslimit <- fromMaybe 1 <$> decimalParam "limit"ival <- rangeQueryParamlimit <- Limit . fromMaybe 1 <$> decimalParam "limit" - replacement in server/Main.hs at line 135
("projects/:projectId/auctions", auctionCreateRoute), -- <|> auctionListRoute)("projects/:projectId/auctions", auctionCreateRoute <|> auctionListRoute), - replacement in test/Aftok/AuctionSpec.hs at line 23
genBid :: Gen BidgenBid :: Gen (Bid Satoshi)