]> git.ardis.lu - solc-metadata/commitdiff
Log in CBOR diagnostic format
authorArdis Lu <ardisglu@gmail.com>
Wed, 25 Feb 2026 08:11:16 +0000 (00:11 -0800)
committerArdis Lu <ardisglu@gmail.com>
Wed, 25 Feb 2026 08:11:16 +0000 (00:11 -0800)
index.html

index 36659f31740fc2a79867d162f260802a735b4188..e3e1020a98d9630dc18c88c1eada66b06444fe50 100644 (file)
       }
       logOutput(result, '✅ Successfully extracted CBOR metadata.', cbor.map(v => v.toString(16).padStart(2, '0')).join(''));
       const metadata = decodeCBOR(cbor);
-      logOutput(result, '✅ Successfully decoded CBOR metadata.', JSON.stringify(metadata, null, 2));
+      // Minimal replacer to convert byte array values to CBOR diagnostic format.
+      const replacer = (_, v) => ArrayBuffer.isView(v) ? `h'${v.toHex()}'` : v;
+      logOutput(result, '✅ Successfully decoded CBOR metadata.', JSON.stringify(metadata, replacer, 2));
 
       // Fetch JSON metadata
       let json;
This page took 0.033052 seconds and 4 git commands to generate.