updateLeavesBatch method
Updates multiple leaves in batch for efficiency
Implementation
MerkleTree<T> updateLeavesBatch(Map<int, T> updates) {
if (updates.isEmpty) return this;
final newLeaves = List<T>.from(_leaves);
for (final entry in updates.entries) {
final index = entry.key;
final data = entry.value;
if (index < 0 || index >= leafCount) {
throw ArgumentError('Invalid leaf index: $index');
}
newLeaves[index] = data;
}
return MerkleTree.fromList(
newLeaves,
hashFunction: hashFunction,
salt: _salt,
);
}