mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-23 13:16:42 +00:00
core: remove redundant isVerkle branch in getContractStoredBlockHash
This commit is contained in:
parent
7d8ccddaac
commit
0f022048a3
1 changed files with 2 additions and 5 deletions
|
|
@ -247,7 +247,7 @@ func TestProcessParentBlockHash(t *testing.T) {
|
|||
}
|
||||
// Read block hashes for block 0 .. num-1
|
||||
for i := 0; i < num; i++ {
|
||||
have, want := getContractStoredBlockHash(statedb, uint64(i), isVerkle), common.Hash{byte(i + 1)}
|
||||
have, want := getContractStoredBlockHash(statedb, uint64(i)), common.Hash{byte(i + 1)}
|
||||
if have != want {
|
||||
t.Errorf("block %d, verkle=%v, have parent hash %v, want %v", i, isVerkle, have, want)
|
||||
}
|
||||
|
|
@ -268,13 +268,10 @@ func TestProcessParentBlockHash(t *testing.T) {
|
|||
}
|
||||
|
||||
// getContractStoredBlockHash is a utility method which reads the stored parent blockhash for block 'number'
|
||||
func getContractStoredBlockHash(statedb *state.StateDB, number uint64, isVerkle bool) common.Hash {
|
||||
func getContractStoredBlockHash(statedb *state.StateDB, number uint64) common.Hash {
|
||||
ringIndex := number % params.HistoryServeWindow
|
||||
var key common.Hash
|
||||
binary.BigEndian.PutUint64(key[24:], ringIndex)
|
||||
if isVerkle {
|
||||
return statedb.GetState(params.HistoryStorageAddress, key)
|
||||
}
|
||||
return statedb.GetState(params.HistoryStorageAddress, key)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue