Skip to content

Commit

Permalink
Remove the unused Height property from (I)Block
Browse files Browse the repository at this point in the history
  • Loading branch information
Coding-Enthusiast committed Sep 19, 2024
1 parent 6a28f2e commit 937c720
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 20 deletions.
3 changes: 0 additions & 3 deletions Src/Autarkysoft.Bitcoin/Blockchain/Blocks/Block.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ public Block(in BlockHeader header, ITransaction[] txs)
}


/// <inheritdoc/>
public int Height { get; set; } = -1;

/// <inheritdoc/>
public int TotalSize
{
Expand Down
6 changes: 0 additions & 6 deletions Src/Autarkysoft.Bitcoin/Blockchain/Blocks/IBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,6 @@ namespace Autarkysoft.Bitcoin.Blockchain.Blocks
/// </summary>
public interface IBlock : IDeserializable
{
/// <summary>
/// This block's height (set before verification using the blockchain tip and the
/// <see cref="BlockHeader.PreviousBlockHeaderHash"/>)
/// </summary>
int Height { get; set; }

/// <summary>
/// Returns total size (block size when serialized)
/// </summary>
Expand Down
11 changes: 0 additions & 11 deletions Src/Tests/Bitcoin/Blockchain/Blocks/BlockTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Xunit;

namespace Tests.Bitcoin.Blockchain.Blocks
{
Expand All @@ -27,16 +26,6 @@ public void ConstructorTest()

Assert.Equal(expHdr, blk.Header);
Assert.Same(expTxs, blk.TransactionList);
Assert.Equal(-1, blk.Height);
}

[Fact]
public void Constructor_HeightTest()
{
Block blk = new();
Assert.Equal(-1, blk.Height);
blk.Height = 10;
Assert.Equal(10, blk.Height);
}

[Fact]
Expand Down

0 comments on commit 937c720

Please sign in to comment.