Skip to content

Commit

Permalink
Check that subscription hasn't already ended
Browse files Browse the repository at this point in the history
  • Loading branch information
theref committed Aug 16, 2024
1 parent d4dac28 commit 2619079
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/initiate_ritual.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,13 @@ def cli(
+ fee_model_contract.redPeriodDuration()
)
if start_of_subscription > 0:
end_of_subscription = fee_model_contract.getEndOfSubscription()
now = chain.blocks.head.timestamp
if now > end_of_subscription:
raise ValueError("Subscription has already ended.")
click.echo(
"Subscription has already started. Subtracting the elapsed time from the duration."
)
now = chain.blocks.head.timestamp
elapsed = now - start_of_subscription + 100
duration -= elapsed

Expand Down

0 comments on commit 2619079

Please sign in to comment.