Skip to content

Commit b603c27

Browse files
committed
Fix getBlobs() in Util, remove size limitation in example
1 parent 59a0b25 commit b603c27

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/util/examples/blobs.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ const kzg = new microEthKZG(trustedSetup)
1515

1616
// Use with node ./examples/blobs.ts <file path>
1717
const filePath = process.argv[2]
18-
let blobData: string = fs.readFileSync(filePath, 'ascii')
18+
const blobData: string = fs.readFileSync(filePath, 'ascii')
1919
console.log(blobData)
2020
console.log(blobData.length)
21-
blobData = blobData.substring(0, 100)
21+
//blobData = blobData.substring(0, 100)
2222

2323
const blobs = [getBlob(hexToBytes(`0x${blobData}`))]
2424

packages/util/src/blobs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export function getBlob(data: Uint8Array): PrefixedHexString {
4040
const blob = new Uint8Array(BLOB_SIZE)
4141
for (let i = 0; i < FIELD_ELEMENTS_PER_BLOB; i++) {
4242
const chunk = new Uint8Array(32)
43-
chunk.set(data.subarray(i * 31, (i + 1) * 31), 0)
43+
chunk.set(data.subarray(i * 32, (i + 1) * 32), 0)
4444
blob.set(chunk, i * 32)
4545
}
4646

0 commit comments

Comments
 (0)