Skip to content

Commit

Permalink
make sure hex output is padded properly
Browse files Browse the repository at this point in the history
  • Loading branch information
ggrieco-tob committed Sep 18, 2023
1 parent 298f954 commit 7807107
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Echidna/ABI.hs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import Data.List (intercalate)
import Data.List.NonEmpty (NonEmpty)
import Data.List.NonEmpty qualified as NE
import Data.Maybe (fromMaybe, catMaybes)
import Text.Printf (printf)
import Data.Text (Text)
import Data.Text qualified as T
import Data.Text.Encoding (encodeUtf8)
Expand Down Expand Up @@ -71,7 +72,7 @@ ppAbiValue = \case
AbiInt _ n -> show n
AbiAddress n -> "0x" <> showHex n ""
AbiBool b -> if b then "true" else "false"
AbiBytes 32 b -> "0x" <> BS.foldr showHex "" b
AbiBytes 32 b -> "0x" <> (BS.foldr (\x -> (<>) (printf "%02x" x)) "" b)
AbiBytes _ b -> show b
AbiBytesDynamic b -> show b
AbiString s -> show s
Expand Down

0 comments on commit 7807107

Please sign in to comment.