ledger-api-bench-tool: Allocate observers indexed from 0 until the total number (#11700)

CHANGELOG_BEGIN
CHANGELOG_END
This commit is contained in:
Kamil Bozek 2021-11-15 17:13:08 +01:00 committed by GitHub
parent 41d2d950f4
commit 612a838987
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -71,7 +71,7 @@ case class CommandSubmitter(services: LedgerApiServices) {
private def allocateParties(number: Int, name: Int => String)(implicit
ec: ExecutionContext
): Future[List[Primitive.Party]] =
(1 to number).foldLeft(Future.successful(List.empty[Primitive.Party])) { (allocated, i) =>
(0 until number).foldLeft(Future.successful(List.empty[Primitive.Party])) { (allocated, i) =>
allocated.flatMap { parties =>
services.partyManagementService.allocateParty(name(i)).map(party => parties :+ party)
}