Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix number of totalAuctions in getloaninfo RPC #1124

Merged
merged 6 commits into from
Mar 18, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/masternodes/rpc_loan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@ UniValue getloaninfo(const JSONRPCRequest& request) {
});

pcustomcsview->ForEachVaultAuction([&](const CVaultId& vaultId, const CAuctionData& data) {
totalAuctions++;
totalAuctions += data.batchCount;
return true;
}, height);

Expand Down
3 changes: 3 additions & 0 deletions test/functional/feature_loan.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ def run_test(self):
assert_equal(len(auctionlist[0]['batches']), 3)
vault1 = self.nodes[0].getvault(vaultId1)

getloaninfo = self.nodes[0].getloaninfo()
assert_equal(getloaninfo['totals']['openAuctions'], 3)

# Fail auction bid
try:
self.nodes[0].placeauctionbid(vaultId1, 0, account, "410@TSLA")
Expand Down