Skip to content

Commit

Permalink
review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
paweljakubas committed Oct 16, 2019
1 parent db35b3d commit b80eab9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
7 changes: 3 additions & 4 deletions lib/core/src/Cardano/Wallet/Api/Server.hs
Original file line number Diff line number Diff line change
Expand Up @@ -616,8 +616,7 @@ postExternalTransaction ctx (PostExternalTransactionData load) = do

deleteTransaction
:: forall ctx s t k.
( s ~ SeqState t
, ctx ~ ApiLayer s t k
( ctx ~ ApiLayer s t k
, DefineTx t
)
=> ctx
Expand Down Expand Up @@ -1270,8 +1269,8 @@ instance LiftHandler ErrForgetPendingTx where
ErrForgetPendingTxNoSuchTransaction e -> handler e
ErrForgetPendingTxTransactionIsNotPending tid ->
apiError err404 TransactionNotPending $ mconcat
[ "The transaction with id : ", pretty tid,
"cannot be forgotten as it is not pending anymore."
[ "The transaction with id : ", toText tid,
" cannot be forgotten as it is not pending anymore."
]

instance LiftHandler ErrSubmitTx where
Expand Down
11 changes: 5 additions & 6 deletions lib/core/src/Cardano/Wallet/Api/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -737,12 +737,11 @@ instance MimeRender OctetStream PostExternalTransactionData where
mimeRender _ (PostExternalTransactionData val) = BL.fromStrict val

instance FromHttpApiData ApiTxId where
parseUrlPiece = first (T.pack . getTextDecodingError) . fromText

instance FromText ApiTxId where
fromText txt = case fromText txt of
Left err -> Left $ TextDecodingError $ show err
Right tid -> Right $ ApiTxId $ ApiT tid
parseUrlPiece = first (T.pack . getTextDecodingError) . fromText'
where
fromText' txt = case fromText txt of
Left err -> Left $ TextDecodingError $ show err
Right tid -> Right $ ApiTxId $ ApiT tid

instance ToHttpApiData ApiTxId where
toUrlPiece (ApiTxId (ApiT tid)) = toText tid
Expand Down

0 comments on commit b80eab9

Please sign in to comment.