From 13d52d4241be4088e0c6a41b1b8ccb6c5df7c80a Mon Sep 17 00:00:00 2001 From: Peter Broadhurst Date: Wed, 23 Oct 2024 21:05:04 -0400 Subject: [PATCH] Format bytes/addresses in errors with 0x Signed-off-by: Peter Broadhurst --- pkg/abi/abi.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/abi/abi.go b/pkg/abi/abi.go index 6f68dd23..ece7b8ad 100644 --- a/pkg/abi/abi.go +++ b/pkg/abi/abi.go @@ -352,7 +352,11 @@ func (a ABI) ErrorStringCtx(ctx context.Context, revertData []byte) (strError st func FormatErrorStringCtx(ctx context.Context, e *Entry, cv *ComponentValue) string { var ok bool var parsed []interface{} - if res, err := NewSerializer().SetFormattingMode(FormatAsFlatArrays).SerializeInterfaceCtx(ctx, cv); err == nil { + if res, err := NewSerializer(). + SetFormattingMode(FormatAsFlatArrays). + SetIntSerializer(Base10StringIntSerializer). + SetAddressSerializer(HexAddrSerializer0xPrefix). + SerializeInterfaceCtx(ctx, cv); err == nil { parsed, ok = res.([]interface{}) } buff := new(strings.Builder)