Skip to content

Commit

Permalink
dbft: remove Timestamp() API from dbft.ChangeView interface
Browse files Browse the repository at this point in the history
This API is unused by dBFT. If a user needs to access ChangeView
timestamp, he has to convert dbft.ChangeView to the user-defined
ChangeView implementation.

A part of #84.

Signed-off-by: Anna Shaleva <[email protected]>
  • Loading branch information
AnnaShaleva committed Mar 6, 2024
1 parent f3de891 commit 32e1df2
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 9 deletions.
3 changes: 0 additions & 3 deletions change_view.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ type ChangeView interface {
// NewViewNumber returns proposed view number.
NewViewNumber() byte

// Timestamp returns message's timestamp.
Timestamp() uint64

// Reason returns change view reason.
Reason() ChangeViewReason
}
5 changes: 0 additions & 5 deletions internal/consensus/change_view.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ func (c changeView) NewViewNumber() byte {
return c.newViewNumber
}

// Timestamp implements ChangeView interface.
func (c changeView) Timestamp() uint64 {
return secToNanoSec(c.timestamp)
}

// Reason implements ChangeView interface.
func (c changeView) Reason() dbft.ChangeViewReason {
return dbft.CVUnknown
Expand Down
1 change: 0 additions & 1 deletion internal/consensus/message_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,6 @@ func TestPayload_Setters(t *testing.T) {
t.Run("ChangeView", func(t *testing.T) {
cv := NewChangeView(4, 0, secToNanoSec(1234))

assert.EqualValues(t, secToNanoSec(1234), cv.Timestamp())
assert.EqualValues(t, 4, cv.NewViewNumber())
})

Expand Down

0 comments on commit 32e1df2

Please sign in to comment.