Skip to content

Commit d841b22

Browse files
committed
test: use shared amount buffer
1 parent fa1c17f commit d841b22

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/Withdrawal.t.sol.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ contract WithdrawalsTest is Test {
191191
// It assumes that addresses are stored as uint256(index) and pubkeys are
192192
// uint8(index), repeating.
193193
function checkWithdrawals(uint256 startIndex, uint256 count) internal returns (uint256) {
194+
bytes memory amountBuffer = new bytes(8);
194195
bytes memory requests = getRequests();
195196
assertEq(requests.length, count*76);
196197

@@ -205,12 +206,11 @@ contract WithdrawalsTest is Test {
205206
assertEq(toFixed(requests, offset+52, offset+68), toFixed(wd, 32, 48), "unexpected request pk2 returned");
206207

207208
// Check amount.
208-
bytes memory outputAmount = new bytes(8);
209209
for (uint j = 0; j < 8; j++) {
210-
outputAmount[j] = requests[offset+68+j];
210+
amountBuffer[j] = requests[offset+68+j];
211211
}
212212
bytes memory wantAmount = hex"de852726f6fb9f2d";
213-
assertEq(outputAmount, wantAmount, "unexpected request amount returned");
213+
assertEq(amountBuffer, wantAmount, "unexpected request amount returned");
214214
}
215215

216216
return count;

0 commit comments

Comments
 (0)