Skip to content

Commit

Permalink
Chore: include node contract on rented node in the getTotalOverDue fu…
Browse files Browse the repository at this point in the history
…nction this will be needed for UI
  • Loading branch information
0oM4R committed Oct 10, 2024
1 parent aed21b5 commit 0a4aab6
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/grid_client/src/modules/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -683,11 +683,14 @@ class Contracts {

default:
/** skip node contracts on rented nodes as it already calculated in the rent contract */
if (rentedNodesIds.includes(contract.details.nodeId)) continue;
result.nodeContracts[contract.contract_id] = (
await this.getContractOverdueAmount(contract, proxy)
).toNumber();
result.totalOverdueAmount += result.nodeContracts[contract.contract_id];
if (rentedNodesIds.includes(contract.details.nodeId)) {
result.nodeContracts[contract.contract_id] = 0;
} else {
result.nodeContracts[contract.contract_id] = (
await this.getContractOverdueAmount(contract, proxy)
).toNumber();
result.totalOverdueAmount += result.nodeContracts[contract.contract_id];
}
}
}
return result;
Expand Down

0 comments on commit 0a4aab6

Please sign in to comment.