Skip to content

Commit

Permalink
ATL-6668: Delete legacy operation related to credentials
Browse files Browse the repository at this point in the history
This commit deletes the IssueCredentialBatchOperation and
RevokeCredentialsOperation. It does not delete node API, daos nor
repositories related to credentials
  • Loading branch information
EzequielPostan committed Apr 3, 2024
1 parent 4961d10 commit 58290fb
Show file tree
Hide file tree
Showing 23 changed files with 14 additions and 3,243 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,7 @@ import io.iohk.atala.prism.protos.node_api
import io.iohk.atala.prism.protos.node_api.GetScheduledOperationsRequest.OperationType.{
AnyOperationType,
CreateDidOperationOperationType,
IssueCredentialBatchOperationType,
ProtocolVersionUpdateOperationType,
RevokeCredentialsOperationType,
UpdateDidOperationOperationType
}
import io.iohk.atala.prism.protos.node_api._
Expand Down Expand Up @@ -102,10 +100,6 @@ class NodeExplorerGrpcServiceImpl(
o.operation.isDefined && o.operation.get.operation.isCreateDid
case UpdateDidOperationOperationType =>
o.operation.isDefined && o.operation.get.operation.isUpdateDid
case IssueCredentialBatchOperationType =>
o.operation.isDefined && o.operation.get.operation.isIssueCredentialBatch
case RevokeCredentialsOperationType =>
o.operation.isDefined && o.operation.get.operation.isRevokeCredentials
case ProtocolVersionUpdateOperationType =>
o.operation.isDefined && o.operation.get.operation.isProtocolVersionUpdate
case _ => false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ object StatisticsCounters {

case object NumberOfPendingOperations extends MetricCounter
case object NumberOfPublishedDids extends MetricCounter
case object NumberOfIssuedCredentialBatches extends MetricCounter
case object NumberOfCredentialsRevoked extends MetricCounter
case object NumberOfAppliedTransactions extends MetricCounter
case object NumberOfRejectedTransactions extends MetricCounter
}
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,6 @@ package object operations {
CreateDIDOperation.parse(signedOperation, ledgerData)
case _: node_models.AtalaOperation.Operation.UpdateDid =>
UpdateDIDOperation.parse(signedOperation, ledgerData)
case _: node_models.AtalaOperation.Operation.IssueCredentialBatch =>
IssueCredentialBatchOperation.parse(signedOperation, ledgerData)
case _: node_models.AtalaOperation.Operation.RevokeCredentials =>
RevokeCredentialsOperation.parse(signedOperation, ledgerData)
case _: node_models.AtalaOperation.Operation.ProtocolVersionUpdate =>
ProtocolVersionUpdateOperation.parse(signedOperation, ledgerData)
case _: node_models.AtalaOperation.Operation.DeactivateDid =>
Expand All @@ -336,6 +332,14 @@ package object operations {
"Empty operation"
)
)
case op => // we need to discard unrecognized operations
Left(
InvalidValue(
Path.root,
op.getClass.getSimpleName,
s"Unsupported ${op.getClass.getSimpleName}"
)
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ package object protocolVersion {
(protocolV, operation) match {
case (
ProtocolVersion1_0,
_: CreateDIDOperation | _: UpdateDIDOperation | _: IssueCredentialBatchOperation |
_: RevokeCredentialsOperation | _: ProtocolVersionUpdateOperation | _: DeactivateDIDOperation
_: CreateDIDOperation | _: UpdateDIDOperation |
_: ProtocolVersionUpdateOperation | _: DeactivateDIDOperation
) =>
true
case _ => false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,12 @@ import io.iohk.atala.prism.node.errors
import io.iohk.atala.prism.node.metrics.StatisticsCounters
import io.iohk.atala.prism.node.metrics.StatisticsCounters.MetricCounter.{
NumberOfAppliedTransactions,
NumberOfCredentialsRevoked,
NumberOfIssuedCredentialBatches,
NumberOfPendingOperations,
NumberOfPublishedDids,
NumberOfRejectedTransactions
}
import io.iohk.atala.prism.node.models.AtalaOperationStatus
import io.iohk.atala.prism.node.operations.{
CreateDIDOperation,
IssueCredentialBatchOperation,
RevokeCredentialsOperation
}
import io.iohk.atala.prism.node.operations.CreateDIDOperation
import io.iohk.atala.prism.node.repositories.{AtalaOperationsRepository, MetricsCountersRepository}
import io.iohk.atala.prism.node.services.logs.StatisticsServiceLogs
import tofu.higherKind.Mid
Expand Down Expand Up @@ -53,10 +47,6 @@ private final class StatisticsServiceImpl[F[_]: Applicative](
getAtalaOperationsCountByStatus(AtalaOperationStatus.RECEIVED)
case NumberOfPublishedDids =>
metricsCountersRepository.getCounter(CreateDIDOperation.metricCounterName).map(Right(_))
case NumberOfIssuedCredentialBatches =>
metricsCountersRepository.getCounter(IssueCredentialBatchOperation.metricCounterName).map(Right(_))
case NumberOfCredentialsRevoked =>
metricsCountersRepository.getCounter(RevokeCredentialsOperation.metricCounterName).map(Right(_))
case NumberOfAppliedTransactions =>
getAtalaOperationsCountByStatus(AtalaOperationStatus.APPLIED)
case NumberOfRejectedTransactions =>
Expand Down
Loading

0 comments on commit 58290fb

Please sign in to comment.