< Summary

Information
Class: EF.Blockchain.Domain.BlockInfo
Assembly: EF.Blockchain.Domain
File(s): C:\dev\@web3\web3-001-ef-blockchain\backend\EF.Blockchain\src\EF.Blockchain.Domain\BlockInfo.cs
Line coverage
100%
Covered lines: 15
Uncovered lines: 0
Coverable lines: 15
Total lines: 56
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
get_Index()100%11100%
get_PreviousHash()100%11100%
get_Difficulty()100%11100%
get_MaxDifficulty()100%11100%
get_FeePerTx()100%11100%
get_Transactions()100%11100%
.ctor(...)100%11100%

File(s)

C:\dev\@web3\web3-001-ef-blockchain\backend\EF.Blockchain\src\EF.Blockchain.Domain\BlockInfo.cs

#LineLine coverage
 1namespace EF.Blockchain.Domain;
 2
 3/// <summary>
 4/// Represents the metadata required to create or mine the next block in the blockchain.
 5/// </summary>
 6public class BlockInfo
 7{
 8    /// <summary>
 9    /// Index of the next block to be mined.
 10    /// </summary>
 67211    public int Index { get; private set; }
 12
 13    /// <summary>
 14    /// Hash of the last confirmed block in the chain.
 15    /// </summary>
 99216    public string PreviousHash { get; private set; } = string.Empty;
 17
 18    /// <summary>
 19    /// Current difficulty level for mining.
 20    /// </summary>
 64821    public int Difficulty { get; private set; }
 22
 23    /// <summary>
 24    /// Maximum allowed difficulty in the network.
 25    /// </summary>
 34426    public int MaxDifficulty { get; private set; }
 27
 28    /// <summary>
 29    /// Fee applied per transaction included in the block.
 30    /// </summary>
 64831    public int FeePerTx { get; private set; }
 32
 33    /// <summary>
 34    /// Transactions selected from the mempool for inclusion in the block.
 35    /// </summary>
 68836    public List<Transaction> Transactions { get; private set; } = new();
 37
 38    /// <summary>
 39    /// Initializes a new instance of the <see cref="BlockInfo"/> class.
 40    /// </summary>
 41    /// <param name="index">Index of the block.</param>
 42    /// <param name="previousHash">Hash of the previous block.</param>
 43    /// <param name="difficulty">Current mining difficulty.</param>
 44    /// <param name="maxDifficulty">Maximum difficulty allowed.</param>
 45    /// <param name="feePerTx">Fee per transaction.</param>
 46    /// <param name="transactions">Transactions included in the block.</param>
 33647    public BlockInfo(int index, string previousHash, int difficulty, int maxDifficulty, int feePerTx, List<Transaction> 
 33648    {
 33649        Index = index;
 33650        PreviousHash = previousHash;
 33651        Difficulty = difficulty;
 33652        MaxDifficulty = maxDifficulty;
 33653        FeePerTx = feePerTx;
 33654        Transactions = transactions;
 33655    }
 56}