State CLI: fix printMsg to not panic when message isn't found
This commit is contained in:
parent
eede19fb0b
commit
d9dcc7845f
19
cli/state.go
19
cli/state.go
@ -1464,19 +1464,20 @@ func printReceiptReturn(ctx context.Context, api api.FullNode, m *types.Message,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func printMsg(ctx context.Context, api api.FullNode, msg cid.Cid, mw *lapi.MsgLookup, m *types.Message) error {
|
func printMsg(ctx context.Context, api api.FullNode, msg cid.Cid, mw *lapi.MsgLookup, m *types.Message) error {
|
||||||
if mw != nil {
|
|
||||||
if mw.Message != msg {
|
|
||||||
fmt.Printf("Message was replaced: %s\n", mw.Message)
|
|
||||||
}
|
|
||||||
|
|
||||||
fmt.Printf("Executed in tipset: %s\n", mw.TipSet.Cids())
|
if mw == nil {
|
||||||
fmt.Printf("Exit Code: %d\n", mw.Receipt.ExitCode)
|
|
||||||
fmt.Printf("Gas Used: %d\n", mw.Receipt.GasUsed)
|
|
||||||
fmt.Printf("Return: %x\n", mw.Receipt.Return)
|
|
||||||
} else {
|
|
||||||
fmt.Println("message was not found on chain")
|
fmt.Println("message was not found on chain")
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if mw.Message != msg {
|
||||||
|
fmt.Printf("Message was replaced: %s\n", mw.Message)
|
||||||
|
}
|
||||||
|
|
||||||
|
fmt.Printf("Executed in tipset: %s\n", mw.TipSet.Cids())
|
||||||
|
fmt.Printf("Exit Code: %d\n", mw.Receipt.ExitCode)
|
||||||
|
fmt.Printf("Gas Used: %d\n", mw.Receipt.GasUsed)
|
||||||
|
fmt.Printf("Return: %x\n", mw.Receipt.Return)
|
||||||
if err := printReceiptReturn(ctx, api, m, mw.Receipt); err != nil {
|
if err := printReceiptReturn(ctx, api, m, mw.Receipt); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user