fix: correct transaction creation

This commit is contained in:
Rene Vergara 2024-10-29 14:14:39 -05:00
parent 5139f9dd7b
commit 1694898117
Signed by: pitmutt
GPG key ID: 65122AD495A7F5B2

View file

@ -137,10 +137,10 @@ createTransaction sapAnchor orchAnchor tSpend sSpend oSpend outgoing znet bh bui
processResult $! txResult
where
processResult :: HexString -> Either TxError HexString
processResult input =
if BS.length (hexBytes input) > 1
then Right input
else case head (BS.unpack $ hexBytes input) of
processResult input
| BS.length (hexBytes input) > 1 = Right input
| otherwise =
case head (BS.unpack $ hexBytes input) of
0 -> Left InsufficientFunds
1 -> Left ChangeRequired
2 -> Left Fee