From 9aaf14203ac9d0c5bf9eb96830b5638f5907fa3e Mon Sep 17 00:00:00 2001 From: Prathamesh Musale Date: Tue, 29 Oct 2024 16:36:13 +0530 Subject: [PATCH] Allow payment reuse for same app LRN --- stack_orchestrator/deploy/webapp/util.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/stack_orchestrator/deploy/webapp/util.py b/stack_orchestrator/deploy/webapp/util.py index 5f670270..eebdb23c 100644 --- a/stack_orchestrator/deploy/webapp/util.py +++ b/stack_orchestrator/deploy/webapp/util.py @@ -851,9 +851,11 @@ def confirm_payment(laconic: LaconicRegistryClient, record, payment_address, min {"deployer": record.attributes.deployer, "payment": tx.hash}, all=True ) if len(used): + # Fetch the app name from request record + used_request = laconic.get_record(used[0].attributes.request, require=True) + # Check that payment was used for deployment of same application - app_record = laconic.get_record(record.attributes.application, require=True) - if app_record.id != used[0].attributes.application: + if record.attributes.application != used_request.attributes.application: logger.log(f"{record.id}: payment {tx.hash} already used on a different application deployment {used}") return False -- 2.45.2