Skip to content

Commit

Permalink
Cleanup unused methods
Browse files Browse the repository at this point in the history
  • Loading branch information
poszu committed Jun 26, 2024
1 parent 30dab3a commit b55ef60
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 23 deletions.
6 changes: 3 additions & 3 deletions activation/handler_v2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ func TestHandlerV2_ProcessSoloATX(t *testing.T) {

atxFromDb, err := atxs.Get(atxHandler.cdb, atx.ID())
require.NoError(t, err)
require.Equal(t, atx.TotalNumUnits(), atxFromDb.TotalNumUnits())
require.Equal(t, atx.TotalNumUnits(), atxFromDb.NumUnits)
})
t.Run("second ATX, increases space (nonce valid)", func(t *testing.T) {
t.Parallel()
Expand All @@ -553,7 +553,7 @@ func TestHandlerV2_ProcessSoloATX(t *testing.T) {
atxFromDb, err := atxs.Get(atxHandler.cdb, atx.ID())
require.NoError(t, err)
require.EqualValues(t, atx.VRFNonce, atxFromDb.VRFNonce)
require.Equal(t, min(prev.TotalNumUnits(), atx.TotalNumUnits()), atxFromDb.TotalNumUnits())
require.Equal(t, min(prev.TotalNumUnits(), atx.TotalNumUnits()), atxFromDb.NumUnits)
})
t.Run("second ATX, increases space (nonce invalid)", func(t *testing.T) {
t.Parallel()
Expand Down Expand Up @@ -598,7 +598,7 @@ func TestHandlerV2_ProcessSoloATX(t *testing.T) {
// verify that the ATX was added to the DB and it has the lower effective num units
atxFromDb, err := atxs.Get(atxHandler.cdb, atx.ID())
require.NoError(t, err)
require.Equal(t, min(prev.TotalNumUnits(), atx.TotalNumUnits()), atxFromDb.TotalNumUnits())
require.Equal(t, min(prev.TotalNumUnits(), atx.TotalNumUnits()), atxFromDb.NumUnits)
require.EqualValues(t, atx.VRFNonce, atxFromDb.VRFNonce)
})
t.Run("can't find positioning ATX", func(t *testing.T) {
Expand Down
8 changes: 0 additions & 8 deletions activation/wire/wire_v1.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,6 @@ func (atx *ActivationTxV1) SetID(id types.ATXID) {
atx.id = id
}

func (atx *ActivationTxV1) Published() types.EpochID {
return atx.PublishEpoch
}

func (atx *ActivationTxV1) TotalNumUnits() uint32 {
return atx.NumUnits
}

func (atx *ActivationTxV1) Sign(signer *signing.EdSigner) {
if atx.PrevATXID == types.EmptyATXID {
nodeID := signer.NodeID()
Expand Down
4 changes: 0 additions & 4 deletions activation/wire/wire_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,6 @@ func (atx *ActivationTxV2) Sign(signer *signing.EdSigner) {
atx.Signature = signer.Sign(signing.ATX, atx.SignedBytes())
}

func (atx *ActivationTxV2) Published() types.EpochID {
return atx.PublishEpoch
}

func (atx *ActivationTxV2) TotalNumUnits() uint32 {
var total uint32
for _, post := range atx.NiPosts {
Expand Down
8 changes: 0 additions & 8 deletions common/types/activation.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,6 @@ func (atx *ActivationTx) TargetEpoch() EpochID {
return atx.PublishEpoch + 1
}

func (atx *ActivationTx) Published() EpochID {
return atx.PublishEpoch
}

func (atx *ActivationTx) TotalNumUnits() uint32 {
return atx.NumUnits
}

// Golden returns true if atx is from a checkpoint snapshot.
// a golden ATX is not verifiable, and is only allowed to be prev atx or positioning atx.
func (atx *ActivationTx) Golden() bool {
Expand Down

0 comments on commit b55ef60

Please sign in to comment.