From 3a424d000fde0916da4fd935650cca4f20e6c6e7 Mon Sep 17 00:00:00 2001 From: Stephen Buttolph Date: Mon, 27 Nov 2023 13:36:03 -0500 Subject: [PATCH] Remove `engine.GetVM` (#2374) --- snow/engine/avalanche/bootstrap/bootstrapper.go | 4 ---- snow/engine/avalanche/engine.go | 4 ---- snow/engine/common/engine.go | 3 --- snow/engine/common/test_engine.go | 13 ------------- snow/engine/common/traced_engine.go | 4 ---- snow/engine/snowman/bootstrap/bootstrapper.go | 4 ---- snow/engine/snowman/syncer/state_syncer.go | 4 ---- snow/engine/snowman/transitive.go | 4 ---- 8 files changed, 40 deletions(-) diff --git a/snow/engine/avalanche/bootstrap/bootstrapper.go b/snow/engine/avalanche/bootstrap/bootstrapper.go index c6ef6513b668..6a4cc974e648 100644 --- a/snow/engine/avalanche/bootstrap/bootstrapper.go +++ b/snow/engine/avalanche/bootstrap/bootstrapper.go @@ -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. diff --git a/snow/engine/avalanche/engine.go b/snow/engine/avalanche/engine.go index 9b828ac05946..375666c99598 100644 --- a/snow/engine/avalanche/engine.go +++ b/snow/engine/avalanche/engine.go @@ -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 } diff --git a/snow/engine/common/engine.go b/snow/engine/common/engine.go index d92911ff1f7f..e50d94327a30 100644 --- a/snow/engine/common/engine.go +++ b/snow/engine/common/engine.go @@ -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 { diff --git a/snow/engine/common/test_engine.go b/snow/engine/common/test_engine.go index 3eb376de8e32..0081d63b5753 100644 --- a/snow/engine/common/test_engine.go +++ b/snow/engine/common/test_engine.go @@ -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 -} diff --git a/snow/engine/common/traced_engine.go b/snow/engine/common/traced_engine.go index 9050f29cd1e1..28be03d6df7c 100644 --- a/snow/engine/common/traced_engine.go +++ b/snow/engine/common/traced_engine.go @@ -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() -} diff --git a/snow/engine/snowman/bootstrap/bootstrapper.go b/snow/engine/snowman/bootstrap/bootstrapper.go index 224cded68311..728e38af59cf 100644 --- a/snow/engine/snowman/bootstrap/bootstrapper.go +++ b/snow/engine/snowman/bootstrap/bootstrapper.go @@ -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() diff --git a/snow/engine/snowman/syncer/state_syncer.go b/snow/engine/snowman/syncer/state_syncer.go index 89c839a25dcd..8b7431558be6 100644 --- a/snow/engine/snowman/syncer/state_syncer.go +++ b/snow/engine/snowman/syncer/state_syncer.go @@ -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 diff --git a/snow/engine/snowman/transitive.go b/snow/engine/snowman/transitive.go index b4c5e3e54b51..8e2b98dc5a38 100644 --- a/snow/engine/snowman/transitive.go +++ b/snow/engine/snowman/transitive.go @@ -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