Merge pull request 'Correct the parsing of OutPoint' (#46) from rav001 into dev040

Reviewed-on: #46
This commit is contained in:
pitmutt 2024-03-27 14:05:17 +00:00 committed by Vergara Technologies LLC
commit 899b79f155
Signed by: Vergara Technologies LLC
GPG key ID: 99DB473BB4715618

View file

@ -31,9 +31,10 @@ import qualified Data.ByteArray as BA
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as C
import qualified Data.ByteString.Lazy.UTF8 as US
import qualified Data.ByteString.Short as BS (ShortByteString, toShort)
import Data.HexString
import Data.Int
import Data.Maybe (fromMaybe)
import Data.Maybe (fromJust, fromMaybe)
import Data.Structured
import qualified Data.Text as T
import qualified Data.Text.Encoding as E
@ -41,6 +42,7 @@ import Data.Word
import qualified GHC.Generics as GHC
import qualified Generics.SOP as SOP
import Haskoin.Address (Address)
import qualified Haskoin.Crypto.Hash as H (Hash256(..))
import Haskoin.Crypto.Keys.Extended (XPrvKey)
import qualified Haskoin.Transaction.Common as H
@ -151,7 +153,9 @@ fromRawTxIn :: RawTxIn -> H.TxIn
fromRawTxIn t =
H.TxIn
(H.OutPoint
(read $ US.toString $ C.fromStrict $ rop_hash $ rti_outpoint t)
((fromJust .
H.hexToTxHash . E.decodeUtf8Lenient . rop_hash . rti_outpoint)
t)
(rop_n $ rti_outpoint t))
(rti_script t)
(rti_seq t)