Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2428,16 +2428,23 @@ class HttpScanHandler(
): Future[ScanResource.GetValidatorFaucetsByValidatorResponse] = {
implicit val tc = extracted
withSpan(s"$workflowId.getValidatorFaucetsByValidator") { _ => _ =>
store
.getValidatorLicenseByValidator(validators.map(v => PartyId.tryFromProtoPrimitive(v)))
.map(licenses =>
ScanResource.GetValidatorFaucetsByValidatorResponse.OK(
definitions
.GetValidatorFaucetsByValidatorResponse(
FaucetProcessor.process(licenses)
)
)
if (validators.isEmpty) {
Future.successful(
ScanResource.GetValidatorFaucetsByValidatorResponse
.BadRequest(definitions.ErrorResponse("validator_ids must not be empty"))
)
} else {
store
.getValidatorLicenseByValidator(validators.map(v => PartyId.tryFromProtoPrimitive(v)))
.map(licenses =>
ScanResource.GetValidatorFaucetsByValidatorResponse.OK(
definitions
.GetValidatorFaucetsByValidatorResponse(
FaucetProcessor.process(licenses)
)
)
)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1949,6 +1949,22 @@ class DbScanStoreTest
result should not contain charlesValidatorLicense
}
}

"return an empty result when given no validators" in {
val alice = userParty(443)
val aliceValidatorLicense = validatorLicense(
alice,
dsoParty,
Some(new FaucetState(new Round(0), new Round(1000L), 0L))
)
for {
store <- mkStore()
_ <- dummyDomain.create(aliceValidatorLicense)(store.multiDomainAcsStore)
result <- store.getValidatorLicenseByValidator(Vector.empty)
} yield {
result shouldBe empty
}
}
}
"Changing the acsStoreDescriptorUserVersion" should {
val alice = userParty(443)
Expand Down
3 changes: 3 additions & 0 deletions docs/src/release_notes_upcoming.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@
wallets can make use of the new batching functionality (see below) on all validator
nodes.

- Scan
- The ``/v0/validators/validator-faucets`` endpoint now returns HTTP 400 when called with no ``validator_ids`` query parameters, instead of returning an empty result. This makes typos in the query parameter key (e.g. ``validator`` instead of ``validator_ids``) fail loudly rather than silently.

- Daml

- Release the Token Standard V2 APIs (`CIP-112 <https://github.com/canton-foundation/cips/blob/main/cip-0112/cip-0112.md>`__).
Expand Down