(c *cli.Context, file string, optionalConfig *config.Config)
| 2537 | } |
| 2538 | |
| 2539 | func shamirThreshold(c *cli.Context, file string, optionalConfig *config.Config) (int, error) { |
| 2540 | if c.Int("shamir-secret-sharing-threshold") != 0 { |
| 2541 | return c.Int("shamir-secret-sharing-threshold"), nil |
| 2542 | } |
| 2543 | var err error |
| 2544 | conf := optionalConfig |
| 2545 | if conf == nil { |
| 2546 | conf, err = loadConfig(c, file, nil) |
| 2547 | } |
| 2548 | if conf == nil { |
| 2549 | // This takes care of the following two case: |
| 2550 | // 1. No config was provided, or contains no creation rules. Err will be nil and ShamirThreshold will be the default value of 0. |
| 2551 | // 2. We did find a config file, but failed to load it. In that case the calling function will print the error and exit. |
| 2552 | return 0, err |
| 2553 | } |
| 2554 | return conf.ShamirThreshold, nil |
| 2555 | } |
| 2556 | |
| 2557 | func jsonValueToTreeInsertableValue(jsonValue string) (interface{}, error) { |
| 2558 | var valueToInsert interface{} |
no test coverage detected