Skip to content

Commit

Permalink
Merge pull request #2498 from threefoldtech/development_check_contractId
Browse files Browse the repository at this point in the history
Fix checking on rentContractId while choosing node
  • Loading branch information
xmonader authored Mar 26, 2024
2 parents bee662d + 7ed76e4 commit bd6c7c5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/playground/src/utils/nodeSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,11 @@ export async function validateRentContract(
}

try {
const contractInfo = await gridStore.grid.contracts.get({ id: node.rentContractId });
if (contractInfo.state.gracePeriod) {
throw `You can't deploy on node ${node.nodeId}, its rent contract in grace period. `;
if (node.rentContractId !== 0) {
const contractInfo = await gridStore.grid.contracts.get({ id: node.rentContractId });
if (contractInfo.state.gracePeriod) {
throw `You can't deploy on node ${node.nodeId}, its rent contract is in grace period.`;
}
}

return true;
Expand All @@ -219,7 +221,6 @@ export async function validateRentContract(
error,
"Something went wrong while checking status of the node. Please check your connection and try again.",
);

throw err;
}
}
Expand Down

0 comments on commit bd6c7c5

Please sign in to comment.