forked from NethermindEth/nethermind
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUnclesHash.cs
More file actions
26 lines (23 loc) · 731 Bytes
/
UnclesHash.cs
File metadata and controls
26 lines (23 loc) · 731 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// SPDX-FileCopyrightText: 2022 Demerzel Solutions Limited
// SPDX-License-Identifier: LGPL-3.0-only
using Nethermind.Core;
using Nethermind.Core.Crypto;
using Nethermind.Serialization.Rlp;
namespace Nethermind.Blockchain
{
public static class UnclesHash
{
public static Hash256 Calculate(Block block)
{
return block.Uncles.Length == 0
? Keccak.OfAnEmptySequenceRlp
: Keccak.Compute(Rlp.Encode(block.Uncles).Bytes);
}
public static Hash256 Calculate(BlockHeader[] uncles)
{
return uncles.Length == 0
? Keccak.OfAnEmptySequenceRlp
: Keccak.Compute(Rlp.Encode(uncles).Bytes);
}
}
}