This repository has been archived by the owner on Aug 16, 2021. It is now read-only.
/
SmartContractPoABlockDefinition.cs
49 lines (46 loc) · 1.86 KB
/
SmartContractPoABlockDefinition.cs
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
using Microsoft.Extensions.Logging;
using NBitcoin;
using Stratis.Bitcoin.Consensus;
using Stratis.Bitcoin.Features.Consensus.CoinViews;
using Stratis.Bitcoin.Features.MemoryPool;
using Stratis.Bitcoin.Features.MemoryPool.Interfaces;
using Stratis.Bitcoin.Features.Miner;
using Stratis.Bitcoin.Features.PoA.BasePoAFeatureConsensusRules;
using Stratis.Bitcoin.Features.SmartContracts.PoW;
using Stratis.Bitcoin.Utilities;
using Stratis.SmartContracts.Core;
using Stratis.SmartContracts.Core.State;
using Stratis.SmartContracts.Core.Util;
namespace Stratis.Bitcoin.Features.SmartContracts.PoA
{
/// <summary>
/// Pushes everything to the <see cref="SmartContractBlockDefinition"/>, just amends the block difficulty for PoA.
/// </summary>
public class SmartContractPoABlockDefinition : SmartContractBlockDefinition
{
public SmartContractPoABlockDefinition(
IBlockBufferGenerator blockBufferGenerator,
ICoinView coinView,
IConsensusManager consensusManager,
IDateTimeProvider dateTimeProvider,
IContractExecutorFactory executorFactory,
ILoggerFactory loggerFactory,
ITxMempool mempool,
MempoolSchedulerLock mempoolLock,
Network network,
ISenderRetriever senderRetriever,
IStateRepositoryRoot stateRoot,
MinerSettings minerSettings)
: base(blockBufferGenerator, coinView, consensusManager, dateTimeProvider, executorFactory, loggerFactory, mempool,
mempoolLock, minerSettings, network, senderRetriever, stateRoot)
{
// TODO: Fix gross MinerSettings injection ^^
}
/// <inheritdoc/>
public override void UpdateHeaders()
{
base.UpdateHeaders();
this.block.Header.Bits = PoAHeaderDifficultyRule.PoABlockDifficulty;
}
}
}