Compare commits

..

3 commits

Author SHA1 Message Date
0fb02b2514
Correct parsing of OutPoint 2024-03-27 09:00:00 -05:00
1674f9b592
Merge branch 'dev040' into rav001 2024-03-26 15:40:11 -05:00
bb9d336dc3
Implements low-level transparent components (#45)
This PR includes components for the deserialization of low-level part of transparent components.

Reviewed-on: #45
Co-authored-by: Rene Vergara <rene@vergara.network>
Co-committed-by: Rene Vergara <rene@vergara.network>
2024-03-26 20:39:31 +00:00

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)