MCPcopy Create free account
hub / github.com/CPChain/chain / GetFirstTwoIntArgument

Function GetFirstTwoIntArgument

tools/contract-admin/utils/utils.go:66–84  ·  view source on GitHub ↗
(ctx *cli.Context)

Source from the content-addressed store, hash-verified

64}
65
66func GetFirstTwoIntArgument(ctx *cli.Context) (int64, int64) {
67 if ctx.NArg() != 2 {
68 log.Fatal("Invalid length of arguments", "want", 2, "got", ctx.NArg())
69 }
70
71 arg1 := ctx.Args().Get(0)
72 v1, err := strconv.Atoi(arg1)
73 if err != nil {
74 log.Fatal("Failed to parse value", "value", arg1, "err", err)
75 }
76
77 arg2 := ctx.Args().Get(1)
78 v2, err := strconv.Atoi(arg2)
79 if err != nil {
80 log.Fatal("Failed to parse value", "value", arg2, "err", err)
81 }
82
83 return int64(v1), int64(v2)
84}
85
86func GetAddressAndKey(keystoreFilePath, password string) (common.Address, *keystore.Key) {
87

Callers

nothing calls this directly

Calls 2

FatalMethod · 0.65
GetMethod · 0.65

Tested by

no test coverage detected