Skip to content

Commit

Permalink
chore: run scalafmt
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Voiturier <[email protected]>
  • Loading branch information
bvoiturier committed Dec 4, 2024
1 parent c517f9d commit 09767ce
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ package org.hyperledger.identus.agent.server.jobs

import cats.syntax.all.*
import org.hyperledger.identus.agent.server.config.AppConfig
import org.hyperledger.identus.agent.server.jobs.BackgroundJobError.{ErrorResponseReceivedFromPeerAgent, InvalidState, NotImplemented}
import org.hyperledger.identus.agent.server.jobs.BackgroundJobError.{
ErrorResponseReceivedFromPeerAgent,
InvalidState,
NotImplemented
}
import org.hyperledger.identus.agent.walletapi.model.error.{DIDSecretStorageError, GetManagedDIDError}
import org.hyperledger.identus.agent.walletapi.service.ManagedDIDService
import org.hyperledger.identus.agent.walletapi.storage.DIDNonSecretStorage
Expand All @@ -21,7 +25,7 @@ import org.hyperledger.identus.pollux.core.model.presentation.Options
import org.hyperledger.identus.pollux.core.service.{CredentialService, PresentationService}
import org.hyperledger.identus.pollux.core.service.serdes.AnoncredCredentialProofsV1
import org.hyperledger.identus.pollux.sdjwt.{HolderPrivateKey, IssuerPublicKey, PresentationCompact, SDJWT}
import org.hyperledger.identus.pollux.vc.jwt.{JWT, JwtPresentation, DidResolver as JwtDidResolver, Issuer as JwtIssuer}
import org.hyperledger.identus.pollux.vc.jwt.{DidResolver as JwtDidResolver, Issuer as JwtIssuer, JWT, JwtPresentation}
import org.hyperledger.identus.pollux.vc.jwt.CredentialSchemaAndTrustedIssuersConstraint
import org.hyperledger.identus.resolvers.DIDResolver
import org.hyperledger.identus.shared.http.*
Expand Down Expand Up @@ -1100,7 +1104,8 @@ object PresentBackgroundJobs extends BackgroundJobsHelper {
val maybePresentationOptions: Either[PresentationError, Option[Options]] =
requestPresentation.attachments.headOption
.map(attachment =>
attachment.data.toJson.fromJson[JsonData]
attachment.data.toJson
.fromJson[JsonData]
.leftMap(err => PresentationDecodingError(s"JsonData decoding error: $err"))
.flatMap(data =>
org.hyperledger.identus.pollux.core.model.presentation.PresentationAttachment.given_JsonDecoder_PresentationAttachment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import org.hyperledger.identus.shared.messaging.{Message, Producer, WalletIdAndR
import org.hyperledger.identus.shared.models.{WalletAccessContext, WalletId}
import org.hyperledger.identus.shared.utils.DurationOps.toMetricsSeconds
import zio.*
import zio.json.DecoderOps
import zio.json.ast.Json
import zio.json.DecoderOps
import zio.metrics.Metric

import java.util.UUID
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ package org.hyperledger.identus.castor.controller.http

import org.hyperledger.identus.api.http.Annotation
import org.hyperledger.identus.castor.controller.http.Service.annotations
import org.hyperledger.identus.castor.core.model.{did as castorDomain, ProtoModelHelper}
import org.hyperledger.identus.castor.core.model.did.w3c
import org.hyperledger.identus.castor.core.model.{ProtoModelHelper, did as castorDomain}
import org.hyperledger.identus.shared.utils.Traverse.*
import sttp.tapir.Schema
import sttp.tapir.Schema.annotations.{description, encodedExample}
import zio.json.ast.Json
import zio.json.{DeriveJsonDecoder, DeriveJsonEncoder, EncoderOps, JsonDecoder, JsonEncoder}
import zio.json.ast.Json

import scala.language.implicitConversions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import org.hyperledger.identus.pollux.vc.jwt.*
import org.hyperledger.identus.pollux.vc.jwt.CredentialPayload.Implicits.*
import org.hyperledger.identus.shared.json.JsonInterop
import org.hyperledger.identus.verification.controller.http.*
import sttp.client3.{DeserializationException, Response, UriContext, basicRequest}
import sttp.client3.{basicRequest, DeserializationException, Response, UriContext}
import sttp.client3.ziojson.*
import sttp.model.StatusCode
import zio.*
import zio.json.ast.Json
import zio.json.EncoderOps
import zio.test.*
import zio.test.Assertion.*
import zio.Config.OffsetDateTime
import zio.json.ast.Json

import java.time.Instant

Expand Down Expand Up @@ -47,11 +47,13 @@ object VcVerificationControllerImplSpec extends ZIOSpecDefault with VcVerificati
`type` = "JsonSchemaValidator2018"
)
),
credentialSubject = JsonInterop.toCirceJsonAst(Json.Obj(
"userName" -> Json.Str("Bob"),
"age" -> Json.Num(42),
"email" -> Json.Str("email")
)),
credentialSubject = JsonInterop.toCirceJsonAst(
Json.Obj(
"userName" -> Json.Str("Bob"),
"age" -> Json.Num(42),
"email" -> Json.Str("email")
)
),
maybeCredentialStatus = Some(
CredentialStatus(
id = "did:work:MDP8AsFhHzhwUvGNuYkX7T;id=06e126d1-fa44-4882-a243-1e326fbe21db;version=1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@ package org.hyperledger.identus.mercury.protocol.anotherclasspath

import munit.*
import org.hyperledger.identus.mercury.model.{AttachmentDescriptor, DidId}
import org.hyperledger.identus.mercury.protocol.issuecredential.{CredentialPreview, IssueCredential, IssueCredentialIssuedFormat, IssueCredentialOfferFormat, IssueCredentialProposeFormat, IssueCredentialRequestFormat, OfferCredential, ProposeCredential, RequestCredential}
import org.hyperledger.identus.mercury.protocol.issuecredential.{
CredentialPreview,
IssueCredential,
IssueCredentialIssuedFormat,
IssueCredentialOfferFormat,
IssueCredentialProposeFormat,
IssueCredentialRequestFormat,
OfferCredential,
ProposeCredential,
RequestCredential
}
import zio.json.{DeriveJsonDecoder, DeriveJsonEncoder, EncoderOps, JsonDecoder, JsonEncoder}

private case class TestCredentialType(a: String, b: Int, x: Long, name: String, dob: String)
Expand Down Expand Up @@ -37,8 +47,7 @@ class UtilsCredentialSpec extends ZSuite {
.build(
fromDID = DidId("did:prism:test123from"),
toDID = DidId("did:prism:test123to"),
credentials =
Seq(IssueCredentialIssuedFormat.Unsupported(nameCredentialType) -> credential.toJson.getBytes()),
credentials = Seq(IssueCredentialIssuedFormat.Unsupported(nameCredentialType) -> credential.toJson.getBytes()),
)
.makeMessage

Expand All @@ -61,8 +70,7 @@ class UtilsCredentialSpec extends ZSuite {
fromDID = DidId("did:prism:test123from"),
toDID = DidId("did:prism:test123to"),
credential_preview = credentialPreview,
credentials =
Seq(IssueCredentialOfferFormat.Unsupported(nameCredentialType) -> credential.toJson.getBytes()),
credentials = Seq(IssueCredentialOfferFormat.Unsupported(nameCredentialType) -> credential.toJson.getBytes()),
)
.makeMessage

Expand All @@ -85,8 +93,7 @@ class UtilsCredentialSpec extends ZSuite {
fromDID = DidId("did:prism:test123from"),
toDID = DidId("did:prism:test123to"),
credential_preview = Some(credentialPreview),
credentials =
Seq(IssueCredentialProposeFormat.Unsupported(nameCredentialType) -> credential.toJson.getBytes()),
credentials = Seq(IssueCredentialProposeFormat.Unsupported(nameCredentialType) -> credential.toJson.getBytes()),
)
.makeMessage

Expand All @@ -107,8 +114,7 @@ class UtilsCredentialSpec extends ZSuite {
.build(
fromDID = DidId("did:prism:test123from"),
toDID = DidId("did:prism:test123to"),
credentials =
Seq(IssueCredentialRequestFormat.Unsupported(nameCredentialType) -> credential.toJson.getBytes()),
credentials = Seq(IssueCredentialRequestFormat.Unsupported(nameCredentialType) -> credential.toJson.getBytes()),
)
.makeMessage

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.hyperledger.identus.resolvers
import munit.*
import org.didcommx.peerdid.*
import zio.json.DecoderOps
import zio.json.ast.Json
import zio.json.DecoderOps

import scala.jdk.CollectionConverters.*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import org.hyperledger.identus.pollux.core.model.schema.CredentialSchemaRef
import org.hyperledger.identus.pollux.core.repository.CredentialRepository
import org.hyperledger.identus.pollux.vc.jwt.Issuer
import org.hyperledger.identus.shared.models.*
import zio.json.ast.Json
import zio.{Duration, UIO, URIO, URLayer, ZIO, ZLayer}
import zio.json.ast.Json

import java.util.UUID

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package org.hyperledger.identus.pollux.core.repository

import org.hyperledger.identus.pollux.prex.PresentationDefinition
import org.hyperledger.identus.shared.models.{WalletAccessContext, WalletId}
import zio.{durationInt, ZIO, ZLayer}
import zio.json.{DecoderOps, DeriveJsonDecoder, JsonDecoder}
import zio.{ZIO, ZLayer, durationInt}
import zio.test.*
import zio.test.Assertion.*

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import org.hyperledger.identus.pollux.core.model.error.CredentialServiceError.*
import org.hyperledger.identus.pollux.core.model.schema.CredentialSchemaRef
import org.hyperledger.identus.pollux.vc.jwt.Issuer
import org.hyperledger.identus.shared.models.*
import zio.{mock, Duration, IO, UIO, URIO, URLayer, ZIO, ZLayer}
import zio.json.ast.Json
import zio.{Duration, IO, UIO, URIO, URLayer, ZIO, ZLayer, mock}
import zio.mock.{Mock, Proxy}

import java.util.UUID
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,15 @@
package org.hyperledger.identus.pollux.vc.jwt

import io.circe.Json
import org.hyperledger.identus.castor.core.model.did.w3c.{DIDDocumentRepr, DIDResolutionErrorRepr, PublicKeyJwk, PublicKeyRepr, PublicKeyReprOrRef, ServiceRepr, makeW3CResolver}
import org.hyperledger.identus.castor.core.model.did.w3c.{
makeW3CResolver,
DIDDocumentRepr,
DIDResolutionErrorRepr,
PublicKeyJwk,
PublicKeyRepr,
PublicKeyReprOrRef,
ServiceRepr
}
import org.hyperledger.identus.castor.core.service.DIDService
import org.hyperledger.identus.shared.json.JsonInterop
import zio.*
Expand Down

0 comments on commit 09767ce

Please sign in to comment.