Internal.hs (1037B)
1 {-# OPTIONS_HADDOCK hide #-} 2 3 -- | 4 -- Module: Lightning.Protocol.BOLT4.Internal 5 -- Copyright: (c) 2025 Jared Tobin 6 -- License: MIT 7 -- Maintainer: Jared Tobin <jared@ppad.tech> 8 -- 9 -- Internal definitions for BOLT4. 10 -- 11 -- This module exports unsafe constructors that bypass 12 -- validation. Use only in tests or trusted internal code. 13 14 module Lightning.Protocol.BOLT4.Internal ( 15 -- * Unsafe constructors 16 unsafeHmac32 17 , unsafeHopPayloads 18 , unsafePaymentSecret 19 ) where 20 21 import qualified Data.ByteString as BS 22 import Lightning.Protocol.BOLT4.Types 23 24 -- | Construct an 'Hmac32' without length validation. 25 -- 26 -- For test use only. 27 unsafeHmac32 :: BS.ByteString -> Hmac32 28 unsafeHmac32 = Hmac32 29 30 -- | Construct a 'HopPayloads' without length validation. 31 -- 32 -- For test use only. 33 unsafeHopPayloads :: BS.ByteString -> HopPayloads 34 unsafeHopPayloads = HopPayloads 35 36 -- | Construct a 'PaymentSecret' without length validation. 37 -- 38 -- For test use only. 39 unsafePaymentSecret :: BS.ByteString -> PaymentSecret 40 unsafePaymentSecret = PaymentSecret