cli: Add lotus-shed cli for computing frc42 method num

This commit is contained in:
Shrenuj Bansal 2022-12-12 11:45:44 -05:00
parent 33a176eae4
commit 466f0c583f

View File

@ -34,6 +34,7 @@ var actorCmd = &cli.Command{
actorControl, actorControl,
actorProposeChangeWorker, actorProposeChangeWorker,
actorConfirmChangeWorker, actorConfirmChangeWorker,
actorGetMethodNum,
}, },
} }
@ -809,3 +810,24 @@ var actorConfirmChangeWorker = &cli.Command{
return nil return nil
}, },
} }
var actorGetMethodNum = &cli.Command{
Name: "generate-method-num",
Usage: "Generate method number from method name",
ArgsUsage: "[methodName]",
Action: func(cctx *cli.Context) error {
if !cctx.Args().Present() {
return fmt.Errorf("must pass methodNum")
}
methodName := cctx.Args().First()
methodNum, err := builtin.GenerateMethodNum(methodName)
if err != nil {
return err
}
fmt.Println("Method Num: ", methodNum)
return nil
},
}