From: Ardis Lu Date: Thu, 10 Aug 2023 03:07:29 +0000 (-0700) Subject: Add more granular output messages X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=7dfeece0e2d438d5b8ea36c7d8096115cd809875;p=solc-metadata Add more granular output messages --- 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';