Skip to content

Commit

Permalink
Test add missing tests + fix index filtering listauctionhistory (#1215)
Browse files Browse the repository at this point in the history
Co-authored-by: Jouzo <[email protected]>
  • Loading branch information
dcorral and Jouzo authored Jun 2, 2022
1 parent 67a4534 commit a47808b
Show file tree
Hide file tree
Showing 5 changed files with 461 additions and 216 deletions.
14 changes: 8 additions & 6 deletions src/masternodes/rpc_vault.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -524,15 +524,13 @@ UniValue listvaults(const JSONRPCRequest& request) {
if (!including_start)
{
including_start = true;
return (true);
}
if (!ownerAddress.empty() && ownerAddress != data.ownerAddress) {
return false;
return true;
}
auto vaultState = GetVaultState(vaultId, data);

if ((loanSchemeId.empty() || loanSchemeId == data.schemeId)
&& (state == VaultState::Unknown || state == vaultState)) {
&& (ownerAddress.empty() || ownerAddress == data.ownerAddress)
&& (state == VaultState::Unknown || state == vaultState)) {
UniValue vaultObj{UniValue::VOBJ};
if(!verbose){
vaultObj.pushKV("vaultId", vaultId.GetHex());
Expand Down Expand Up @@ -1156,7 +1154,7 @@ UniValue listauctionhistory(const JSONRPCRequest& request) {

// parse pagination
size_t limit = 100;
AuctionHistoryKey start = {~0u};
AuctionHistoryKey start = {~0u, {}, {}, ~0u};
{
if (request.params.size() > 1) {
UniValue paginationObj = request.params[1].get_obj();
Expand Down Expand Up @@ -1208,6 +1206,10 @@ UniValue listauctionhistory(const JSONRPCRequest& request) {
return true;
}

if (start.index!=~0u && start.index != key.index){
return true;
}

ret.push_back(auctionhistoryToJSON(key, valueLazy.get()));

return --limit != 0;
Expand Down
Loading

0 comments on commit a47808b

Please sign in to comment.