From c532b1b819b3452062bc6552701ba58f87f12402 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 21 Jun 2021 11:25:03 -0700 Subject: [PATCH] fix(lotus-sim): remove unused field and function --- cmd/lotus-sim/simulation/simulation.go | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/cmd/lotus-sim/simulation/simulation.go b/cmd/lotus-sim/simulation/simulation.go index 18ccf1c0c..c75be3261 100644 --- a/cmd/lotus-sim/simulation/simulation.go +++ b/cmd/lotus-sim/simulation/simulation.go @@ -16,7 +16,6 @@ import ( blockadt "github.com/filecoin-project/specs-actors/actors/util/adt" - "github.com/filecoin-project/lotus/chain/state" "github.com/filecoin-project/lotus/chain/stmgr" "github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/cmd/lotus-sim/simulation/stages" @@ -80,7 +79,6 @@ type Simulation struct { start *types.TipSet // head - st *state.StateTree head *types.TipSet stages []stages.Stage @@ -113,22 +111,6 @@ func (sim *Simulation) saveConfig() error { return sim.MetadataDS.Put(sim.key("config"), buf) } -// stateTree returns the current state-tree for the current head, computing the tipset if necessary. -// The state-tree is cached until the head is changed. -func (sim *Simulation) stateTree(ctx context.Context) (*state.StateTree, error) { - if sim.st == nil { - st, _, err := sim.StateManager.TipSetState(ctx, sim.head) - if err != nil { - return nil, err - } - sim.st, err = sim.StateManager.StateTree(st) - if err != nil { - return nil, err - } - } - return sim.st, nil -} - var simulationPrefix = datastore.NewKey("/simulation") // key returns the the key in the form /simulation//. For example, @@ -183,7 +165,6 @@ func (sim *Simulation) SetHead(head *types.TipSet) error { if err := sim.storeNamedTipSet("head", head); err != nil { return err } - sim.st = nil // we'll compute this on-demand. sim.head = head return nil }