Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: api: Api call to get actor cids works for versions < 16 #8941

Merged
merged 4 commits into from
Jun 29, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
review fixes
  • Loading branch information
geoff-vball committed Jun 29, 2022
commit 4268b426f9e1897b99ddab44e943f2b28c95c404
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
geoff-vball marked this conversation as resolved.
Show resolved Hide resolved
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
}
geoff-vball marked this conversation as resolved.
Show resolved Hide resolved
}

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