fix(chainwatch): Actually capture human actor names

This commit is contained in:
Mike Greenberg
2020-08-18 00:22:01 -04:00
parent 94e4f8d116
commit fabf26cc21
@@ -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 {