diff --git a/core/types/receipt_test.go b/core/types/receipt_test.go index 534399a91e..a7b2644471 100644 --- a/core/types/receipt_test.go +++ b/core/types/receipt_test.go @@ -28,6 +28,7 @@ import ( "github.com/ethereum/go-ethereum/params" "github.com/ethereum/go-ethereum/rlp" "github.com/holiman/uint256" + "github.com/kylelemons/godebug/diff" ) var ( @@ -325,8 +326,9 @@ func TestDeriveFields(t *testing.T) { if err != nil { t.Fatal("error marshaling derived receipts:", err) } - if string(r1) != string(r2) { - t.Fatalf("receipts differ: got %v want %v", string(r1), string(r2)) + d := diff.Diff(string(r1), string(r2)) + if d != "" { + t.Fatal("receipts differ:", d) } } diff --git a/go.mod b/go.mod index f7430ef8b8..f59ce2d079 100644 --- a/go.mod +++ b/go.mod @@ -47,6 +47,7 @@ require ( github.com/jedisct1/go-minisign v0.0.0-20230811132847-661be99b8267 github.com/julienschmidt/httprouter v1.3.0 github.com/karalabe/usb v0.0.2 + github.com/kylelemons/godebug v1.1.0 github.com/mattn/go-colorable v0.1.13 github.com/mattn/go-isatty v0.0.17 github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416 diff --git a/go.sum b/go.sum index 0a6bf7cf96..5aa1459fef 100644 --- a/go.sum +++ b/go.sum @@ -413,6 +413,7 @@ github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= +github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= github.com/labstack/echo/v4 v4.1.11/go.mod h1:i541M3Fj6f76NZtHSj7TXnyM8n2gaodfvfxNnFqi74g= github.com/labstack/echo/v4 v4.2.1/go.mod h1:AA49e0DZ8kk5jTOOCKNuPR6oTnBS0dYiM4FW1e6jwpg= github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k=