Skip to content

Commit

Permalink
Merge pull request #10299 from filecoin-project/jen/disappearedcode
Browse files Browse the repository at this point in the history
chore: ux: avoid actor not found
  • Loading branch information
arajasek authored Feb 17, 2023
2 parents 1050061 + 59db4ee commit e17d4f1
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions cli/evm.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (

"github.com/filecoin-project/lotus/api/v0api"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/builtin"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/chain/types/ethtypes"
)
Expand Down Expand Up @@ -75,13 +76,18 @@ var EvmGetInfoCmd = &cli.Command{
}

actor, err := api.StateGetActor(ctx, faddr, types.EmptyTSK)
if err != nil {
return err
}

fmt.Println("Filecoin address: ", faddr)
fmt.Println("Eth address: ", eaddr)
fmt.Println("Code cid: ", actor.Code.String())
if err != nil {
fmt.Printf("Actor lookup failed for faddr %s with error: %s\n", faddr, err)
} else {
idAddr, err := api.StateLookupID(ctx, faddr, types.EmptyTSK)
if err == nil {
fmt.Println("ID address: ", idAddr)
fmt.Println("Code cid: ", actor.Code.String())
fmt.Println("Actor Type: ", builtin.ActorNameByCode(actor.Code))
}
}

return nil
},
Expand Down

0 comments on commit e17d4f1

Please sign in to comment.