From c50ba752900a2f5606975baaee0230cc8029e93a Mon Sep 17 00:00:00 2001 From: Dalena Date: Fri, 18 Oct 2024 15:40:55 -0500 Subject: [PATCH 1/6] fix: tier names --- silverback/cluster/types.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/silverback/cluster/types.py b/silverback/cluster/types.py index 4f054d52..3f5b6452 100644 --- a/silverback/cluster/types.py +++ b/silverback/cluster/types.py @@ -207,7 +207,7 @@ def validate_product_code( class ClusterTier(enum.IntEnum): """Suggestions for different tier configurations""" - PERSONAL = ClusterConfiguration( + STANDARD = ClusterConfiguration( cpu="0.25 vCPU", memory="512 MiB", networks=3, @@ -215,7 +215,7 @@ class ClusterTier(enum.IntEnum): bandwidth="512 B/sec", # 1.236 GB/mo duration=3, # months ).encode() - PROFESSIONAL = ClusterConfiguration( + PREMIUM = ClusterConfiguration( cpu="1 vCPU", memory="2 GB", networks=10, From cf28401426bbf932ec7fd161be14cfb8f843367f Mon Sep 17 00:00:00 2001 From: Dalena Date: Fri, 18 Oct 2024 15:43:20 -0500 Subject: [PATCH 2/6] fix: tier names in cli --- silverback/_cli.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/silverback/_cli.py b/silverback/_cli.py index 02f59173..5787e162 100644 --- a/silverback/_cli.py +++ b/silverback/_cli.py @@ -309,15 +309,15 @@ def pay(): @click.option( "-t", "--tier", - default=ClusterTier.PERSONAL.name.capitalize(), + default=ClusterTier.STANDARD.name.capitalize(), metavar="NAME", type=click.Choice( [ - ClusterTier.PERSONAL.name.capitalize(), - ClusterTier.PROFESSIONAL.name.capitalize(), + ClusterTier.STANDARD.name.capitalize(), + ClusterTier.PREMIUM.name.capitalize(), ] ), - help="Named set of options to use for cluster as a base (Defaults to Personal)", + help="Named set of options to use for cluster as a base (Defaults to Standard)", ) @click.option( "-c", From 54b6ef99fe0b914638b68204ec12ccbae83d2096 Mon Sep 17 00:00:00 2001 From: Dalena Date: Fri, 18 Oct 2024 16:12:07 -0500 Subject: [PATCH 3/6] fix: tier case sensitive --- silverback/_cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/silverback/_cli.py b/silverback/_cli.py index 5787e162..d1f33674 100644 --- a/silverback/_cli.py +++ b/silverback/_cli.py @@ -315,7 +315,8 @@ def pay(): [ ClusterTier.STANDARD.name.capitalize(), ClusterTier.PREMIUM.name.capitalize(), - ] + ], + case_sensitive=False ), help="Named set of options to use for cluster as a base (Defaults to Standard)", ) From e626ac4a4e5acaa04bc39e03dd03a54687b0d71d Mon Sep 17 00:00:00 2001 From: Dalena Date: Fri, 18 Oct 2024 16:25:17 -0500 Subject: [PATCH 4/6] feat: add payment amount --- silverback/_cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/silverback/_cli.py b/silverback/_cli.py index d1f33674..76a65219 100644 --- a/silverback/_cli.py +++ b/silverback/_cli.py @@ -421,7 +421,8 @@ def create_payment_stream( assert token_amount # mypy happy click.echo(yaml.safe_dump(dict(configuration=configuration.settings_display_dict()))) - click.echo(f"duration: {stream_time}\n") + click.echo(f"duration: {stream_time}") + click.echo(f"payment: {token_amount / 1e18} {token.symbol()}\n") if not click.confirm( f"Do you want to use this configuration to fund Cluster '{cluster_path}'?" From b4abf1b9cb4d1747d73e16d7b12cbe594ec06813 Mon Sep 17 00:00:00 2001 From: Dalena Date: Fri, 18 Oct 2024 16:30:15 -0500 Subject: [PATCH 5/6] chore: lint --- silverback/_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/silverback/_cli.py b/silverback/_cli.py index 76a65219..eca35d29 100644 --- a/silverback/_cli.py +++ b/silverback/_cli.py @@ -316,7 +316,7 @@ def pay(): ClusterTier.STANDARD.name.capitalize(), ClusterTier.PREMIUM.name.capitalize(), ], - case_sensitive=False + case_sensitive=False, ), help="Named set of options to use for cluster as a base (Defaults to Standard)", ) From decdbd459820a1339907a3402f61a3b60444a176 Mon Sep 17 00:00:00 2001 From: Dalena Date: Fri, 18 Oct 2024 16:43:12 -0500 Subject: [PATCH 6/6] fix: token decimals --- silverback/_cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/silverback/_cli.py b/silverback/_cli.py index eca35d29..337b2300 100644 --- a/silverback/_cli.py +++ b/silverback/_cli.py @@ -422,7 +422,7 @@ def create_payment_stream( click.echo(yaml.safe_dump(dict(configuration=configuration.settings_display_dict()))) click.echo(f"duration: {stream_time}") - click.echo(f"payment: {token_amount / 1e18} {token.symbol()}\n") + click.echo(f"payment: {token_amount / (10 ** token.decimals())} {token.symbol()}\n") if not click.confirm( f"Do you want to use this configuration to fund Cluster '{cluster_path}'?"