From 95b89e28ed032ee05f10c1e9a14549bf17fbc0f0 Mon Sep 17 00:00:00 2001 From: Rene Vergara Date: Wed, 25 Sep 2024 13:01:48 -0500 Subject: [PATCH] tests: Add transaction preparation tests --- test/Spec.hs | 47 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/test/Spec.hs b/test/Spec.hs index 3e5a4f6..bbb676e 100644 --- a/test/Spec.hs +++ b/test/Spec.hs @@ -265,7 +265,7 @@ main = do 18232 TestNet (toSqlKey 1) - 2999946 + 3000789 0.005 (fromJust uaRead) "Sending memo to orchard" @@ -293,3 +293,48 @@ main = do "Sending memo to orchard" Full tx `shouldBe` Right (hexString "deadbeef") + describe "Medium" $ do + it "To Orchard" $ do + let uaRead = + parseAddress + "utest1dl54utt6prjj5e0dnlknwumnxq9hycdjpkfr0sy6e6h522remqee8axe9zax0wsjrwpj76v555pdhvj9rnargpfyycs0vpkapq98xcdhem99gc4wchzn0ggepq3y6nz3a9sscwgqxgsh9vzhcad402y3x9szfregck5gslkya3c79d86xx0l33tpk8gnn7ew9vw37w43zh22u8dgdax" + case uaRead of + Nothing -> assertFailure "wrong address" + Just ua -> do + pool <- runNoLoggingT $ initPool "/home/rav/Zenith/zenith.db" + tx <- + runFileLoggingT "zenith.log" $ + prepareTxV2 + pool + "localhost" + 18232 + TestNet + (toSqlKey 1) + 3000789 + 0.005 + (fromJust uaRead) + "Sending memo to orchard" + Medium + tx `shouldBe` Right (hexString "deadbeef") + it "To Sapling" $ do + let uaRead = + parseAddress + "ztestsapling136jp8z89v2jh6kqd5rs4dtvlxym90m43svzdwzxaplyvc5ttzppytpvx80ncllcsqzpmukxjl3y" + case uaRead of + Nothing -> assertFailure "wrong address" + Just ua -> do + pool <- runNoLoggingT $ initPool "/home/rav/Zenith/zenith.db" + tx <- + runFileLoggingT "zenith.log" $ + prepareTxV2 + pool + "localhost" + 18232 + TestNet + (toSqlKey 1) + 2999396 + 0.005 + (fromJust uaRead) + "Sending memo to orchard" + Full + tx `shouldBe` Right (hexString "deadbeef")