From fabf26cc214ad22d86f56a065ac07bcc136a913d Mon Sep 17 00:00:00 2001 From: Mike Greenberg Date: Mon, 17 Aug 2020 17:36:00 -0400 Subject: [PATCH] fix(chainwatch): Actually capture human actor names --- cmd/lotus-chainwatch/processor/common_actors.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/cmd/lotus-chainwatch/processor/common_actors.go b/cmd/lotus-chainwatch/processor/common_actors.go index f74168485..d6aec7f90 100644 --- a/cmd/lotus-chainwatch/processor/common_actors.go +++ b/cmd/lotus-chainwatch/processor/common_actors.go @@ -16,7 +16,6 @@ import ( _init "github.com/filecoin-project/specs-actors/actors/builtin/init" "github.com/filecoin-project/specs-actors/actors/util/adt" "github.com/ipfs/go-cid" - "github.com/multiformats/go-multihash" 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 { actorName := code.String() - if s, err := multihash.Decode(code.Hash()); err != nil { - actorName = string(s.Digest) + if builtin.IsBuiltinActor(code) { + actorName = builtin.ActorNameByCode(code) } for _, actorInfo := range actTips { for _, a := range actorInfo { @@ -290,8 +289,8 @@ func (p *Processor) storeActorStates(actors map[cid.Cid]ActorTips) error { for code, actTips := range actors { actorName := code.String() - if s, err := multihash.Decode(code.Hash()); err != nil { - actorName = string(s.Digest) + if builtin.IsBuiltinActor(code) { + actorName = builtin.ActorNameByCode(code) } for _, actorInfo := range actTips { for _, a := range actorInfo {