File tree Expand file tree Collapse file tree 2 files changed +6
-15
lines changed Expand file tree Collapse file tree 2 files changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -140,6 +140,7 @@ public IReadOnlyList<ICommittedActionEvaluation> Evaluate(
140
140
var services = new ServiceCollection
141
141
{
142
142
{ typeof ( IEvidenceContext ) , new EvidenceContext ( ) } ,
143
+ { typeof ( IBlockContext ) , new BlockContext ( block ) } ,
143
144
} ;
144
145
evaluations = evaluations . AddRange ( EvaluatePolicyBeginBlockActions (
145
146
block , services , previousState
Original file line number Diff line number Diff line change 1
1
using System ;
2
- using Libplanet . Crypto ;
3
2
using Libplanet . Types . Blocks ;
4
3
5
4
namespace Libplanet . Action
6
5
{
7
6
public interface IBlockContext
8
7
{
9
- Address Miner { get ; }
10
-
11
8
long Height { get ; }
12
9
13
10
int ProtocolVersion { get ; }
@@ -19,21 +16,14 @@ public interface IBlockContext
19
16
20
17
internal sealed class BlockContext : IBlockContext
21
18
{
22
- public BlockContext (
23
- Address miner ,
24
- long blockIndex ,
25
- int blockProtocolVersion ,
26
- BlockCommit ? lastCommit
27
- )
19
+ public BlockContext ( IPreEvaluationBlock preEvaluationBlock )
28
20
{
29
- Miner = miner ;
30
- Height = blockIndex ;
31
- ProtocolVersion = blockProtocolVersion ;
32
- LastCommit = lastCommit ;
21
+ Height = preEvaluationBlock . Index ;
22
+ ProtocolVersion = preEvaluationBlock . ProtocolVersion ;
23
+ LastCommit = preEvaluationBlock . LastCommit ;
24
+ Timestamp = preEvaluationBlock . Timestamp ;
33
25
}
34
26
35
- public Address Miner { get ; }
36
-
37
27
public long Height { get ; }
38
28
39
29
public int ProtocolVersion { get ; }
You can’t perform that action at this time.
0 commit comments