@@ -202,26 +202,19 @@ contract EthscriptionsJsonTest is TestSetup {
202202 vm.prank (creator);
203203 eth.createEthscription (params);
204204
205- // Test readChunk - now it stores raw content only
206- uint256 pointerCount = eth.getContentPointerCount (txHash);
207- assertEq (pointerCount, 3 , "Should have 3 chunks " ); // 50000 bytes = 3 chunks
208-
209- // Read first chunk
210- bytes memory chunk0 = eth.readChunk (txHash, 0 );
211- assertEq (chunk0.length , 24575 , "First chunk should be full size " );
212-
213- // Read last chunk
214- bytes memory chunk2 = eth.readChunk (txHash, 2 );
215- uint256 totalLength = largeContent.length ; // Use largeContent length, not contentUri
216- uint256 expectedLastChunkSize = totalLength - (24575 * 2 );
217- assertEq (chunk2.length , expectedLastChunkSize, "Last chunk should be remainder " );
218-
219- // Verify content matches when reassembled from chunks
220- bytes memory reconstructed;
221- for (uint256 i = 0 ; i < pointerCount; i++ ) {
222- reconstructed = abi.encodePacked (reconstructed, eth.readChunk (txHash, i));
223- }
224- assertEq (reconstructed, largeContent, "Reconstructed chunks should match original content " );
205+ // Test content storage - now stores everything in a single contract
206+ assertTrue (eth.hasContent (txHash), "Should have content stored " );
207+
208+ // Get the content pointer
209+ address pointer = eth.getContentPointer (txHash);
210+ assertTrue (pointer != address (0 ), "Should have a valid content pointer " );
211+
212+ // Read the entire content (no chunking needed)
213+ bytes memory storedContent = eth.readContent (txHash);
214+ assertEq (storedContent.length , largeContent.length , "Content length should match " );
215+
216+ // Verify content matches exactly
217+ assertEq (storedContent, largeContent, "Stored content should match original content " );
225218
226219 // Also verify tokenURI returns valid JSON
227220 string memory tokenUri = eth.tokenURI (eth.getTokenId (txHash));
@@ -252,8 +245,8 @@ contract EthscriptionsJsonTest is TestSetup {
252245 false
253246 ));
254247
255- // Verify we have exactly 2 chunks
256- assertEq (eth.getContentPointerCount (txHash), targetChunks, "Should have exactly 2 chunks " );
248+ // Verify content is stored (no chunking anymore)
249+ assertTrue (eth.hasContent (txHash), "Should have content stored " );
257250
258251 // Read back and verify in JSON metadata
259252 string memory retrieved = eth.tokenURI (tokenId);
@@ -291,13 +284,12 @@ contract EthscriptionsJsonTest is TestSetup {
291284 false
292285 ));
293286
294- // Verify we have 2 chunks (24575 + 5425 bytes for raw content )
295- assertEq (eth.getContentPointerCount (txHash), 2 , "Should have 2 chunks " );
287+ // Verify content is stored (no chunking anymore )
288+ assertTrue (eth.hasContent (txHash), "Should have content stored " );
296289
297- // Verify second chunk has correct size
298- bytes memory secondChunk = eth.readChunk (txHash, 1 );
299- uint256 expectedSecondChunkSize = content.length - 24575 ; // Use content length, not URI
300- assertEq (secondChunk.length , expectedSecondChunkSize, "Second chunk size mismatch " );
290+ // Verify the full content is stored correctly
291+ bytes memory storedContent = eth.readContent (txHash);
292+ assertEq (storedContent.length , content.length , "Content length should match " );
301293
302294 // Read back and verify in JSON metadata
303295 string memory retrieved = eth.tokenURI (tokenId);
@@ -326,8 +318,8 @@ contract EthscriptionsJsonTest is TestSetup {
326318 false
327319 ));
328320
329- // Verify single chunk
330- assertEq (eth.getContentPointerCount (txHash), 1 , "Should have 1 chunk " );
321+ // Verify content is stored
322+ assertTrue (eth.hasContent (txHash), "Should have content stored " );
331323
332324 // Verify content in JSON metadata
333325 string memory retrieved = eth.tokenURI (tokenId);
@@ -430,20 +422,21 @@ contract EthscriptionsJsonTest is TestSetup {
430422 console.log ("ESIP6 creation gas (reusing content): " , esip6Gas);
431423 assertTrue (esip6Gas < 1000000 , "ESIP6 should save gas by reusing content " );
432424
433- // Verify both have same pointer count
434- assertEq (eth.getContentPointerCount (txHash1), eth.getContentPointerCount (txHash3), "Should have same pointer count " );
425+ // Verify both have content stored and use the same pointer
426+ assertTrue (eth.hasContent (txHash1) && eth.hasContent (txHash3), "Both should have content " );
427+ assertEq (eth.getContentPointer (txHash1), eth.getContentPointer (txHash3), "Should share same content pointer " );
435428 }
436429
437430 function test_WorstCaseGas_1MB () public {
438- // Skip this test - HTML viewer generation runs out of memory with 1MB content
439- // This is a known limitation for extremely large content
440- vm.skip (true );
441431 vm.pauseGasMetering ();
442432
443433 // Create 1MB content URI (1,048,576 bytes)
444434 bytes memory largeContent = new bytes (1048576 );
445- for (uint i = 0 ; i < largeContent.length ; i ++ ) {
435+ for (uint i = 0 ; i < largeContent.length ;) {
446436 largeContent[i] = bytes1 (uint8 (65 + (i % 26 ))); // Fill with A-Z pattern
437+ unchecked {
438+ ++ i;
439+ }
447440 }
448441 bytes memory contentUri = abi.encodePacked ("data:text/plain;base64, " , largeContent);
449442
0 commit comments