mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
parent
fae15a51b5
commit
a997425b03
3 changed files with 5 additions and 5 deletions
|
|
@ -22,7 +22,6 @@ import (
|
|||
"fmt"
|
||||
"math/big"
|
||||
"os"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/XinFinOrg/XDPoSChain/common"
|
||||
|
|
@ -580,7 +579,7 @@ func testPrecompiledFailure(addr string, test precompiledFailureTest, t *testing
|
|||
gas := p.RequiredGas(in)
|
||||
t.Run(test.name, func(t *testing.T) {
|
||||
_, _, err := RunPrecompiledContract(nil, p, in, gas)
|
||||
if !reflect.DeepEqual(err, test.expectedError) {
|
||||
if err.Error() != test.expectedError.Error() {
|
||||
t.Errorf("Expected error [%v], got [%v]", test.expectedError, err)
|
||||
}
|
||||
// Verify that the precompile did not touch the input buffer
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ package p2p
|
|||
|
||||
import (
|
||||
"crypto/ecdsa"
|
||||
"errors"
|
||||
"math/rand"
|
||||
"net"
|
||||
"reflect"
|
||||
|
|
@ -563,7 +564,7 @@ func TestServerSetupConn(t *testing.T) {
|
|||
}
|
||||
p1, _ := net.Pipe()
|
||||
srv.SetupConn(p1, test.flags, test.dialDest)
|
||||
if !reflect.DeepEqual(test.tt.closeErr, test.wantCloseErr) {
|
||||
if !errors.Is(test.tt.closeErr, test.wantCloseErr) {
|
||||
t.Errorf("test %d: close error mismatch: got %q, want %q", i, test.tt.closeErr, test.wantCloseErr)
|
||||
}
|
||||
if test.tt.calls != test.wantCalls {
|
||||
|
|
|
|||
|
|
@ -18,13 +18,13 @@ package rpc
|
|||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"net/http/httputil"
|
||||
"net/url"
|
||||
"reflect"
|
||||
"strings"
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
|
|
@ -69,7 +69,7 @@ func TestWebsocketOriginCheck(t *testing.T) {
|
|||
t.Fatal("no error for wrong origin")
|
||||
}
|
||||
wantErr := wsHandshakeError{websocket.ErrBadHandshake, "403 Forbidden"}
|
||||
if !reflect.DeepEqual(err, wantErr) {
|
||||
if !errors.Is(err, wantErr) {
|
||||
t.Fatalf("wrong error for wrong origin: %q", err)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue