Skip to content

Commit

Permalink
Merge branch 'master' into proposalvotes-stats
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/masternodes/rpc_proposals.cpp
#	test/functional/feature_on_chain_government.py
  • Loading branch information
shohamc1 committed Feb 2, 2023
2 parents bc55ada + b7b14c2 commit 4a9c8f0
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -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
6 changes: 3 additions & 3 deletions src/amount.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/init.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,7 @@ void SetupServerArgs()
gArgs.AddArg("-consolidaterewards=<token-or-pool-symbol>", "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);
Expand Down
5 changes: 3 additions & 2 deletions src/masternodes/res.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,11 @@ Res CheckRes(T &&res, std::tuple<Args...> &&args) {
if constexpr (size == 0) {
static_assert(std::is_convertible_v<T, Res>);
return std::forward<T>(res);
} else if constexpr (std::
is_invocable_r_v<std::string, std::tuple_element_t<0, std::tuple<Args...>>, std::string>) {
} else if constexpr (std::is_invocable_r_v<std::string, std::tuple_element_t<0, std::tuple<Args...>>, std::string>) {
static_assert(std::is_convertible_v<T, Res>);
return Res::Err(std::invoke(std::get<0>(args), res.msg));
} else if constexpr (size == 1 && std::is_invocable_r_v<std::string, std::tuple_element_t<0, std::tuple<Args...>>>) {
return Res::Err(std::invoke(std::get<0>(args)));
} else {
return Res::Err(args, std::make_index_sequence<size>{});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 4a9c8f0

Please sign in to comment.