Merge pull request #9845 from filecoin-project/sbansal/frc42-method-num-cli

cli: Add lotus-shed cli for computing frc42 method num
This commit is contained in:
Shrenuj Bansal 2022-12-12 13:07:06 -05:00 committed by GitHub
commit 4892e25800
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 25 additions and 3 deletions

View File

@ -34,6 +34,7 @@ var actorCmd = &cli.Command{
actorControl,
actorProposeChangeWorker,
actorConfirmChangeWorker,
actorGetMethodNum,
},
}
@ -809,3 +810,24 @@ var actorConfirmChangeWorker = &cli.Command{
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
},
}

2
go.mod
View File

@ -43,7 +43,7 @@ require (
github.com/filecoin-project/go-legs v0.4.4
github.com/filecoin-project/go-padreader v0.0.1
github.com/filecoin-project/go-paramfetch v0.0.4
github.com/filecoin-project/go-state-types v0.10.0-alpha-2
github.com/filecoin-project/go-state-types v0.10.0-alpha-3
github.com/filecoin-project/go-statemachine v1.0.2
github.com/filecoin-project/go-statestore v0.2.0
github.com/filecoin-project/go-storedcounter v0.1.0

4
go.sum
View File

@ -356,8 +356,8 @@ github.com/filecoin-project/go-state-types v0.1.0/go.mod h1:ezYnPf0bNkTsDibL/psS
github.com/filecoin-project/go-state-types v0.1.6/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q=
github.com/filecoin-project/go-state-types v0.1.8/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q=
github.com/filecoin-project/go-state-types v0.1.10/go.mod h1:UwGVoMsULoCK+bWjEdd/xLCvLAQFBC7EDT477SKml+Q=
github.com/filecoin-project/go-state-types v0.10.0-alpha-2 h1:xz8+sXAuCMane7SkEYCtQjD/zYJ4n1d5bxwYNL8Thf0=
github.com/filecoin-project/go-state-types v0.10.0-alpha-2/go.mod h1:7ty480tvttEAqWKywhAaDCElk7ksTqEXtXWAzTSdEKo=
github.com/filecoin-project/go-state-types v0.10.0-alpha-3 h1:8iM9uz+rWRbrg1Zet+YlTJN4XEPNqRkqa3zay2pwV7w=
github.com/filecoin-project/go-state-types v0.10.0-alpha-3/go.mod h1:FPgQE05BFwZxKw/vCuIaIrzfJKo4RPQQMMPGd43dAFI=
github.com/filecoin-project/go-statemachine v0.0.0-20200925024713-05bd7c71fbfe/go.mod h1:FGwQgZAt2Gh5mjlwJUlVB62JeYdo+if0xWxSEfBD9ig=
github.com/filecoin-project/go-statemachine v1.0.2 h1:421SSWBk8GIoCoWYYTE/d+qCWccgmRH0uXotXRDjUbc=
github.com/filecoin-project/go-statemachine v1.0.2/go.mod h1:jZdXXiHa61n4NmgWFG4w8tnqgvZVHYbJ3yW7+y8bF54=