@@ -24,16 +24,16 @@ import scala.collection.mutable.ListBuffer
24
24
import scala .concurrent .duration ._
25
25
26
26
/** Estimates the Cardano fees to pay for a given deployment simulation.
27
- *
28
- * <p>You can run the estimator with `sbt node/test:run` and choosing `CardanoFeeEstimator` from the list. In order to
29
- * do so, make sure you have set the proper environment variables, as suggested <a
30
- * href="https://github.com/input-output-hk/atala/blob/develop/prism-backend/docs/cardano/use-cardano.md">here</a>.
31
- */
27
+ *
28
+ * <p>You can run the estimator with `sbt node/test:run` and choosing `CardanoFeeEstimator` from the list. In order to
29
+ * do so, make sure you have set the proper environment variables, as suggested <a
30
+ * href="https://github.com/input-output-hk/atala/blob/develop/prism-backend/docs/cardano/use-cardano.md">here</a>.
31
+ */
32
32
class CardanoFeeEstimator (
33
- walletId : WalletId ,
34
- paymentAddress : Address ,
35
- cardanoWalletApiClient : CardanoWalletApiClient [IO ]
36
- ) {
33
+ walletId : WalletId ,
34
+ paymentAddress : Address ,
35
+ cardanoWalletApiClient : CardanoWalletApiClient [IO ]
36
+ ) {
37
37
// Max number of credentials that can be issued in the same transaction
38
38
private val MAX_CREDENTIAL_BATCH_SIZE = 2048
39
39
@@ -121,16 +121,16 @@ class CardanoFeeEstimator(
121
121
}
122
122
123
123
private def createAtalaObject (
124
- operations : SignedAtalaOperation *
125
- ): AtalaObject = {
124
+ operations : SignedAtalaOperation *
125
+ ): AtalaObject = {
126
126
val block = node_internal.AtalaBlock (operations)
127
127
AtalaObject ().withBlockContent(block)
128
128
}
129
129
130
130
private def signOperation (
131
- atalaOperation : AtalaOperation ,
132
- privateKey : ECPrivateKey
133
- ): SignedAtalaOperation = {
131
+ atalaOperation : AtalaOperation ,
132
+ privateKey : ECPrivateKey
133
+ ): SignedAtalaOperation = {
134
134
node_models.SignedAtalaOperation (
135
135
signedWith = DID .getDEFAULT_MASTER_KEY_ID,
136
136
operation = Some (atalaOperation),
@@ -165,10 +165,10 @@ class CardanoFeeEstimator(
165
165
}
166
166
167
167
private def addIssuingKeyOperation (
168
- did : Canonical ,
169
- publicKey : ECPublicKey ,
170
- lastOperation : AtalaOperation
171
- ): AtalaOperation = {
168
+ did : Canonical ,
169
+ publicKey : ECPublicKey ,
170
+ lastOperation : AtalaOperation
171
+ ): AtalaOperation = {
172
172
val createDIDOp = node_models.UpdateDIDOperation (
173
173
previousOperationHash = ByteString .copyFrom(Sha256 .compute(lastOperation.toByteArray).getValue),
174
174
id = did.getSuffix,
@@ -195,9 +195,9 @@ class CardanoFeeEstimator(
195
195
}
196
196
197
197
private def issueCredentialBatchOperation (
198
- merkleRoot : MerkleRoot ,
199
- issuerDid : Canonical
200
- ): AtalaOperation = {
198
+ merkleRoot : MerkleRoot ,
199
+ issuerDid : Canonical
200
+ ): AtalaOperation = {
201
201
val issueCredentialOp = node_models.IssueCredentialBatchOperation (
202
202
credentialBatchData = Some (
203
203
node_models.CredentialBatchData (
@@ -239,9 +239,9 @@ object CardanoFeeEstimator {
239
239
}
240
240
241
241
case class TotalEstimation (
242
- didCreation : Estimation ,
243
- credentialIssuing : Estimation
244
- ) extends EstimationFormat {
242
+ didCreation : Estimation ,
243
+ credentialIssuing : Estimation
244
+ ) extends EstimationFormat {
245
245
override val transactions : Int =
246
246
didCreation.transactions + credentialIssuing.transactions
247
247
override val fees : Lovelace = Lovelace (
0 commit comments