From 7dfeece0e2d438d5b8ea36c7d8096115cd809875 Mon Sep 17 00:00:00 2001 From: Ardis Lu Date: Wed, 9 Aug 2023 20:07:29 -0700 Subject: [PATCH] Add more granular output messages --- index.html | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index 69fa11f..c0fc1cf 100644 --- a/index.html +++ b/index.html @@ -189,20 +189,23 @@ // Parse runtime bytecode const cbor = extractCBOR(bytecode); + result.textContent += '✅ Successfully extracted CBOR metadata.\n'; const metadata = decodeCBOR(cbor); + result.textContent += '✅ Successfully decoded CBOR metadata.\n'; if (metadata.bzzr0 !== undefined) { const hex = [...metadata.bzzr0].map(b => b.toString(16).padStart(2, '0')).join(''); - result.textContent += 'Unable to fetch JSON metadata because the smart contract uses a Swarm hash:\n'; + result.textContent += '❌ Unable to fetch JSON metadata because the smart contract uses a Swarm hash:\n'; result.textContent += `bzzr://${hex}`; } else if (metadata.bzzr1 !== undefined) { const hex = [...metadata.bzzr1].map(b => b.toString(16).padStart(2, '0')).join(''); - result.textContent += 'Unable to fetch JSON metadata because the smart contract uses a Swarm hash:\n'; + result.textContent += '❌ Unable to fetch JSON metadata because the smart contract uses a Swarm hash:\n'; result.textContent += `bzz-raw://${hex}`; } else { const { cidV0, cidV1 } = calculateCID(metadata); + result.textContent += '✅ Successfully calculated IPFS CID.\n'; try { const json = await fetchJSONMetadata(cidV1, ipfs); result.textContent += '✅ Successfully fetched JSON metadata.\n\n'; -- 2.47.3