Skip to content

Commit

Permalink
vm: construct CBOR store properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
raulk committed Nov 10, 2020
1 parent f8c3756 commit 0182d1b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
7 changes: 1 addition & 6 deletions chain/store/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -809,12 +809,7 @@ func (cs *ChainStore) GetGenesis() (*types.BlockHeader, error) {
return nil, err
}

genb, err := cs.bs.Get(c)
if err != nil {
return nil, err
}

return types.DecodeBlock(genb.RawData())
return cs.GetBlock(c)
}

func (cs *ChainStore) GetCMessage(c cid.Cid) (types.ChainMsg, error) {
Expand Down
8 changes: 4 additions & 4 deletions chain/vm/vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ func (vm *VM) makeRuntime(ctx context.Context, msg *types.Message, parent *Runti
rt.Abortf(exitcode.SysErrForbidden, "message execution exceeds call depth")
}

rt.cst = &cbor.BasicIpldStore{
Blocks: &gasChargingBlocks{rt.chargeGasFunc(2), rt.pricelist, vm.cst.Blocks},
Atlas: vm.cst.Atlas,
}
cbb := &gasChargingBlocks{rt.chargeGasFunc(2), rt.pricelist, vm.cst.Blocks}
cst := cbor.NewCborStore(cbb)
cst.Atlas = vm.cst.Atlas // associate the atlas.
vm.cst = cst

vmm := *msg
resF, ok := rt.ResolveAddress(msg.From)
Expand Down

0 comments on commit 0182d1b

Please sign in to comment.