review fixes

This commit is contained in:
Geoff Stuart 2022-06-29 01:37:56 -04:00
parent ed65b4c3bf
commit 4268b426f9
2 changed files with 6 additions and 5 deletions

View File

@ -16,9 +16,10 @@ import (
func GetActorCodeID(av Version, name string) (cid.Cid, bool) {
// Actors V8 and above
if cids, ok := GetActorCodeIDsFromManifest(av); ok {
if c, ok := cids[name]; ok {
return c, true
if av >= Version8 {
if cids, ok := GetActorCodeIDsFromManifest(av); ok {
c, ok := cids[name]
return c, ok
}
}
@ -304,7 +305,7 @@ func GetActorCodeID(av Version, name string) (cid.Cid, bool) {
return cid.Undef, false
}
// GetActorCodeIDs looks up a builtin actor's code CID by actor version.
// GetActorCodeIDs looks up all builtin actor's code CIDs by actor version.
func GetActorCodeIDs(av Version) (map[string]cid.Cid, error) {
cids, ok := GetActorCodeIDsFromManifest(av)
if ok {

View File

@ -1526,7 +1526,7 @@ func (m *StateModule) StateNetworkVersion(ctx context.Context, tsk types.TipSetK
func (a *StateAPI) StateActorCodeCIDs(ctx context.Context, nv network.Version) (map[string]cid.Cid, error) {
actorVersion, err := actors.VersionForNetwork(nv)
if err != nil {
return nil, xerrors.Errorf("invalid network version")
return nil, xerrors.Errorf("invalid network version %d: %w", nv, err)
}
cids, err := actors.GetActorCodeIDs(actorVersion)