Skip to content

Commit 35c8589

Browse files
committed
fix: cid comparison
1 parent a4bb3f2 commit 35c8589

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

actors/actors.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func (a *BuiltinActors) IsActor(actorCode cid.Cid, actorName string) bool {
5959
// Try the latest actors' version first
6060
for _, actorCids := range a.Metadata.ActorsNameCidMapByVersion {
6161
if cid, ok := actorCids[actorName]; ok {
62-
if actorCode == cid {
62+
if actorCode.String() == cid.String() {
6363
return true
6464
}
6565
}
@@ -76,7 +76,7 @@ func (a *BuiltinActors) IsActor(actorCode cid.Cid, actorName string) bool {
7676
func (a *BuiltinActors) GetActorNameFromCid(actorCode cid.Cid) (string, error) {
7777
// Try the latest actors' version first
7878
for name, code := range a.Metadata.ActorsNameCidMapByVersion[a.Metadata.Version] {
79-
if actorCode == code {
79+
if actorCode.String() == code.String() {
8080
return name, nil
8181
}
8282
}
@@ -103,7 +103,7 @@ func (a *BuiltinActors) GetActorCid(name string) (cid.Cid, error) {
103103
func (a *BuiltinActors) GetActorNameFromCidByVersion(actorCode cid.Cid, version network.Version) (string, error) {
104104
// Try the latest actors' version first
105105
for name, code := range a.Metadata.ActorsNameCidMapByVersion[version] {
106-
if actorCode == code {
106+
if actorCode.String() == code.String() {
107107
return name, nil
108108
}
109109
}
@@ -140,7 +140,7 @@ func (a *BuiltinActors) getActorCidByVersionFallback(name string) (cid.Cid, erro
140140
func (a *BuiltinActors) getActorNameFromCidByVersionFallback(actorCode cid.Cid) (string, error) {
141141
for _, actorCids := range a.Metadata.ActorsNameCidMapByVersion {
142142
for name, cid := range actorCids {
143-
if actorCode == cid {
143+
if actorCode.String() == cid.String() {
144144
return name, nil
145145
}
146146
}

0 commit comments

Comments
 (0)