Correct parsing of YWallet memos

This commit is contained in:
Rene Vergara 2022-08-29 10:33:38 -05:00
parent 86ba0a1f0f
commit ca01dd0a14
Signed by: pitmutt
GPG key ID: 65122AD495A7F5B2

View file

@ -325,7 +325,7 @@ zToZGoTx (ZcashTx t a aZ bh bt c conf m) = do
".*ZGOp::([0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}).*" ".*ZGOp::([0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}).*"
let y = let y =
mkRegex mkRegex
".*MSG\\s(zs[a-z0-9]{76}).*ZGO::([0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}).*" ".*MSG\\s(zs[a-z0-9]{76})\\sZGO::([0-9a-fA-F]{8}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{4}\\b-[0-9a-fA-F]{12}).*"
let reg = matchAllText r (T.unpack m) let reg = matchAllText r (T.unpack m)
let reg2 = matchAllText p (T.unpack m) let reg2 = matchAllText p (T.unpack m)
let reg3 = matchAllText y (T.unpack m) let reg3 = matchAllText y (T.unpack m)
@ -342,8 +342,8 @@ zToZGoTx (ZcashTx t a aZ bh bt c conf m) = do
else do else do
if not (null reg3) if not (null reg3)
then do then do
let sess = T.pack (fst $ head reg ! 2) let sess = T.pack (fst $ head reg3 ! 2)
let nAddy = T.pack (fst $ head reg ! 1) let nAddy = T.pack (fst $ head reg3 ! 1)
ZGoTx Nothing nAddy sess conf bt a t m ZGoTx Nothing nAddy sess conf bt a t m
else ZGoTx Nothing "" "" conf bt a t m else ZGoTx Nothing "" "" conf bt a t m