File tree Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Expand file tree Collapse file tree 1 file changed +2
-0
lines changed Original file line number Diff line number Diff line change @@ -678,11 +678,13 @@ static void CheckRequiredOrDefault(const RPCArg& param)
678
678
void force_semicolon (ret_type)
679
679
680
680
// Optional arg (without default). Can also be called on required args, if needed.
681
+ TMPL_INST(nullptr , const UniValue*, maybe_arg;);
681
682
TMPL_INST (nullptr , std::optional<double >, maybe_arg ? std::optional{maybe_arg->get_real ()} : std::nullopt;);
682
683
TMPL_INST (nullptr , std::optional<bool >, maybe_arg ? std::optional{maybe_arg->get_bool ()} : std::nullopt;);
683
684
TMPL_INST (nullptr , const std::string*, maybe_arg ? &maybe_arg->get_str () : nullptr;);
684
685
685
686
// Required arg or optional arg with default value.
687
+ TMPL_INST (CheckRequiredOrDefault, const UniValue&, *CHECK_NONFATAL (maybe_arg););
686
688
TMPL_INST (CheckRequiredOrDefault, bool , CHECK_NONFATAL(maybe_arg)->get_bool(););
687
689
TMPL_INST (CheckRequiredOrDefault, int , CHECK_NONFATAL(maybe_arg)->getInt<int>(););
688
690
TMPL_INST (CheckRequiredOrDefault, uint64_t , CHECK_NONFATAL(maybe_arg)->getInt<uint64_t>(););
You can’t perform that action at this time.
0 commit comments