bolt3

Lightning transaction and script formats, per BOLT #3 (docs.ppad.tech/bolt3).
git clone git://git.ppad.tech/bolt3.git
Log | Files | Refs | README | LICENSE

commit 64618b41596bf4ceeb4459ed9c13694677dd097b
parent 7686c616c81bcb0a8747ce4c49c3d00e478a51e6
Author: Jared Tobin <jared@jtobin.io>
Date:   Sat, 18 Apr 2026 20:19:22 +0800

test/bench: update for ppad-tx types

- txid -> mkTxId in smart constructor tests
- Outpoint -> OutPoint in NFData instances and fixtures

Diffstat:
Mbench/Main.hs | 8++++----
Mbench/Weight.hs | 8++++----
Mtest/Main.hs | 8++++----
3 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/bench/Main.hs b/bench/Main.hs @@ -87,8 +87,8 @@ instance NFData Script where instance NFData Witness where rnf (Witness items) = rnf items -instance NFData Outpoint where - rnf (Outpoint t i) = rnf t `seq` rnf i +instance NFData OutPoint where + rnf (OutPoint t i) = rnf t `seq` rnf i instance NFData Sequence where rnf (Sequence x) = rnf x @@ -390,8 +390,8 @@ main = defaultMain [ samplePubkey3 = samplePubkey1 -- Funding outpoint - sampleFundingOutpoint :: Outpoint - sampleFundingOutpoint = Outpoint (TxId $ BS.replicate 32 0x01) 0 + sampleFundingOutpoint :: OutPoint + sampleFundingOutpoint = OutPoint (TxId $ BS.replicate 32 0x01) 0 -- HTLC lists mkHtlc :: HTLCDirection -> Word64 -> Word64 -> HTLC diff --git a/bench/Weight.hs b/bench/Weight.hs @@ -124,8 +124,8 @@ instance NFData Script where instance NFData Witness where rnf (Witness items) = rnf items -instance NFData Outpoint where - rnf (Outpoint t i) = rnf t `seq` rnf i +instance NFData OutPoint where + rnf (OutPoint t i) = rnf t `seq` rnf i instance NFData Sequence where rnf (Sequence x) = rnf x @@ -381,8 +381,8 @@ main = mainWith $ do samplePubkey3 = samplePubkey1 -- Funding outpoint - sampleFundingOutpoint :: Outpoint - sampleFundingOutpoint = Outpoint (TxId $ BS.replicate 32 0x01) 0 + sampleFundingOutpoint :: OutPoint + sampleFundingOutpoint = OutPoint (TxId $ BS.replicate 32 0x01) 0 -- HTLC builder mkHtlc :: HTLCDirection -> Word64 -> Word32 -> HTLC diff --git a/test/Main.hs b/test/Main.hs @@ -300,12 +300,12 @@ smartConstructorTests = testGroup "validation" [ , testCase "seckey rejects 33 bytes" $ do let bs = BS.replicate 33 0x01 isNothing (seckey bs) @?= True - , testCase "txid accepts 32 bytes" $ do + , testCase "mkTxId accepts 32 bytes" $ do let bs = BS.replicate 32 0x00 - isJust (txid bs) @?= True - , testCase "txid rejects 31 bytes" $ do + isJust (mkTxId bs) @?= True + , testCase "mkTxId rejects 31 bytes" $ do let bs = BS.replicate 31 0x00 - isNothing (txid bs) @?= True + isNothing (mkTxId bs) @?= True , testCase "payment_hash accepts 32 bytes" $ do let bs = BS.replicate 32 0xab isJust (payment_hash bs) @?= True