diff --git a/core/types/rlp_backwards_compat.libevm_test.go b/core/types/rlp_backwards_compat.libevm_test.go index ef758c50682b9..9eb12e5dee5ce 100644 --- a/core/types/rlp_backwards_compat.libevm_test.go +++ b/core/types/rlp_backwards_compat.libevm_test.go @@ -149,25 +149,24 @@ func TestBodyRLPBackwardsCompatibility(t *testing.T) { for _, body := range bodies { t.Run("", func(t *testing.T) { - t.Logf("\n%s", pretty.Sprint(body)) - // The original [Body] doesn't implement [rlp.Encoder] nor // [rlp.Decoder] so we can use a methodless equivalent as the gold // standard. type withoutMethods Body wantRLP, err := rlp.EncodeToBytes((*withoutMethods)(body)) - require.NoErrorf(t, err, "rlp.EncodeToBytes([%T with methods stripped])", body) + require.NoErrorf(t, err, "rlp.EncodeToBytes([%T with methods stripped]) - body %s", body, pretty.Sprint(body)) t.Run("Encode", func(t *testing.T) { got, err := rlp.EncodeToBytes(body) - require.NoErrorf(t, err, "rlp.EncodeToBytes(%#v)", body) - assert.Equalf(t, wantRLP, got, "rlp.EncodeToBytes(%#v)", body) + require.NoErrorf(t, err, "rlp.EncodeToBytes(%s)", pretty.Sprint(body)) + assert.Equalf(t, wantRLP, got, "rlp.EncodeToBytes(%s)", pretty.Sprint(body)) }) t.Run("Decode", func(t *testing.T) { got := new(Body) err := rlp.DecodeBytes(wantRLP, got) - require.NoErrorf(t, err, "rlp.DecodeBytes(%v, %T)", wantRLP, got) + require.NoErrorf(t, err, "rlp.DecodeBytes(rlp.EncodeToBytes(%s), %T) resulted in %s", + pretty.Sprint(body), got, pretty.Sprint(got)) // Note we do not specify field names to enforce all fields are set. gotWithoutExtra := testBodyWithoutExtra{ @@ -194,7 +193,7 @@ func TestBodyRLPBackwardsCompatibility(t *testing.T) { cmpeth.CompareTransactionsByBinary(t), } if diff := cmp.Diff(want, gotWithoutExtra, opts); diff != "" { - t.Errorf("rlp.DecodeBytes(rlp.EncodeToBytes(%#v)) diff (-want +got):\n%s", want, diff) + t.Errorf("rlp.DecodeBytes(rlp.EncodeToBytes(%s)) diff (-want +got):\n%s", pretty.Sprint(want), diff) } }) })