actors: fix miner constructor

This commit is contained in:
Łukasz Magiera 2020-02-17 18:19:06 +01:00
parent 4ad63d9b63
commit 3e4ebd6c9d
4 changed files with 9 additions and 2 deletions

View File

@ -94,6 +94,11 @@ func MakeInitialStateTree(ctx context.Context, bs bstore.Blockstore, template ge
// Create empty state tree
cst := cbor.NewCborStore(bs)
_, err := cst.Put(context.TODO(), []struct{}{})
if err != nil {
return nil, xerrors.Errorf("putting empty object: %w", err)
}
state, err := state.NewStateTree(cst)
if err != nil {
return nil, xerrors.Errorf("making new state tree: %w", err)

View File

@ -16,7 +16,7 @@ import (
func init() {
cst := cbor.NewMemCborStore()
emptyobject, err := cst.Put(context.TODO(), map[string]string{})
emptyobject, err := cst.Put(context.TODO(), []struct{}{})
if err != nil {
panic(err)
}

2
go.mod
View File

@ -23,7 +23,7 @@ require (
github.com/filecoin-project/go-paramfetch v0.0.1
github.com/filecoin-project/go-sectorbuilder v0.0.2-0.20200210220012-eb75ec747d6b
github.com/filecoin-project/go-statestore v0.1.0
github.com/filecoin-project/specs-actors v0.0.0-20200217084223-58b973dc2c1f
github.com/filecoin-project/specs-actors v0.0.0-20200217171557-6190f3bd509b
github.com/gbrlsnchs/jwt/v3 v3.0.0-beta.1
github.com/go-ole/go-ole v1.2.4 // indirect
github.com/gorilla/mux v1.7.3

2
go.sum
View File

@ -136,6 +136,8 @@ github.com/filecoin-project/specs-actors v0.0.0-20200217082309-eacd01300b6d h1:6
github.com/filecoin-project/specs-actors v0.0.0-20200217082309-eacd01300b6d/go.mod h1:xtDZUB6pe4Pksa/bAJbJ693OilaC5Wbot9jMhLm3cZA=
github.com/filecoin-project/specs-actors v0.0.0-20200217084223-58b973dc2c1f h1:YGhskEZ/N8rKrU85BvUgRuubhykawibsNluzqZSosHE=
github.com/filecoin-project/specs-actors v0.0.0-20200217084223-58b973dc2c1f/go.mod h1:xtDZUB6pe4Pksa/bAJbJ693OilaC5Wbot9jMhLm3cZA=
github.com/filecoin-project/specs-actors v0.0.0-20200217171557-6190f3bd509b h1:7TpLVtW0BBiTacx4Vnjn8dX/Ahfl9gLl/XPHN5dxcig=
github.com/filecoin-project/specs-actors v0.0.0-20200217171557-6190f3bd509b/go.mod h1:xtDZUB6pe4Pksa/bAJbJ693OilaC5Wbot9jMhLm3cZA=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
github.com/gbrlsnchs/jwt/v3 v3.0.0-beta.1 h1:EzDjxMg43q1tA2c0MV3tNbaontnHLplHyFF6M5KiVP0=