Skip to content

Commit

Permalink
Remove engine.GetVM (#2374)
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenButtolph authored Nov 27, 2023
1 parent b9ab41a commit 3a424d0
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 40 deletions.
4 changes: 0 additions & 4 deletions snow/engine/avalanche/bootstrap/bootstrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,6 @@ func (b *bootstrapper) HealthCheck(ctx context.Context) (interface{}, error) {
return intf, vmErr
}

func (b *bootstrapper) GetVM() common.VM {
return b.VM
}

// Add the vertices in [vtxIDs] to the set of vertices that we need to fetch,
// and then fetch vertices (and their ancestors) until either there are no more
// to fetch or we are at the maximum number of outstanding requests.
Expand Down
4 changes: 0 additions & 4 deletions snow/engine/avalanche/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ func (e *engine) Context() *snow.ConsensusContext {
return e.ctx
}

func (e *engine) GetVM() common.VM {
return e.vm
}

func (*engine) HealthCheck(context.Context) (interface{}, error) {
return nil, nil
}
3 changes: 0 additions & 3 deletions snow/engine/common/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ type Engine interface {
// Returns nil if the engine is healthy.
// Periodically called and reported through the health API
health.Checker

// GetVM returns this engine's VM
GetVM() VM
}

type Handler interface {
Expand Down
13 changes: 0 additions & 13 deletions snow/engine/common/test_engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -691,16 +691,3 @@ func (e *EngineTest) HealthCheck(ctx context.Context) (interface{}, error) {
}
return nil, errHealthCheck
}

func (e *EngineTest) GetVM() VM {
if e.GetVMF != nil {
return e.GetVMF()
}
if !e.CantGetVM {
return nil
}
if e.T != nil {
require.FailNow(e.T, "Unexpectedly called GetVM")
}
return nil
}
4 changes: 0 additions & 4 deletions snow/engine/common/traced_engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,3 @@ func (e *tracedEngine) HealthCheck(ctx context.Context) (interface{}, error) {

return e.engine.HealthCheck(ctx)
}

func (e *tracedEngine) GetVM() VM {
return e.engine.GetVM()
}
4 changes: 0 additions & 4 deletions snow/engine/snowman/bootstrap/bootstrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,6 @@ func (b *Bootstrapper) HealthCheck(ctx context.Context) (interface{}, error) {
return intf, vmErr
}

func (b *Bootstrapper) GetVM() common.VM {
return b.VM
}

func (b *Bootstrapper) ForceAccepted(ctx context.Context, acceptedContainerIDs []ids.ID) error {
pendingContainerIDs := b.Blocked.MissingIDs()

Expand Down
4 changes: 0 additions & 4 deletions snow/engine/snowman/syncer/state_syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -618,10 +618,6 @@ func (ss *stateSyncer) HealthCheck(ctx context.Context) (interface{}, error) {
return intf, vmErr
}

func (ss *stateSyncer) GetVM() common.VM {
return ss.VM
}

func (ss *stateSyncer) IsEnabled(ctx context.Context) (bool, error) {
if ss.stateSyncVM == nil {
// state sync is not implemented
Expand Down
4 changes: 0 additions & 4 deletions snow/engine/snowman/transitive.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,10 +480,6 @@ func (t *Transitive) HealthCheck(ctx context.Context) (interface{}, error) {
return intf, fmt.Errorf("vm: %w ; consensus: %w", vmErr, consensusErr)
}

func (t *Transitive) GetVM() common.VM {
return t.VM
}

func (t *Transitive) GetBlock(ctx context.Context, blkID ids.ID) (snowman.Block, error) {
if blk, ok := t.pending[blkID]; ok {
return blk, nil
Expand Down

0 comments on commit 3a424d0

Please sign in to comment.