commit 7d58a8cbf0855a58c556ad1580ac5c027e05791a
parent 9fd43960c5d92bbe872124ff7779910e716db1cc
Author: Jared Tobin <jared@jtobin.io>
Date: Wed, 18 Dec 2024 17:32:42 -0330
test: hacky tests
Diffstat:
2 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/ppad-btcprim.cabal b/ppad-btcprim.cabal
@@ -47,9 +47,11 @@ test-suite btcprim-tests
, base
, base16-bytestring
, bytestring
+ , ppad-base58
, ppad-btcprim
- , ppad-sha256
, ppad-ripemd160
+ , ppad-secp256k1
+ , ppad-sha256
, tasty
, tasty-hunit
diff --git a/test/Main.hs b/test/Main.hs
@@ -2,7 +2,11 @@
module Main where
+import qualified Crypto.Curve.Secp256k1 as Secp256k1
+import qualified Crypto.Hash.SHA256 as SHA256
+import qualified Crypto.Hash.RIPEMD160 as RIPEMD160
import qualified Data.ByteString as BS
+import qualified Data.ByteString.Base58Check as B58
import Bitcoin.Prim.Script
import Test.Tasty
import Test.Tasty.HUnit
@@ -10,6 +14,15 @@ import Test.Tasty.HUnit
main :: IO ()
main = pure ()
+sec :: Integer
+sec = 0x05
+
+pub :: Secp256k1.Pub
+pub = Secp256k1.derive_pub sec
+
+p2pkh = B58.encode 0x00
+ (RIPEMD160.hash (SHA256.hash (Secp256k1.serialize_point pub)))
+
-- p2pkh
-- https://en.bitcoin.it/wiki/Script#