From 1920e6cb00f93f103944a4ec164b2f0b112475b8 Mon Sep 17 00:00:00 2001 From: La Ancapo <> Date: Sun, 1 Feb 2026 03:45:54 +0100 Subject: [PATCH] show hash memos as hexadecimal --- src/Pretty.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Pretty.hs b/src/Pretty.hs index 7bb933d..95d22ca 100644 --- a/src/Pretty.hs +++ b/src/Pretty.hs @@ -1,4 +1,3 @@ - {-# LANGUAGE OverloadedStrings, Strict #-} module Pretty where @@ -13,7 +12,9 @@ import qualified Data.Vector as V import Network.ONCRPC.XDR.Array import Network.Stellar.Keypair (encodeKey, EncodingVersion(..)) import Network.Stellar.TransactionXdr +import Numeric +b16 = T.pack . concatMap (\x -> (if x < 16 then "0" else "") ++ showHex x "") . B.unpack . unLengthArray b32 = encodeBase32 . unLengthArray utf8s = T.decodeUtf8Lenient . unLengthArray prettyKey x = encodeKey EncodingAccount $ unLengthArray x @@ -54,7 +55,7 @@ instance Pretty Transaction where instance Pretty Memo where pretty Memo'MEMO_NONE = "" pretty (Memo'MEMO_ID x) = T.show x - pretty (Memo'MEMO_HASH x) = T.show x + pretty (Memo'MEMO_HASH x) = b16 x pretty (Memo'MEMO_RETURN x) = T.show x pretty (Memo'MEMO_TEXT t) = utf8s t