move actor key to a const array
This commit is contained in:
parent
2c1cf42aa0
commit
970aa299a2
@ -32,6 +32,22 @@ const (
|
|||||||
VerifregKey = "verifiedregistry"
|
VerifregKey = "verifiedregistry"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func GetBuiltinActorsKeys() []string {
|
||||||
|
return []string{
|
||||||
|
AccountKey,
|
||||||
|
CronKey,
|
||||||
|
InitKey,
|
||||||
|
MarketKey,
|
||||||
|
MinerKey,
|
||||||
|
MultisigKey,
|
||||||
|
PaychKey,
|
||||||
|
PowerKey,
|
||||||
|
RewardKey,
|
||||||
|
SystemKey,
|
||||||
|
VerifregKey,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
manifestMx sync.RWMutex
|
manifestMx sync.RWMutex
|
||||||
)
|
)
|
||||||
@ -85,19 +101,8 @@ func loadManifests(ctx context.Context, store cbor.IpldStore) error {
|
|||||||
|
|
||||||
manifests[av] = mf
|
manifests[av] = mf
|
||||||
|
|
||||||
for _, name := range []string{
|
var actorKeys = GetBuiltinActorsKeys()
|
||||||
AccountKey,
|
for _, name := range actorKeys {
|
||||||
CronKey,
|
|
||||||
InitKey,
|
|
||||||
MarketKey,
|
|
||||||
MinerKey,
|
|
||||||
MultisigKey,
|
|
||||||
PaychKey,
|
|
||||||
PowerKey,
|
|
||||||
RewardKey,
|
|
||||||
SystemKey,
|
|
||||||
VerifregKey,
|
|
||||||
} {
|
|
||||||
c, ok := mf.Get(name)
|
c, ok := mf.Get(name)
|
||||||
if ok {
|
if ok {
|
||||||
actorMeta[c] = actorEntry{name: name, version: av}
|
actorMeta[c] = actorEntry{name: name, version: av}
|
||||||
|
15
cli/state.go
15
cli/state.go
@ -1933,19 +1933,8 @@ var StateSysActorCIDsCmd = &cli.Command{
|
|||||||
tw := tabwriter.NewWriter(os.Stdout, 2, 4, 2, ' ', 0)
|
tw := tabwriter.NewWriter(os.Stdout, 2, 4, 2, ' ', 0)
|
||||||
_, _ = fmt.Fprintln(tw, "\nActor\tCID\t")
|
_, _ = fmt.Fprintln(tw, "\nActor\tCID\t")
|
||||||
|
|
||||||
for _, name := range []string{
|
var actorKeys = actors.GetBuiltinActorsKeys()
|
||||||
actors.AccountKey,
|
for _, name := range actorKeys {
|
||||||
actors.CronKey,
|
|
||||||
actors.InitKey,
|
|
||||||
actors.MarketKey,
|
|
||||||
actors.MinerKey,
|
|
||||||
actors.MultisigKey,
|
|
||||||
actors.PaychKey,
|
|
||||||
actors.PowerKey,
|
|
||||||
actors.RewardKey,
|
|
||||||
actors.SystemKey,
|
|
||||||
actors.VerifregKey,
|
|
||||||
} {
|
|
||||||
sysActorCID, ok := actors.GetActorCodeID(actorVersion, name)
|
sysActorCID, ok := actors.GetActorCodeID(actorVersion, name)
|
||||||
if !ok {
|
if !ok {
|
||||||
return xerrors.Errorf("error getting actor %v code id for actor version %d", name,
|
return xerrors.Errorf("error getting actor %v code id for actor version %d", name,
|
||||||
|
Loading…
Reference in New Issue
Block a user