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

Function setThreshold

tools/contract-admin/rnode/cmd_rnode.go:98–116  ·  view source on GitHub ↗
(ctx *cli.Context)

Source from the content-addressed store, hash-verified

96)
97
98func setThreshold(ctx *cli.Context) error {
99 rnd, opts, client, err := createContractInstanceAndTransactor(ctx, true)
100 if err != nil {
101 return err
102 }
103 thresholdStr := utils.GetFirstStringArgument(ctx)
104 threshold := new(big.Int)
105 threshold, ok := threshold.SetString(thresholdStr, 10)
106 if !ok {
107 log.Info("Failed to parse string to big int", "string", thresholdStr)
108 return errors.New("Failed to parse string to big int" + " string " + thresholdStr)
109 }
110
111 tx, err := rnd.SetRnodeThreshold(opts, threshold)
112 if err != nil {
113 return err
114 }
115 return utils.WaitMined(client, tx)
116}
117
118func setPeriod(ctx *cli.Context) error {
119 rnd, opts, client, err := createContractInstanceAndTransactor(ctx, true)

Callers

nothing calls this directly

Calls 3

InfoMethod · 0.65
SetRnodeThresholdMethod · 0.45

Tested by

no test coverage detected