Skip to content

Commit

Permalink
Format bytes/addresses in errors with 0x
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Broadhurst <peter.broadhurst@kaleido.io>
  • Loading branch information
peterbroadhurst committed Oct 24, 2024
1 parent eafd71c commit 13d52d4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/abi/abi.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 13d52d4

Please sign in to comment.