lambdatom

Anonymous Coward 2018-04-28 10:35:48.471945 UTC

1placeBid ::
2 Key
3 -> AucTXID
4 -> CoinTXID
5 -> CoinSCID
6 -> CoinVersion
7 -> IO (Either PostTXError PostTXResponse)
8placeBid key aucTXID coinTXID coinSCID coinVersion =
9 postTX (BidTXin key aucTXID coinTXID coinSCID coinVersion) >>= \(exitCode, stdOut, stdErr) ->
10 return $
11 case exitCode of
12 ExitSuccess ->
13 maybe
14 (Left $ TXBodyFailed stdOut)
15 (\(BidTXout txID _ _ _ _ isWinningBid) ->
16 Right $ Bid txID aucTXID isWinningBid)
17 (bidParser aucTXID coinTXID stdOut)
18 ExitFailure _ -> Left $ TXFailed stdErr