Skip to content

Commit ba223fd

Browse files
authored
Fix: Put correct cost label for credit payment method. (#405)
1 parent c84ea65 commit ba223fd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/aleph_client/commands/instance/display.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ def __init__(
203203

204204
# Instance properties
205205
self.is_hold = message.content.payment and message.content.payment.type == PaymentType.hold.value
206+
self.is_credit = message.content.payment and message.content.payment.type == PaymentType.credit.value
206207
self.firmware = safe_getattr(message.content.environment, "trusted_execution.firmware")
207208
self.is_confidential = self.firmware and len(self.firmware) == 64
208209
self.has_gpu = True if safe_getattr(message.content.requirements, "gpu") else False
@@ -293,7 +294,8 @@ async def _prepare_instance_column(self):
293294
pmonth = f"{displayable_amount(2628000*required_tokens, decimals=3)}/month"
294295
aleph_price = Text.assemble(psec, " | ", phour, " | ", pday, " | ", pmonth, style="magenta3")
295296

296-
cost = Text.assemble("\n$ALEPH: ", aleph_price)
297+
cost_str = "\n$ALEPH: " if not self.is_credit else "\nCredits: "
298+
cost = Text.assemble(cost_str, aleph_price)
297299

298300
# Assemble the complete instance column
299301
result = Text.assemble(

0 commit comments

Comments
 (0)