Browse files

Chargeback type

  • Loading branch information...
1 parent 760bc76 commit 58bb5182bc4abb94dd4ebd4c235931af1ef8491a @singpolyma committed Mar 18, 2013
Showing with 5 additions and 2 deletions.
  1. +1 −0 Sqlite3.hs
  2. +4 −2 VerifyObject.hs
View
1 Sqlite3.hs
@@ -72,6 +72,7 @@ processObject conn msg = runEitherT $ do
case obj of
MadePayment _ _-> return (adr, obj)
+ Chargeback _ _-> return (adr, obj)
MissedPayment _ _ | lineBalance line > 0 -> return (adr, obj)
NotTrusted _ _ | lineBalance line > 0 -> return (adr, obj)
_ -> throwT (show (objectAddress obj) ++ " is not in debt to " ++ show adr)
View
6 VerifyObject.hs
@@ -22,7 +22,8 @@ import qualified Data.OpenPGP.CryptoAPI as OpenPGP
data Object =
MadePayment UTCTime RippleAddress |
MissedPayment UTCTime RippleAddress |
- NotTrusted UTCTime RippleAddress
+ NotTrusted UTCTime RippleAddress |
+ Chargeback UTCTime RippleAddress
deriving (Eq, Show)
objectAddress :: Object -> RippleAddress
@@ -141,7 +142,8 @@ objectParser = do
cons <- choice [
string (T.pack "made a payment") *> return MadePayment,
string (T.pack "missed a payment") *> return MissedPayment,
- string (T.pack "not trusted") *> return NotTrusted
+ string (T.pack "not trusted") *> return NotTrusted,
+ string (T.pack "chargeback") *> return Chargeback
]
endOfLine
endOfInput

0 comments on commit 58bb518

Please sign in to comment.