Skip to content

Commit bb64e2f

Browse files
committed
rpc: deprecate argument for defining scheme type in bls generate
1 parent ae262f3 commit bb64e2f

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

doc/release-notes-6723.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ Updated RPCs
44
* The RPCs `protx register_legacy`, `protx register_fund_legacy`, `protx register_prepare_legacy` and
55
`protx update_registrar_legacy` have been deprecated in Dash Core v23 and may be removed in a future version
66
They can be re-enabled with the runtime argument `-deprecatedrpc=legacy_mn`.
7+
8+
* The argument `legacy` in `bls generate` has been deprecated in Dash Core v23 and may be ignored in a future version.
9+
It can be re-enabled with the runtime argument `deprecatedrpc=legacy_mn`.

src/rpc/evo.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1713,7 +1713,7 @@ static RPCHelpMan bls_generate()
17131713
"bls generate",
17141714
"\nReturns a BLS secret/public key pair.\n",
17151715
{
1716-
{"legacy", RPCArg::Type::BOOL, RPCArg::Default{false}, "Set it true if need in legacy BLS scheme"},
1716+
{"legacy", RPCArg::Type::BOOL, RPCArg::Default{false}, "(DEPRECATED, can be set if -deprecatedrpc=legacy_mn is passed) Set true to use legacy BLS scheme"},
17171717
},
17181718
RPCResult{RPCResult::Type::OBJ,
17191719
"",
@@ -1727,6 +1727,9 @@ static RPCHelpMan bls_generate()
17271727
sk.MakeNewKey();
17281728
bool bls_legacy_scheme{false};
17291729
if (!request.params[0].isNull()) {
1730+
if (!IsDeprecatedRPCEnabled("legacy_mn")) {
1731+
throw std::runtime_error("DEPRECATED: Pass config option -deprecatedrpc=legacy_mn to set this argument");
1732+
}
17301733
bls_legacy_scheme = ParseBoolV(request.params[0], "bls_legacy_scheme");
17311734
}
17321735
UniValue ret(UniValue::VOBJ);

src/test/rpc_tests.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ class HasJSON
4141
class RPCTestingSetup : public TestingSetup
4242
{
4343
public:
44+
RPCTestingSetup()
45+
: TestingSetup(CBaseChainParams::MAIN, {"-deprecatedrpc=legacy_mn"}) {}
46+
4447
UniValue TransformParams(const UniValue& params, std::vector<std::string> arg_names);
4548
UniValue CallRPC(std::string args);
4649
};

0 commit comments

Comments
 (0)