fix(lotus-sim): remove unused field and function

This commit is contained in:
Steven Allen 2021-06-21 11:25:03 -07:00
parent 80eba1069a
commit c532b1b819

View File

@ -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/<subkey>/<simulation-name>. 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
}