diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index bfbebabd7b6..bc4826fa91e 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,6 +1,6 @@ # Define individuals that are responsible for code in a repository. # More details are here: https://help.github.com/articles/about-codeowners/ -/.github/ @Bushstar @Mixa84 @wafflespeanut @hidiego @prasannavl @mambisi @Jouzo @fuxingloh +#/.github/ @Bushstar @Mixa84 @wafflespeanut @hidiego @prasannavl @Jouzo @fuxingloh -/src/ @Bushstar @Mixa84 @wafflespeanut @hidiego @prasannavl @mambisi @Jouzo +#/src/ @Bushstar @Mixa84 @wafflespeanut @hidiego @prasannavl @mambisi @Jouzo diff --git a/src/amount.h b/src/amount.h index c94f6edaff2..aba91174928 100644 --- a/src/amount.h +++ b/src/amount.h @@ -125,7 +125,7 @@ struct CTokenAmount { // simple std::pair is less informative Res Add(CAmount amount) { // safety checks - Require(amount >= 0, "negative amount: %s", GetDecimaleString(amount)); + Require(amount >= 0, [=]{ return strprintf("negative amount: %s", GetDecimaleString(amount)); }); // add auto sumRes = SafeAdd(nValue, amount); @@ -137,8 +137,8 @@ struct CTokenAmount { // simple std::pair is less informative Res Sub(CAmount amount) { // safety checks - Require(amount >= 0, "negative amount: %s", GetDecimaleString(amount)); - Require(nValue >= amount, "amount %s is less than %s", GetDecimaleString(nValue), GetDecimaleString(amount)); + Require(amount >= 0, [=]{ return strprintf("negative amount: %s", GetDecimaleString(amount)); }); + Require(nValue >= amount, [=]{ return strprintf("amount %s is less than %s", GetDecimaleString(nValue), GetDecimaleString(amount)); }); // sub nValue -= amount; diff --git a/src/init.cpp b/src/init.cpp index 8117c158542..57a1b14988a 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -630,6 +630,7 @@ void SetupServerArgs() gArgs.AddArg("-consolidaterewards=", "Consolidate rewards on startup. Accepted multiple times for each token symbol", ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST); gArgs.AddArg("-rpccache=<0/1/2>", "Cache rpc results - uses additional memory to hold on to the last results per block, but faster (0=none, 1=all, 2=smart)", ArgsManager::ALLOW_ANY, OptionsCategory::DEBUG_TEST); gArgs.AddArg("-negativeinterest", "(experimental) Track negative interest values", ArgsManager::ALLOW_ANY, OptionsCategory::HIDDEN); + gArgs.AddArg("-rpc-governance-accept-neutral", "Allow voting with neutral votes for JellyFish purpose", ArgsManager::ALLOW_ANY, OptionsCategory::HIDDEN); #if HAVE_DECL_DAEMON gArgs.AddArg("-daemon", "Run in the background as a daemon and accept commands", ArgsManager::ALLOW_ANY, OptionsCategory::OPTIONS); diff --git a/src/masternodes/res.h b/src/masternodes/res.h index c8b4a3b7750..d8a3cc0d1cf 100644 --- a/src/masternodes/res.h +++ b/src/masternodes/res.h @@ -113,10 +113,11 @@ Res CheckRes(T &&res, std::tuple &&args) { if constexpr (size == 0) { static_assert(std::is_convertible_v); return std::forward(res); - } else if constexpr (std:: - is_invocable_r_v>, std::string>) { + } else if constexpr (std::is_invocable_r_v>, std::string>) { static_assert(std::is_convertible_v); return Res::Err(std::invoke(std::get<0>(args), res.msg)); + } else if constexpr (size == 1 && std::is_invocable_r_v>>) { + return Res::Err(std::invoke(std::get<0>(args))); } else { return Res::Err(args, std::make_index_sequence{}); } diff --git a/test/functional/feature_on_chain_government_fee_distribution.py b/test/functional/feature_on_chain_government_fee_distribution.py index f18759fabc7..996a35878a4 100755 --- a/test/functional/feature_on_chain_government_fee_distribution.py +++ b/test/functional/feature_on_chain_government_fee_distribution.py @@ -17,10 +17,10 @@ def set_test_params(self): self.num_nodes = 4 self.setup_clean_chain = True self.extra_args = [ - ['-dummypos=0', '-txnotokens=0', '-amkheight=50', '-bayfrontheight=51', '-eunosheight=80', '-fortcanningheight=82', '-fortcanninghillheight=84', '-fortcanningroadheight=86', '-fortcanningcrunchheight=88', '-fortcanningspringheight=90', '-fortcanninggreatworldheight=94', '-grandcentralheight=101'], - ['-dummypos=0', '-txnotokens=0', '-amkheight=50', '-bayfrontheight=51', '-eunosheight=80', '-fortcanningheight=82', '-fortcanninghillheight=84', '-fortcanningroadheight=86', '-fortcanningcrunchheight=88', '-fortcanningspringheight=90', '-fortcanninggreatworldheight=94', '-grandcentralheight=101'], - ['-dummypos=0', '-txnotokens=0', '-amkheight=50', '-bayfrontheight=51', '-eunosheight=80', '-fortcanningheight=82', '-fortcanninghillheight=84', '-fortcanningroadheight=86', '-fortcanningcrunchheight=88', '-fortcanningspringheight=90', '-fortcanninggreatworldheight=94', '-grandcentralheight=101'], - ['-dummypos=0', '-txnotokens=0', '-amkheight=50', '-bayfrontheight=51', '-eunosheight=80', '-fortcanningheight=82', '-fortcanninghillheight=84', '-fortcanningroadheight=86', '-fortcanningcrunchheight=88', '-fortcanningspringheight=90', '-fortcanninggreatworldheight=94', '-grandcentralheight=101'], + ['-dummypos=0', '-txnotokens=0', '-rpc-governance-accept-neutral', '-amkheight=50', '-bayfrontheight=51', '-eunosheight=80', '-fortcanningheight=82', '-fortcanninghillheight=84', '-fortcanningroadheight=86', '-fortcanningcrunchheight=88', '-fortcanningspringheight=90', '-fortcanninggreatworldheight=94', '-grandcentralheight=101'], + ['-dummypos=0', '-txnotokens=0', '-rpc-governance-accept-neutral', '-amkheight=50', '-bayfrontheight=51', '-eunosheight=80', '-fortcanningheight=82', '-fortcanninghillheight=84', '-fortcanningroadheight=86', '-fortcanningcrunchheight=88', '-fortcanningspringheight=90', '-fortcanninggreatworldheight=94', '-grandcentralheight=101'], + ['-dummypos=0', '-txnotokens=0', '-rpc-governance-accept-neutral', '-amkheight=50', '-bayfrontheight=51', '-eunosheight=80', '-fortcanningheight=82', '-fortcanninghillheight=84', '-fortcanningroadheight=86', '-fortcanningcrunchheight=88', '-fortcanningspringheight=90', '-fortcanninggreatworldheight=94', '-grandcentralheight=101'], + ['-dummypos=0', '-txnotokens=0', '-rpc-governance-accept-neutral', '-amkheight=50', '-bayfrontheight=51', '-eunosheight=80', '-fortcanningheight=82', '-fortcanninghillheight=84', '-fortcanningroadheight=86', '-fortcanningcrunchheight=88', '-fortcanningspringheight=90', '-fortcanninggreatworldheight=94', '-grandcentralheight=101'], ] def test_cfp_fee_distribution(self, amount, expectedFee, burnPct, vote, cycles=2, changeFeeAndBurnPCT = False):