Milestone 3: RPC server, ZIP-320 #104

Merged
pitmutt merged 152 commits from milestone3 into master 2024-11-21 15:39:19 +00:00
3 changed files with 30 additions and 16 deletions
Showing only changes of commit 6a4bbb587c - Show all commits

View file

@ -1611,10 +1611,24 @@ getOrchardCmxs pool zt = do
getMaxOrchardNote :: Pool SqlBackend -> IO OrchActionId
getMaxOrchardNote pool = do
flip PS.runSqlPool pool $ do
maxBlock <-
selectOne $ do
blks <- from $ table @ZcashBlock
where_ $ blks ^. ZcashBlockHeight >. val 0
pure $ blks ^. ZcashBlockHeight
case maxBlock of
Nothing -> return $ toSqlKey 0
Just (Value mb) -> do
x <-
selectOne $ do
n <- from $ table @OrchAction
where_ (n ^. OrchActionId >. val (toSqlKey 0))
(blks :& txs :& n) <-
from $ table @ZcashBlock `innerJoin` table @ZcashTransaction `on`
(\(blks :& txs) ->
blks ^. ZcashBlockId ==. txs ^. ZcashTransactionBlockId) `innerJoin`
table @OrchAction `on`
(\(_ :& txs :& n) ->
txs ^. ZcashTransactionId ==. n ^. OrchActionTx)
where_ (blks ^. ZcashBlockHeight <=. val (mb - 5))
orderBy [desc $ n ^. OrchActionId]
pure (n ^. OrchActionId)
case x of

View file

@ -265,7 +265,7 @@ main = do
18232
TestNet
(toSqlKey 1)
3000789
3000785
0.005
(fromJust uaRead)
"Sending memo to orchard"
@ -286,15 +286,15 @@ main = do
"localhost"
18232
TestNet
(toSqlKey 1)
2999396
(toSqlKey 4)
3000789
0.005
(fromJust uaRead)
"Sending memo to orchard"
"Sending memo to sapling"
Full
tx `shouldBe` Right (hexString "deadbeef")
describe "Medium" $ do
it "To Orchard" $ do
xit "To Orchard" $ do
let uaRead =
parseAddress
"utest1dl54utt6prjj5e0dnlknwumnxq9hycdjpkfr0sy6e6h522remqee8axe9zax0wsjrwpj76v555pdhvj9rnargpfyycs0vpkapq98xcdhem99gc4wchzn0ggepq3y6nz3a9sscwgqxgsh9vzhcad402y3x9szfregck5gslkya3c79d86xx0l33tpk8gnn7ew9vw37w43zh22u8dgdax"
@ -316,7 +316,7 @@ main = do
"Sending memo to orchard"
Medium
tx `shouldBe` Right (hexString "deadbeef")
it "To Sapling" $ do
xit "To Sapling" $ do
let uaRead =
parseAddress
"ztestsapling136jp8z89v2jh6kqd5rs4dtvlxym90m43svzdwzxaplyvc5ttzppytpvx80ncllcsqzpmukxjl3y"
@ -332,9 +332,9 @@ main = do
18232
TestNet
(toSqlKey 1)
2999396
3000789
0.005
(fromJust uaRead)
"Sending memo to orchard"
Full
Medium
tx `shouldBe` Right (hexString "deadbeef")

@ -1 +1 @@
Subproject commit 63a97b880cb32d8e008650f0efef2fdadc7d3d4a
Subproject commit 12296026a0ebb9a5afe0904b251c5d31080eab18