From 152bb6f1451ec4846652640836894757cd3fac9c Mon Sep 17 00:00:00 2001 From: Hussam Date: Thu, 21 Nov 2024 15:35:19 -0600 Subject: [PATCH] mt --- core/types/wo.go | 2 +- core/types/wo_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/types/wo.go b/core/types/wo.go index b7e776cce..6ad6fa040 100644 --- a/core/types/wo.go +++ b/core/types/wo.go @@ -1088,7 +1088,7 @@ func (wh *WorkObjectHeader) Hash() (hash common.Hash) { hasher.Reset() var hData [32 + 32 + 8]byte copy(hData[:], wh.MixHash().Bytes()) - copy(hData[:], wh.Nonce().Bytes()) + copy(hData[len(wh.mixHash):], wh.Nonce().Bytes()) copy(hData[len(wh.mixHash)+len(wh.nonce):], sealHash) sum := blake3.Sum256(hData[:]) hash.SetBytes(sum[:]) diff --git a/core/types/wo_test.go b/core/types/wo_test.go index 8b17e0d16..9d6d14ad2 100644 --- a/core/types/wo_test.go +++ b/core/types/wo_test.go @@ -31,7 +31,7 @@ func woTestData() (*WorkObject, common.Hash) { } var ( - expectedWoHash = common.HexToHash("0x7a107825db4e54d262248b6d619679a94e8235a2ae01fd06b4e3819179b81d3a") + expectedWoHash = common.HexToHash("0xa15b8e777efe3a2fc09a2e9398495b7f2c8567b66859ad2410453eaf420f32f7") expectedUncleHash = common.HexToHash("0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347") expectedPETXProtoBytes = []byte{ 0x0a, 0xc0, 0x01, 0x0a, 0x22, 0x0a, 0x20, 0x97, 0xb8, 0xd8, 0x2d, 0x3f, 0x97, 0x82, 0x7d, 0x2f, @@ -256,7 +256,7 @@ func TestCalcUncleHash(t *testing.T) { { uncleNum: 5, expectedUncleHash: common.HexToHash("0x3c9dd26495f9a6ddf36e1443bee2ff0a3bb59b0722a765b145d01ab1f78ccd44"), - expectedWoHash: common.HexToHash("0x0cf899993d6dd984fdc862a159d2740562c266712d5505168480bade496816b2"), + expectedWoHash: common.HexToHash("0xc56d8061c19ee24920a2039cb113e4fb27a5b4b02bd7f1a6045811366fa26fde"), shouldPass: true, }, }