Skip to content

Commit

Permalink
dbft: remove Timestamp() block API
Browse files Browse the repository at this point in the history
It's unused by dBFT, and thus, it's not needed in this interface. If
this property is used by dBFT user, then the user need to convert dBFT
Block to user's Block and retrieve all necessary info.

A part of #84.

Signed-off-by: Anna Shaleva <[email protected]>
  • Loading branch information
AnnaShaleva committed Mar 6, 2024
1 parent d49b501 commit f2ac5ce
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 11 deletions.
2 changes: 0 additions & 2 deletions block.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ type Block[H Hash] interface {
PrevHash() H
// MerkleRoot returns a merkle root of the transaction hashes.
MerkleRoot() H
// Timestamp returns block's proposal timestamp.
Timestamp() uint64
// Index returns block index.
Index() uint32
// ConsensusData is a random nonce.
Expand Down
5 changes: 0 additions & 5 deletions internal/block/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ func (b *neoBlock) PrevHash() crypto.Uint256 {
return b.base.PrevHash
}

// Timestamp implements Block interface.
func (b *neoBlock) Timestamp() uint64 {
return uint64(b.base.Timestamp) * 1000000000
}

// Index implements Block interface.
func (b *neoBlock) Index() uint32 {
return b.base.Index
Expand Down
4 changes: 0 additions & 4 deletions internal/block/block_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ func TestNeoBlock_Setters(t *testing.T) {
b.base.MerkleRoot = crypto.Uint256{13}
assert.Equal(t, crypto.Uint256{13}, b.MerkleRoot())

b.base.Timestamp = 1234
// 1234s -> 1234000000000ns
assert.EqualValues(t, uint64(1234000000000), b.Timestamp())

b.base.Index = 100
assert.EqualValues(t, 100, b.Index())

Expand Down

0 comments on commit f2ac5ce

Please sign in to comment.