Skip to content

Commit

Permalink
Refactor: cleaned code
Browse files Browse the repository at this point in the history
  • Loading branch information
hmoog committed Nov 7, 2023
1 parent 8db794c commit f4d229a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
6 changes: 1 addition & 5 deletions pkg/storage/storage_prunable.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,7 @@ func (s *Storage) RestoreFromDisk() {
}

func (s *Storage) Rollback(targetSlot iotago.SlotIndex) error {
if err := s.prunable.Rollback(s.pruningRange(targetSlot)); err != nil {
return ierrors.Wrapf(err, "failed to rollback prunable storage to slot %d", targetSlot)
}

return nil
return s.prunable.Rollback(s.pruningRange(targetSlot))
}

func (s *Storage) pruningRange(targetSlot iotago.SlotIndex) (targetEpoch iotago.EpochIndex, pruneRange [2]iotago.SlotIndex) {
Expand Down
2 changes: 0 additions & 2 deletions pkg/tests/loss_of_acceptance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ func TestLossOfAcceptanceFromGenesis(t *testing.T) {
{
ts.IssueBlocksAtSlots("", []iotago.SlotIndex{58, 59}, 3, "57.2", ts.Nodes("node0", "node1", "node2"), true, nil)

time.Sleep(10 * time.Second)

ts.AssertEqualStoredCommitmentAtIndex(57, ts.Nodes()...)
ts.AssertLatestCommitmentSlotIndex(57, ts.Nodes()...)
ts.AssertBlocksInCacheAccepted(ts.BlocksWithPrefix("59.0"), true, ts.Nodes()...)
Expand Down

0 comments on commit f4d229a

Please sign in to comment.