Skip to content

Commit aa280bc

Browse files
authored
Simplify binaryToFields by removing padding
Removed padding logic for buffer chunks in binaryToFields function.
1 parent c1f3c91 commit aa280bc

File tree

1 file changed

+2
-6
lines changed
  • barretenberg/acir_tests/sol-test/src

1 file changed

+2
-6
lines changed

barretenberg/acir_tests/sol-test/src/index.js

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,8 @@ const linkLibrary = (bytecode, libraryName, libraryAddress) => {
173173
const binaryToFields = (buffer) => {
174174
const fields = [];
175175
for (let i = 0; i < buffer.length; i += 32) {
176-
const chunk = buffer.slice(i, Math.min(i + 32, buffer.length));
177-
// Pad with leading zeros if chunk is less than 32 bytes
178-
const padded = chunk.length < 32
179-
? Buffer.concat([Buffer.alloc(32 - chunk.length), chunk])
180-
: chunk;
181-
fields.push('0x' + padded.toString('hex'));
176+
const chunk = buffer.slice(i, i + 32);
177+
fields.push('0x' + chunk.toString('hex'));
182178
}
183179
return fields;
184180
};

0 commit comments

Comments
 (0)