From b254c6743dc56638909c1ff982c1ccca2369f76a Mon Sep 17 00:00:00 2001 From: Michael Ira Krufky Date: Mon, 5 Aug 2019 07:41:20 -0400 Subject: [PATCH] ethash: fix undefined `Sha3Hash` function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `Sha3Hash` function was removed from go-ethereum in the 1.6.x series: commit 72dd51e25a5c1553a5a7fc5f0fb84fbe3546682f Author: Péter Szilágyi Date: Thu Jun 1 10:24:40 2017 +0300 Now we can just call `crypto.Keccak256Hash` directly. --- ethash.go | 2 +- ethash_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ethash.go b/ethash.go index 21c10c87..4924a4d2 100644 --- a/ethash.go +++ b/ethash.go @@ -433,7 +433,7 @@ func GetSeedHash(blockNum uint64) ([]byte, error) { func makeSeedHash(epoch uint64) (sh common.Hash) { for ; epoch > 0; epoch-- { - sh = crypto.Sha3Hash(sh[:]) + sh = crypto.Keccak256Hash(sh[:]) } return sh } diff --git a/ethash_test.go b/ethash_test.go index e0ca0bd8..f7929ed1 100644 --- a/ethash_test.go +++ b/ethash_test.go @@ -79,10 +79,10 @@ var validBlocks = []*testBlock{ var invalidZeroDiffBlock = testBlock{ number: 61440000, - hashNoNonce: crypto.Sha3Hash([]byte("foo")), + hashNoNonce: crypto.Keccak256Hash([]byte("foo")), difficulty: big.NewInt(0), nonce: 0xcafebabec00000fe, - mixDigest: crypto.Sha3Hash([]byte("bar")), + mixDigest: crypto.Keccak256Hash([]byte("bar")), } func TestEthashVerifyValid(t *testing.T) {