Explorar o código

Changed to use hash for comparison

DeepReflect would fail on TD since TD isn't included in the original
block and thus the test would fail.
obscuren %!s(int64=10) %!d(string=hai) anos
pai
achega
e27237a03a
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      core/chain_manager_test.go

+ 3 - 2
core/chain_manager_test.go

@@ -1,6 +1,7 @@
 package core
 
 import (
+	"bytes"
 	"fmt"
 	"os"
 	"path"
@@ -76,11 +77,11 @@ func TestChainInsertions(t *testing.T) {
 		<-done
 	}
 
-	if reflect.DeepEqual(chain2[len(chain2)-1], chainMan.CurrentBlock()) {
+	if bytes.Equal(chain2[len(chain2)-1].Hash(), chainMan.CurrentBlock().Hash()) {
 		t.Error("chain2 is canonical and shouldn't be")
 	}
 
-	if !reflect.DeepEqual(chain1[len(chain1)-1], chainMan.CurrentBlock()) {
+	if !bytes.Equal(chain1[len(chain1)-1].Hash(), chainMan.CurrentBlock().Hash()) {
 		t.Error("chain1 isn't canonical and should be")
 	}
 }