From 733fe3f8949260b7fd5358f0f3847062f6e14d6e Mon Sep 17 00:00:00 2001 From: Harun Mwangi Date: Mon, 9 Sep 2024 20:35:21 +0300 Subject: [PATCH 1/4] Update lib/payment-subscription/payment-multi-validator/utils.ak Co-authored-by: Mark Petruska --- lib/payment-subscription/payment-multi-validator/utils.ak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/payment-subscription/payment-multi-validator/utils.ak b/lib/payment-subscription/payment-multi-validator/utils.ak index 16b7b9b..bc84d76 100644 --- a/lib/payment-subscription/payment-multi-validator/utils.ak +++ b/lib/payment-subscription/payment-multi-validator/utils.ak @@ -19,7 +19,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.subscription_end > datum.subscription_start && datum.interval_length > 0 && datum.interval_amount > 0 && datum.num_intervals > 0 && datum.minimum_ada > 0 + datum.subscription_start >= 0 && 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? } From 2b683080616c227e88a00353f26706d925d3d64a Mon Sep 17 00:00:00 2001 From: Harun Mwangi Date: Mon, 9 Sep 2024 20:35:55 +0300 Subject: [PATCH 2/4] Update lib/payment-subscription/payment-multi-validator/utils.ak Co-authored-by: Mark Petruska --- lib/payment-subscription/payment-multi-validator/utils.ak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/payment-subscription/payment-multi-validator/utils.ak b/lib/payment-subscription/payment-multi-validator/utils.ak index bc84d76..59fccb1 100644 --- a/lib/payment-subscription/payment-multi-validator/utils.ak +++ b/lib/payment-subscription/payment-multi-validator/utils.ak @@ -81,7 +81,7 @@ 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 = From 1903678626c69d661ec9cd23a042e59a351f4990 Mon Sep 17 00:00:00 2001 From: Harun Mwangi Date: Mon, 9 Sep 2024 20:36:54 +0300 Subject: [PATCH 3/4] Update lib/payment-subscription/payment-multi-validator/utils.ak Co-authored-by: Mark Petruska --- lib/payment-subscription/payment-multi-validator/utils.ak | 3 --- 1 file changed, 3 deletions(-) diff --git a/lib/payment-subscription/payment-multi-validator/utils.ak b/lib/payment-subscription/payment-multi-validator/utils.ak index 59fccb1..28c2842 100644 --- a/lib/payment-subscription/payment-multi-validator/utils.ak +++ b/lib/payment-subscription/payment-multi-validator/utils.ak @@ -83,9 +83,6 @@ pub fn validate_extension_datum( 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 - // Ensure that the subscription start is at least negative interval_length - let valid_start_time = - new_datum.subscription_start >= -new_datum.interval_length trace @"extension_period:" trace cbor.diagnostic(extension_period) From aa2dca91e4fa4e67579df62849859d4a74d330f2 Mon Sep 17 00:00:00 2001 From: Harun Mwangi Date: Mon, 9 Sep 2024 21:01:47 +0300 Subject: [PATCH 4/4] fix: remove valid_start_time check --- lib/payment-subscription/payment-multi-validator/utils.ak | 2 -- 1 file changed, 2 deletions(-) diff --git a/lib/payment-subscription/payment-multi-validator/utils.ak b/lib/payment-subscription/payment-multi-validator/utils.ak index 28c2842..6bc9611 100644 --- a/lib/payment-subscription/payment-multi-validator/utils.ak +++ b/lib/payment-subscription/payment-multi-validator/utils.ak @@ -83,7 +83,6 @@ pub fn validate_extension_datum( 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 - trace @"extension_period:" trace cbor.diagnostic(extension_period) trace @"extension_intervals:" @@ -107,7 +106,6 @@ pub fn validate_extension_datum( follows_service_rules?, updated_fields_valid?, sane_values?, - valid_start_time?, } }