add cache check

This commit is contained in:
Martin Holst Swende 2020-01-20 21:35:25 +01:00
parent 996c4d1319
commit b1756c4312
No known key found for this signature in database
GPG key ID: 683B438C05A5DDF0

View file

@ -204,8 +204,13 @@ func TestEthashVerification(t *testing.T) {
fmt.Printf("result: %x\n", result) fmt.Printf("result: %x\n", result)
fmt.Println() fmt.Println()
fmt.Printf("digest: %x\n", digest) fmt.Printf("digest: %x\n", digest)
expDigest,_ := hexutil.Decode("07e6a1aad4823428980e8229335085c6e45599f3d65951ce7c796ad87081eb72") expDigest, _ := hexutil.Decode("07e6a1aad4823428980e8229335085c6e45599f3d65951ce7c796ad87081eb72")
if bytes.Equal(expDigest, digest){ if bytes.Equal(expDigest, digest) {
t.Errorf("Mix digest wrong!, got %x exp %x",digest, expDigest ) t.Errorf("Mix digest wrong!, got %x exp %x", digest, expDigest)
} }
sum := uint32(0)
for _, val := range cache.cache {
sum = sum ^ val
}
fmt.Printf("xor sum of cache contents: %x\n", sum)
} }