Skip to content

Commit

Permalink
Merge pull request #3996 from filecoin-project/conformance-ntwork-upg…
Browse files Browse the repository at this point in the history
…rade-adjustments

small adjustments following network upgradability changes
  • Loading branch information
magik6k committed Sep 24, 2020
2 parents 45d8cb0 + 6866306 commit 6ca5308
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions chain/state/statetree.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,11 @@ func (st *StateTree) ForEach(f func(address.Address, *types.Actor) error) error
})
}

// Version returns the version of the StateTree data structure in use.
func (st *StateTree) Version() builtin.Version {
return st.version
}

func Diff(oldTree, newTree *StateTree) (map[string]types.Actor, error) {
out := map[string]types.Actor{}

Expand Down
3 changes: 3 additions & 0 deletions conformance/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ func (d *Driver) ExecuteTipset(bs blockstore.Blockstore, ds ds.Batching, preroot

// ExecuteMessage executes a conformance test vector message in a temporary VM.
func (d *Driver) ExecuteMessage(bs blockstore.Blockstore, preroot cid.Cid, epoch abi.ChainEpoch, msg *types.Message) (*vm.ApplyRet, cid.Cid, error) {
// dummy state manager; only to reference the GetNetworkVersion method, which does not depend on state.
sm := new(stmgr.StateManager)
vmOpts := &vm.VMOpts{
StateBase: preroot,
Epoch: epoch,
Expand All @@ -130,6 +132,7 @@ func (d *Driver) ExecuteMessage(bs blockstore.Blockstore, preroot cid.Cid, epoch
Syscalls: mkFakedSigSyscalls(vm.Syscalls(ffiwrapper.ProofVerifier)), // TODO always succeeds; need more flexibility.
CircSupplyCalc: nil,
BaseFee: BaseFee,
NtwkVersion: sm.GetNtwkVersion,
}

lvm, err := vm.NewVM(context.TODO(), vmOpts)
Expand Down

0 comments on commit 6ca5308

Please sign in to comment.