Continue if msg not found on-chain

Continue if msg not found on-chain
This commit is contained in:
Phi 2023-08-22 10:56:50 +02:00
parent e1ed24ddd0
commit 825064669d

View File

@ -59,9 +59,8 @@ var msgCmd = &cli.Command{
return err return err
} }
if lookup == nil { if lookup == nil {
return fmt.Errorf("failed to find message: %s", mcid) fmt.Println("Message not found on-chain. Continuing...")
} } else {
// Replay the message to get the execution trace // Replay the message to get the execution trace
res, err := api.StateReplay(ctx, types.EmptyTSK, mcid) res, err := api.StateReplay(ctx, types.EmptyTSK, mcid)
if err != nil { if err != nil {
@ -77,11 +76,13 @@ var msgCmd = &cli.Command{
} }
fmt.Println(string(trace)) fmt.Println(string(trace))
fmt.Println() fmt.Println()
}
color.Green("Receipt:") color.Green("Receipt:")
fmt.Printf("Exit code: %d\n", res.MsgRct.ExitCode) fmt.Printf("Exit code: %d\n", res.MsgRct.ExitCode)
fmt.Printf("Return: %x\n", res.MsgRct.Return) fmt.Printf("Return: %x\n", res.MsgRct.Return)
fmt.Printf("Gas Used: %d\n", res.MsgRct.GasUsed) fmt.Printf("Gas Used: %d\n", res.MsgRct.GasUsed)
}
}
switch msg := msg.(type) { switch msg := msg.(type) {
case *types.SignedMessage: case *types.SignedMessage: