From 441f8ed70c54d10767741af999c2df116c490d66 Mon Sep 17 00:00:00 2001 From: Daniel Liu Date: Thu, 19 Dec 2024 11:01:21 +0800 Subject: [PATCH] common: add variable MaxHash (#28306) --- common/types.go | 3 +++ core/state_processor_test.go | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/common/types.go b/common/types.go index 5f9f58b18e..60977e8486 100644 --- a/common/types.go +++ b/common/types.go @@ -54,6 +54,9 @@ const ( ) var ( + // MaxHash represents the maximum possible hash value. + MaxHash = HexToHash("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff") + BlockSignersBinary = Address{19: 0x89} // xdc0000000000000000000000000000000000000089 MasternodeVotingSMCBinary = Address{19: 0x88} // xdc0000000000000000000000000000000000000088 RandomizeSMCBinary = Address{19: 0x90} // xdc0000000000000000000000000000000000000090 diff --git a/core/state_processor_test.go b/core/state_processor_test.go index cce4016752..6de370ec98 100644 --- a/core/state_processor_test.go +++ b/core/state_processor_test.go @@ -90,7 +90,7 @@ func TestStateProcessorErrors(t *testing.T) { blockchain, _ = NewBlockChain(db, nil, gspec.Config, ethash.NewFaker(), vm.Config{}) ) defer blockchain.Stop() - bigNumber := new(big.Int).SetBytes(common.FromHex("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")) + bigNumber := new(big.Int).SetBytes(common.MaxHash.Bytes()) tooBigNumber := new(big.Int).Set(bigNumber) tooBigNumber.Add(tooBigNumber, common.Big1) for i, tt := range []struct {