Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Project documentation" #6

Merged
merged 1 commit into from
Nov 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions lib/payment-subscription/payment-multi-validator/utils.ak
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub fn validate_payment_datum_internal(datum: PaymentDatum) -> Bool {
datum.total_subscription_fee == datum.interval_amount * datum.num_intervals

let sane_values =
datum.subscription_start >= 0 && datum.interval_length > 0 && datum.interval_amount > 0 && datum.num_intervals > 0 && datum.minimum_ada >= 0
datum.subscription_start >= 0 && datum.subscription_end > datum.subscription_start && datum.interval_length > 0 && datum.interval_amount > 0 && datum.num_intervals > 0 && datum.minimum_ada > 0
time_valid? && amounts_valid? && intervals_valid? && subscription_period_valid? && total_fee_valid? && sane_values?
}

Expand Down Expand Up @@ -71,7 +71,11 @@ pub fn validate_extension_datum(
new_datum.subscription_fee == service_datum.service_fee && new_datum.interval_length == service_datum.interval_length && new_datum.minimum_ada >= service_datum.minimum_ada

let sane_values =
new_datum.subscription_start >= 0 && new_datum.subscription_end > new_datum.subscription_start && new_datum.interval_length > 0 && new_datum.interval_amount > 0 && new_datum.num_intervals > 0 && new_datum.minimum_ada >= 0
new_datum.subscription_start >= 0 && new_datum.subscription_end > new_datum.subscription_start && new_datum.interval_length > 0 && new_datum.interval_amount > 0 && new_datum.num_intervals > 0 && new_datum.minimum_ada > 0

// Ensure that the subscription start is at least negative interval_length
let valid_start_time =
new_datum.subscription_start >= -new_datum.interval_length

and {
unchanged_fields_valid?,
Expand All @@ -81,6 +85,7 @@ pub fn validate_extension_datum(
follows_service_rules?,
updated_fields_valid?,
sane_values?,
valid_start_time?,
}
}

Expand Down
Loading