Refactor: State: Rename stmgr::GetNtwkVersion to GetNetworkVersion

This commit is contained in:
Aayush Rajasekaran
2021-12-17 18:43:39 -05:00
parent 94e1a833d6
commit 3f4eaa99d5
11 changed files with 22 additions and 22 deletions
@@ -88,7 +88,7 @@ func NewBlockBuilder(ctx context.Context, logger *zap.SugaredLogger, sm *stmgr.S
Actors: filcns.NewActorRegistry(),
Syscalls: sm.VMSys(),
CircSupplyCalc: sm.GetVMCirculatingSupply,
NtwkVersion: sm.GetNtwkVersion,
NtwkVersion: sm.GetNetworkVersion,
BaseFee: abi.NewTokenAmount(0),
LookbackState: stmgr.LookbackStateGetterForTipset(sm, parentTs),
}
@@ -265,7 +265,7 @@ func (bb *BlockBuilder) Height() abi.ChainEpoch {
// NetworkVersion returns the network version for the target block.
func (bb *BlockBuilder) NetworkVersion() network.Version {
return bb.sm.GetNtwkVersion(bb.ctx, bb.Height())
return bb.sm.GetNetworkVersion(bb.ctx, bb.Height())
}
// StateManager returns the stmgr.StateManager.
+1 -1
View File
@@ -159,7 +159,7 @@ func (sim *Simulation) GetStart() *types.TipSet {
// GetNetworkVersion returns the current network version for the simulation.
func (sim *Simulation) GetNetworkVersion() network.Version {
return sim.StateManager.GetNtwkVersion(context.TODO(), sim.head.Height())
return sim.StateManager.GetNetworkVersion(context.TODO(), sim.head.Height())
}
// SetHead updates the current head of the simulation and stores it in the metadata store. This is
+2 -2
View File
@@ -41,8 +41,8 @@ func (sim *Simulation) popNextMessages(ctx context.Context) ([]*types.Message, e
// This isn't what the network does, but it makes things easier. Otherwise, we'd need to run
// migrations before this epoch and I'd rather not deal with that.
nextHeight := parentTs.Height() + 1
prevVer := sim.StateManager.GetNtwkVersion(ctx, nextHeight-1)
nextVer := sim.StateManager.GetNtwkVersion(ctx, nextHeight)
prevVer := sim.StateManager.GetNetworkVersion(ctx, nextHeight-1)
nextVer := sim.StateManager.GetNetworkVersion(ctx, nextHeight)
if nextVer != prevVer {
log.Warnw("packing no messages for version upgrade block",
"old", prevVer,