diff --git a/p2p/transport/webtransport/transport_test.go b/p2p/transport/webtransport/transport_test.go index f58f6cc009..e723820465 100644 --- a/p2p/transport/webtransport/transport_test.go +++ b/p2p/transport/webtransport/transport_test.go @@ -179,7 +179,7 @@ func TestHashVerification(t *testing.T) { var trErr *quic.TransportError require.ErrorAs(t, err, &trErr) require.Equal(t, quic.TransportErrorCode(0x12a), trErr.ErrorCode) - require.Contains(t, errors.Unwrap(trErr).Error(), "cert hash not found") + require.ErrorContains(t, trErr, "cert hash not found") }) t.Run("fails when adding a wrong hash", func(t *testing.T) {