fix(chainwatch): Actually capture human actor names

This commit is contained in:
Mike Greenberg 2020-08-17 17:36:00 -04:00
parent 94e4f8d116
commit fabf26cc21

View File

@ -16,7 +16,6 @@ import (
_init "github.com/filecoin-project/specs-actors/actors/builtin/init" _init "github.com/filecoin-project/specs-actors/actors/builtin/init"
"github.com/filecoin-project/specs-actors/actors/util/adt" "github.com/filecoin-project/specs-actors/actors/util/adt"
"github.com/ipfs/go-cid" "github.com/ipfs/go-cid"
"github.com/multiformats/go-multihash"
typegen "github.com/whyrusleeping/cbor-gen" typegen "github.com/whyrusleeping/cbor-gen"
) )
@ -244,8 +243,8 @@ func (p *Processor) storeActorHeads(actors map[cid.Cid]ActorTips) error {
for code, actTips := range actors { for code, actTips := range actors {
actorName := code.String() actorName := code.String()
if s, err := multihash.Decode(code.Hash()); err != nil { if builtin.IsBuiltinActor(code) {
actorName = string(s.Digest) actorName = builtin.ActorNameByCode(code)
} }
for _, actorInfo := range actTips { for _, actorInfo := range actTips {
for _, a := range actorInfo { for _, a := range actorInfo {
@ -290,8 +289,8 @@ func (p *Processor) storeActorStates(actors map[cid.Cid]ActorTips) error {
for code, actTips := range actors { for code, actTips := range actors {
actorName := code.String() actorName := code.String()
if s, err := multihash.Decode(code.Hash()); err != nil { if builtin.IsBuiltinActor(code) {
actorName = string(s.Digest) actorName = builtin.ActorNameByCode(code)
} }
for _, actorInfo := range actTips { for _, actorInfo := range actTips {
for _, a := range actorInfo { for _, a := range actorInfo {