diff --git a/chain/actors/builtin/system/actor.go.template b/chain/actors/builtin/system/actor.go.template index 616a20a76..a3fb6127d 100644 --- a/chain/actors/builtin/system/actor.go.template +++ b/chain/actors/builtin/system/actor.go.template @@ -4,6 +4,7 @@ import ( "github.com/filecoin-project/lotus/chain/actors/adt" "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/types" + "github.com/ipfs/go-cid" "golang.org/x/xerrors" @@ -60,4 +61,5 @@ func MakeState(store adt.Store, av actors.Version) (State, error) { type State interface { GetState() interface{} + GetBuiltinActors() cid.Cid } diff --git a/chain/actors/builtin/system/state.go.template b/chain/actors/builtin/system/state.go.template index ddf458305..de3f2dcdf 100644 --- a/chain/actors/builtin/system/state.go.template +++ b/chain/actors/builtin/system/state.go.template @@ -36,4 +36,12 @@ type state{{.v}} struct { func (s *state{{.v}}) GetState() interface{} { return &s.State +} + +func (s *state{{.v}}) GetBuiltinActors() cid.Cid { +{{if (le .v 7)}} + return cid.Undef +{{else}} + return s.State.BuiltinActors +{{end}} } \ No newline at end of file diff --git a/chain/actors/builtin/system/system.go b/chain/actors/builtin/system/system.go index 71d7f7024..fd3997147 100644 --- a/chain/actors/builtin/system/system.go +++ b/chain/actors/builtin/system/system.go @@ -4,6 +4,7 @@ import ( "github.com/filecoin-project/lotus/chain/actors" "github.com/filecoin-project/lotus/chain/actors/adt" "github.com/filecoin-project/lotus/chain/types" + "github.com/ipfs/go-cid" "golang.org/x/xerrors" @@ -103,4 +104,5 @@ func MakeState(store adt.Store, av actors.Version) (State, error) { type State interface { GetState() interface{} + GetBuiltinActors() cid.Cid } diff --git a/chain/actors/builtin/system/v0.go b/chain/actors/builtin/system/v0.go index 64c6f53d3..a5aa8e8fa 100644 --- a/chain/actors/builtin/system/v0.go +++ b/chain/actors/builtin/system/v0.go @@ -33,3 +33,9 @@ type state0 struct { func (s *state0) GetState() interface{} { return &s.State } + +func (s *state0) GetBuiltinActors() cid.Cid { + + return cid.Undef + +} diff --git a/chain/actors/builtin/system/v2.go b/chain/actors/builtin/system/v2.go index eb540891c..aea9eff7b 100644 --- a/chain/actors/builtin/system/v2.go +++ b/chain/actors/builtin/system/v2.go @@ -33,3 +33,9 @@ type state2 struct { func (s *state2) GetState() interface{} { return &s.State } + +func (s *state2) GetBuiltinActors() cid.Cid { + + return cid.Undef + +} diff --git a/chain/actors/builtin/system/v3.go b/chain/actors/builtin/system/v3.go index 5b04e189e..fd5f0cd50 100644 --- a/chain/actors/builtin/system/v3.go +++ b/chain/actors/builtin/system/v3.go @@ -33,3 +33,9 @@ type state3 struct { func (s *state3) GetState() interface{} { return &s.State } + +func (s *state3) GetBuiltinActors() cid.Cid { + + return cid.Undef + +} diff --git a/chain/actors/builtin/system/v4.go b/chain/actors/builtin/system/v4.go index b6c924978..fbdec7e93 100644 --- a/chain/actors/builtin/system/v4.go +++ b/chain/actors/builtin/system/v4.go @@ -33,3 +33,9 @@ type state4 struct { func (s *state4) GetState() interface{} { return &s.State } + +func (s *state4) GetBuiltinActors() cid.Cid { + + return cid.Undef + +} diff --git a/chain/actors/builtin/system/v5.go b/chain/actors/builtin/system/v5.go index 77d2a8478..3d3c27a12 100644 --- a/chain/actors/builtin/system/v5.go +++ b/chain/actors/builtin/system/v5.go @@ -33,3 +33,9 @@ type state5 struct { func (s *state5) GetState() interface{} { return &s.State } + +func (s *state5) GetBuiltinActors() cid.Cid { + + return cid.Undef + +} diff --git a/chain/actors/builtin/system/v6.go b/chain/actors/builtin/system/v6.go index 689620afb..314308845 100644 --- a/chain/actors/builtin/system/v6.go +++ b/chain/actors/builtin/system/v6.go @@ -33,3 +33,9 @@ type state6 struct { func (s *state6) GetState() interface{} { return &s.State } + +func (s *state6) GetBuiltinActors() cid.Cid { + + return cid.Undef + +} diff --git a/chain/actors/builtin/system/v7.go b/chain/actors/builtin/system/v7.go index 813add5fb..3987db8dd 100644 --- a/chain/actors/builtin/system/v7.go +++ b/chain/actors/builtin/system/v7.go @@ -33,3 +33,9 @@ type state7 struct { func (s *state7) GetState() interface{} { return &s.State } + +func (s *state7) GetBuiltinActors() cid.Cid { + + return cid.Undef + +} diff --git a/chain/actors/builtin/system/v8.go b/chain/actors/builtin/system/v8.go index 2e0e2ba56..30e9d6be8 100644 --- a/chain/actors/builtin/system/v8.go +++ b/chain/actors/builtin/system/v8.go @@ -33,3 +33,9 @@ type state8 struct { func (s *state8) GetState() interface{} { return &s.State } + +func (s *state8) GetBuiltinActors() cid.Cid { + + return s.State.BuiltinActors + +}