Skip to content

Commit

Permalink
review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
geoff-vball committed Jun 29, 2022
1 parent ed65b4c commit 4268b42
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions chain/actors/actor_cids.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion node/impl/full/state.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 4268b42

Please sign in to comment.