Merge pull request #5957 from filecoin-project/asr/nits
State CLI improvements
This commit is contained in:
commit
0a8d20eb4e
23
cli/state.go
23
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
|
||||||
}
|
}
|
||||||
@ -1744,7 +1745,7 @@ var StateCircSupplyCmd = &cli.Command{
|
|||||||
var StateSectorCmd = &cli.Command{
|
var StateSectorCmd = &cli.Command{
|
||||||
Name: "sector",
|
Name: "sector",
|
||||||
Usage: "Get miner sector info",
|
Usage: "Get miner sector info",
|
||||||
ArgsUsage: "[miner address] [sector number]",
|
ArgsUsage: "[minerAddress] [sectorNumber]",
|
||||||
Action: func(cctx *cli.Context) error {
|
Action: func(cctx *cli.Context) error {
|
||||||
api, closer, err := GetFullNodeAPI(cctx)
|
api, closer, err := GetFullNodeAPI(cctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -1755,7 +1756,7 @@ var StateSectorCmd = &cli.Command{
|
|||||||
ctx := ReqContext(cctx)
|
ctx := ReqContext(cctx)
|
||||||
|
|
||||||
if cctx.Args().Len() != 2 {
|
if cctx.Args().Len() != 2 {
|
||||||
return xerrors.Errorf("expected 2 params")
|
return xerrors.Errorf("expected 2 params: minerAddress and sectorNumber")
|
||||||
}
|
}
|
||||||
|
|
||||||
ts, err := LoadTipSet(ctx, cctx, api)
|
ts, err := LoadTipSet(ctx, cctx, api)
|
||||||
|
Loading…
Reference in New Issue
Block a user