Skip to content

Commit

Permalink
Allow payment reuse for same app LRN (#961)
Browse files Browse the repository at this point in the history
Part of [Service provider auctions for web deployments](https://www.notion.so/Service-provider-auctions-for-web-deployments-104a6b22d47280dbad51d28aa3a91d75)

Reviewed-on: https://git.vdb.to/cerc-io/stack-orchestrator/pulls/961
Reviewed-by: ashwin <[email protected]>
Co-authored-by: Prathamesh Musale <[email protected]>
Co-committed-by: Prathamesh Musale <[email protected]>
  • Loading branch information
prathamesh0 authored and ashwin committed Oct 29, 2024
1 parent 23ca4c4 commit 39df468
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions stack_orchestrator/deploy/webapp/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 39df468

Please sign in to comment.