From 887a846e60f8052da87dc1f0ecbe7a09361229ae Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Thu, 16 Jul 2026 22:11:41 +0200 Subject: [PATCH] fix(db-sync): store DRep inline image data URI verbatim cardano-db-sync #2138 (#1966) stops stripping the `data:;base64,` prefix from an inline DRep-metadata image, storing the full contentUrl verbatim in `off_chain_vote_drep_data.image_url`. Assert the full data URI instead of the stripped base64 payload. --- cardano_node_tests/utils/dbsync_utils.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cardano_node_tests/utils/dbsync_utils.py b/cardano_node_tests/utils/dbsync_utils.py index 283311ecf..e0add6181 100644 --- a/cardano_node_tests/utils/dbsync_utils.py +++ b/cardano_node_tests/utils/dbsync_utils.py @@ -1332,8 +1332,6 @@ def check_off_chain_drep_registration( # noqa: C901 expected_metadata = metadata["body"] # For the image rules refer to: https://cips.cardano.org/cip/CIP-0119 - # off_chain_drep_data.image_url includes the image base64 with the data uri - # header prefix stripped and the off_chain_drep_data.image_sha256 remains empty. def _check_image() -> None: if "image" not in expected_metadata: return @@ -1349,10 +1347,10 @@ def _check_image() -> None: "Invalid metadata: base64 encoded image should start with 'data:image/'" ) if "base64" in content_url: - base64_image_data = content_url.split("base64,")[1] - if db_metadata.image_url != base64_image_data: + # db-sync stores the data URI verbatim (cardano-db-sync #2138). + if db_metadata.image_url != content_url: errors.append( - "'image_url' value is different than expected Base64 'contentUrl';" + "'image_url' value is different than expected data-URI 'contentUrl';" ) else: errors.append("Invalid metadata: image is not Base64 encoded")