Implement Sapling decoding
This commit is contained in:
parent
3ed60ae2dd
commit
0224db1993
1 changed files with 8 additions and 6 deletions
|
@ -1836,7 +1836,7 @@ scanTxNative pipe db nodeUser nodePwd = do
|
|||
blockList <-
|
||||
mapM
|
||||
(getBlockInfo nodeUser nodePwd . T.pack . show)
|
||||
[2243000 .. (bl_height lB)]
|
||||
[((bl_height lB) - 50) .. (bl_height lB)]
|
||||
print "filtering blocks..."
|
||||
let filteredBlockList = filter filterBlock blockList
|
||||
print "extracting txs from blocks..."
|
||||
|
@ -1876,19 +1876,21 @@ scanTxNative pipe db nodeUser nodePwd = do
|
|||
return Nothing
|
||||
checkTx :: [RawTxResponse] -> T.Text -> IO ()
|
||||
checkTx txList' k = do
|
||||
let sOutList = concatMap rt_shieldedOutputs txList'
|
||||
if isValidSaplingViewingKey (E.encodeUtf8 k)
|
||||
then do
|
||||
print "decoding Sapling tx"
|
||||
print txList'
|
||||
let decodedSapList' =
|
||||
map
|
||||
(decodeSaplingOutput (bytes (decodeBech32 $ E.encodeUtf8 k)))
|
||||
sOutList
|
||||
print decodedSapList'
|
||||
else do
|
||||
let vk = decodeUfvk $ E.encodeUtf8 k
|
||||
case vk of
|
||||
Nothing -> print "Not a valid key"
|
||||
Just v -> do
|
||||
let decodedSapList =
|
||||
map
|
||||
(decodeSaplingOutput (s_key v))
|
||||
(concatMap rt_shieldedOutputs txList')
|
||||
let decodedSapList = map (decodeSaplingOutput (s_key v)) sOutList
|
||||
print decodedSapList
|
||||
let decodedOrchList =
|
||||
map
|
||||
|
|
Loading…
Reference in a new issue