Skip to content

Commit 87cbbb8

Browse files
feat: enhance logging in certificate registration on Solana by including certificate data and authenticity verification URL
1 parent 579f809 commit 87cbbb8

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

certified_builder/certificates_on_solana.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class CertificatesOnSolana:
2121

2222
@staticmethod
2323
def register_certificate_on_solana(certificate_data: dict) -> dict:
24-
logger.info("Registering certificate on Solana blockchain")
24+
logger.info("Registering certificate on Solana blockchain with data: %s", certificate_data)
2525
"""
2626
Registers a certificate on the Solana blockchain.
2727
@@ -41,11 +41,10 @@ def register_certificate_on_solana(certificate_data: dict) -> dict:
4141
},
4242
json=certificate_data
4343
)
44-
logger.info(f"Solana response status code: {response.status_code}")
44+
logger.info(f"Solana response status code: {response.status_code}")
4545
response.raise_for_status()
4646
solana_response = response.json()
4747
return solana_response
48-
logger.info("Certificate registered successfully on Solana")
4948
except Exception as e:
5049
logger.error(f"Error registering certificate on Solana: {str(e)}")
5150
raise CertificatesOnSolanaException(details=str(e), cause=e)

certified_builder/certified_builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def build_certificates(self, participants: List[Participant]):
6666

6767
if not participant.authenticity_verification_url:
6868
raise RuntimeError("Failed to get authenticity verification URL from Solana response")
69-
69+
logger.info(f"URL de verificação de autenticidade: {participant.authenticity_verification_url}")
7070
# Download template and logo only if they are not shared
7171
if not all_same_background:
7272
certificate_template = self._download_image(participant.certificate.background)

0 commit comments

Comments
 (0)