Merge pull request #9321 from filecoin-project/gstuart/actors-cids-cli-network-version

fix: cli: actor-cids cli command now defaults to current network
This commit is contained in:
Aayush Rajasekaran 2022-09-15 12:38:51 -04:00 committed by GitHub
commit 7d3b7fe728
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 3 deletions

View File

@ -1900,7 +1900,6 @@ var StateSysActorCIDsCmd = &cli.Command{
&cli.UintFlag{ &cli.UintFlag{
Name: "network-version", Name: "network-version",
Usage: "specify network version", Usage: "specify network version",
Value: uint(build.NewestNetworkVersion),
}, },
}, },
Action: func(cctx *cli.Context) error { Action: func(cctx *cli.Context) error {
@ -1916,7 +1915,15 @@ var StateSysActorCIDsCmd = &cli.Command{
ctx := ReqContext(cctx) ctx := ReqContext(cctx)
nv := network.Version(cctx.Uint64("network-version")) var nv network.Version
if cctx.IsSet("network-version") {
nv = network.Version(cctx.Uint64("network-version"))
} else {
nv, err = api.StateNetworkVersion(ctx, types.EmptyTSK)
if err != nil {
return err
}
}
fmt.Printf("Network Version: %d\n", nv) fmt.Printf("Network Version: %d\n", nv)

View File

@ -2029,7 +2029,7 @@ USAGE:
lotus state actor-cids [command options] [arguments...] lotus state actor-cids [command options] [arguments...]
OPTIONS: OPTIONS:
--network-version value specify network version (default: 17) --network-version value specify network version (default: 0)
``` ```