Correct parsing of OutPoint

This commit is contained in:
Rene Vergara 2024-03-27 09:00:00 -05:00
parent 1674f9b592
commit 0fb02b2514
Signed by: pitmutt
GPG key ID: 65122AD495A7F5B2

View file

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