Set system actor's initial state correctly

This commit is contained in:
Aayush Rajasekaran 2020-03-26 06:38:45 -04:00
parent edf03c9ba8
commit 1e1d0676ae

View File

@ -2,19 +2,20 @@ package genesis
import ( import (
"context" "context"
"github.com/filecoin-project/specs-actors/actors/builtin/system"
"github.com/filecoin-project/lotus/chain/types" "github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/specs-actors/actors/builtin" "github.com/filecoin-project/specs-actors/actors/builtin"
"github.com/filecoin-project/specs-actors/actors/util/adt"
bstore "github.com/ipfs/go-ipfs-blockstore" bstore "github.com/ipfs/go-ipfs-blockstore"
cbor "github.com/ipfs/go-ipld-cbor" cbor "github.com/ipfs/go-ipld-cbor"
) )
func SetupSystemActor(bs bstore.Blockstore) (*types.Actor, error) { func SetupSystemActor(bs bstore.Blockstore) (*types.Actor, error) {
var st system.State
cst := cbor.NewCborStore(bs) cst := cbor.NewCborStore(bs)
statecid, err := cst.Put(context.TODO(), adt.Empty) statecid, err := cst.Put(context.TODO(), &st)
if err != nil { if err != nil {
return nil, err return nil, err
} }