diff --git a/src/masternodes/govvariables/attributes.cpp b/src/masternodes/govvariables/attributes.cpp index abaafda7ae..12742b0d1c 100644 --- a/src/masternodes/govvariables/attributes.cpp +++ b/src/masternodes/govvariables/attributes.cpp @@ -678,8 +678,11 @@ UniValue ATTRIBUTES::ExportFiltered(GovVarsFilter filter, const std::string &pre ret.pushKV(key, result); } else if (const auto splitValues = boost::get(&attribute.second)) { std::string keyValue; - for (const auto& [tokenId, multiplier] : *splitValues) { - keyValue += KeyBuilder(tokenId, multiplier) + ','; + for (auto it{splitValues->begin()}; it != splitValues->end(); ++it) { + if (it != splitValues->begin()) { + keyValue += ','; + } + keyValue += KeyBuilder(it->first, it->second); } ret.pushKV(key, keyValue); } else if (const auto& descendantPair = boost::get(&attribute.second)) { diff --git a/test/functional/feature_setgov.py b/test/functional/feature_setgov.py index ea1fd9f254..98c89678a2 100755 --- a/test/functional/feature_setgov.py +++ b/test/functional/feature_setgov.py @@ -690,7 +690,7 @@ def run_test(self): self.nodes[0].setgov({"ATTRIBUTES":{f'v0/token/4/fixed_interval_price_id':'TSLA/USD', f'v0/token/4/loan_minting_enabled':'true', f'v0/token/4/loan_minting_interest':'1'}}) self.nodes[0].generate(1) - self.nodes[0].setgov({"ATTRIBUTES":{'v0/oracles/splits/4000':'4/50,5/5,'}}) + self.nodes[0].setgov({"ATTRIBUTES":{'v0/oracles/splits/4000':'4/50,5/5'}}) self.nodes[0].generate(1) # Check auto lock @@ -710,7 +710,7 @@ def run_test(self): self.nodes[0].generate(1) attriutes = self.nodes[0].getgov('ATTRIBUTES')['ATTRIBUTES'] - assert_equal(attriutes['v0/oracles/splits/4000'], '4/50,5/10,') + assert_equal(attriutes['v0/oracles/splits/4000'], '4/50,5/10') if __name__ == '__main__': GovsetTest ().main () diff --git a/test/functional/feature_token_split.py b/test/functional/feature_token_split.py index 29b3ce00fd..4bf5a7e26c 100644 --- a/test/functional/feature_token_split.py +++ b/test/functional/feature_token_split.py @@ -618,9 +618,9 @@ def check_govvar_deletion(self): # Check splits result = self.nodes[0].listgovs()[8][0]['ATTRIBUTES'] - assert_equal(result[f'v0/oracles/splits/{split_height}'], f'{self.idTSLA}/2,') - assert_equal(result[f'v0/oracles/splits/500000'], f'{self.idTSLA}/2,') - assert_equal(result[f'v0/oracles/splits/1000000'], f'{self.idTSLA}/2,{self.idNVDA}/2,') + assert_equal(result[f'v0/oracles/splits/{split_height}'], f'{self.idTSLA}/2') + assert_equal(result[f'v0/oracles/splits/500000'], f'{self.idTSLA}/2') + assert_equal(result[f'v0/oracles/splits/1000000'], f'{self.idTSLA}/2,{self.idNVDA}/2') # Split self.nodes[0].generate(1) @@ -629,7 +629,7 @@ def check_govvar_deletion(self): result = self.nodes[0].listgovs()[8][0]['ATTRIBUTES'] assert(f'v0/oracles/splits/{split_height}' not in result) assert(f'v0/oracles/splits/500000' not in result) - assert_equal(result[f'v0/oracles/splits/1000000'], f'{self.idNVDA}/2,') + assert_equal(result[f'v0/oracles/splits/1000000'], f'{self.idNVDA}/2') # Swap old for new values self.idTSLA = list(self.nodes[0].gettoken(self.symbolTSLA).keys())[0]