Skip to content

Commit 752e95f

Browse files
committed
fix: aleph instance list to display Credits instead of $ALEPH for credits instance
1 parent 03eb763 commit 752e95f

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/aleph_client/commands/instance/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,7 @@ async def create(
213213
)
214214
)
215215
async with AuthenticatedAlephHttpClient(account=account) as client:
216-
vouchers = await client.voucher.fetch_vouchers_by_chain(
217-
address=address, chain=Chain(account.CHAIN)
218-
)
216+
vouchers = await client.voucher.fetch_vouchers_by_chain(address=address, chain=Chain(account.CHAIN))
219217
if len(vouchers) == 0:
220218
console.print("No NFT vouchers find on this account")
221219
raise typer.Exit(code=1)

src/aleph_client/commands/instance/display.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,15 +285,21 @@ async def _prepare_instance_column(self):
285285
required_tokens = Decimal(price.required_tokens)
286286

287287
if self.is_hold:
288-
aleph_price = Text(f"{displayable_amount(required_tokens, decimals=3)} (fixed)", style="magenta3")
288+
price_value = Text(f"{displayable_amount(required_tokens, decimals=3)} (fixed)", style="magenta3")
289289
else:
290290
psec = f"{displayable_amount(required_tokens, decimals=8)}/sec"
291291
phour = f"{displayable_amount(3600*required_tokens, decimals=3)}/hour"
292292
pday = f"{displayable_amount(86400*required_tokens, decimals=3)}/day"
293293
pmonth = f"{displayable_amount(2628000*required_tokens, decimals=3)}/month"
294-
aleph_price = Text.assemble(psec, " | ", phour, " | ", pday, " | ", pmonth, style="magenta3")
294+
price_value = Text.assemble(psec, " | ", phour, " | ", pday, " | ", pmonth, style="magenta3")
295295

296-
cost = Text.assemble("\n$ALEPH: ", aleph_price)
296+
price_label = (
297+
"Credits: "
298+
if (self.message.content.payment and self.message.content.payment.type == PaymentType.credit.value)
299+
else "$ALEPH: "
300+
)
301+
302+
cost = Text.assemble("\n" + price_label, price_value)
297303

298304
# Assemble the complete instance column
299305
result = Text.assemble(

0 commit comments

Comments
 (0)