Correct data type for `getblock`

This commit is contained in:
Rene Vergara 2023-09-28 13:26:24 -05:00
parent 85bf0fef59
commit fb600aa5fc
Signed by: pitmutt
GPG Key ID: 65122AD495A7F5B2
1 changed files with 4 additions and 4 deletions

View File

@ -1803,14 +1803,14 @@ generateToken = do
runCryptoRNGT rngState $ randomString 24 "abcdef0123456789"
getBlockInfo ::
BS.ByteString -> BS.ByteString -> SC.Scientific -> IO (Maybe BlockResponse)
BS.ByteString -> BS.ByteString -> T.Text -> IO (Maybe BlockResponse)
getBlockInfo nodeUser nodePwd bh = do
blockInfo <-
makeZcashCall
nodeUser
nodePwd
"getblock"
[Number bh, Number $ SC.scientific 1 0]
[Data.Aeson.String bh, Number $ SC.scientific 1 0]
let content = getResponseBody blockInfo :: RpcResponse BlockResponse
if isNothing (err content)
then return $ result content
@ -1825,7 +1825,7 @@ scanTxNative pipe db nodeUser nodePwd = do
let ownerList = cast' . Doc <$> keyOwnerList
let keyList = map (maybe "" oviewkey) ownerList
lastBlockData <- access pipe master db findBlock
latestBlock <- getBlockInfo nodeUser nodePwd (SC.scientific (-1) 0)
latestBlock <- getBlockInfo nodeUser nodePwd "-1"
case latestBlock of
Nothing -> fail "No block data from node"
Just lB -> do
@ -1833,7 +1833,7 @@ scanTxNative pipe db nodeUser nodePwd = do
Nothing -> do
blockList <-
mapM
(getBlockInfo nodeUser nodePwd . fromInteger)
(getBlockInfo nodeUser nodePwd . T.pack . show)
[2220000 .. (bl_height lB)]
let filteredBlockList = filter filterBlock blockList
let txIdList = concatMap extractTxs filteredBlockList