Skip to content

Commit

Permalink
reformatted after merge, commiting scalafmt.conf also
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejbak85 committed Nov 18, 2020
1 parent 41da0d6 commit bb23480
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 18 deletions.
25 changes: 25 additions & 0 deletions .scalafmt.conf
@@ -0,0 +1,25 @@
version = 2.7.5
style = intellij
maxColumn = 110
lineEndings = preserve
align = most
align.openParenCallSite = false
align.openParenDefnSite = true
align.tokens = [
{code = "<-"},
{code = "=>", owner = "Case"},
{code = "%", owner = "Term.ApplyInfix"},
{code = "%%", owner = "Term.ApplyInfix"}
]
continuationIndent.defnSite = 2
continuationIndent.extendSite = 4
rewrite.rules = [RedundantBraces, RedundantParens, SortImports, SortModifiers, PreferCurlyFors]
rewrite.sortModifiers.order = ["override", "private", "protected", "implicit", "final", "sealed", "abstract", "lazy"]
newlines.sometimesBeforeColonInMethodReturnType = false
spaces.inImportCurlyBraces = true
danglingParentheses = true
includeCurlyBraceInSelectChains = false
assumeStandardLibraryStripMargin = true
docstrings.style = "Asterisk"

optIn.configStyleArguments = true
5 changes: 4 additions & 1 deletion src/main/scala/iog/psg/cardano/CardanoApi.scala
Expand Up @@ -317,7 +317,10 @@ trait CardanoApi {
* @param addresses recipient addresses
* @return migrate shelley wallet request
*/
def migrateShelleyWallet(walletId: String, passphrase: String, addresses: Seq[String]): Future[CardanoApiRequest[Seq[SubmitMigrationResponse]]]
def migrateShelleyWallet(walletId: String,
passphrase: String,
addresses: Seq[String]
): Future[CardanoApiRequest[Seq[SubmitMigrationResponse]]]

/**
* Calculate the exact cost of sending all funds from particular Shelley wallet to a set of addresses
Expand Down
33 changes: 16 additions & 17 deletions src/main/scala/iog/psg/cardano/CardanoApiImpl.scala
@@ -1,15 +1,12 @@
package iog.psg.cardano

import java.io.File
import java.time.ZonedDateTime
import java.util.Scanner

import akka.actor.ActorSystem
import akka.http.scaladsl.marshalling.Marshal
import akka.http.scaladsl.model.HttpMethods._
import akka.http.scaladsl.model.Uri.Query
import akka.http.scaladsl.model._
import akka.util.ByteString
import de.heikoseeberger.akkahttpcirce.FailFastCirceSupport._
import io.circe.generic.auto._
import io.circe.generic.extras.Configuration
Expand Down Expand Up @@ -100,25 +97,23 @@ private class CardanoApiImpl(baseUriWithPort: String)(implicit ec: ExecutionCont
/**
* @inheritdoc
*/
override def networkParameters(): CardanoApiRequest[NetworkParameters] = {
override def networkParameters(): CardanoApiRequest[NetworkParameters] =
CardanoApiRequest(
HttpRequest(
uri = s"${network}/parameters",
method = GET
),
_.toNetworkParametersResponse
)
}

/**
* @inheritdoc
*/
override def createRestoreWallet(
name: String,
passphrase: String,
mnemonicSentence: MnemonicSentence,
mnemonicSecondFactor: Option[MnemonicSentence] = None,
addressPoolGap: Option[Int] = None
override def createRestoreWallet(name: String,
passphrase: String,
mnemonicSentence: MnemonicSentence,
mnemonicSecondFactor: Option[MnemonicSentence] = None,
addressPoolGap: Option[Int] = None
): Future[CardanoApiRequest[Wallet]] = {

val createRestore =
Expand Down Expand Up @@ -311,8 +306,9 @@ private class CardanoApiImpl(baseUriWithPort: String)(implicit ec: ExecutionCont
* @inheritdoc
*/
override def updatePassphrase(walletId: String,
oldPassphrase: String,
newPassphrase: String): Future[CardanoApiRequest[Unit]] = {
oldPassphrase: String,
newPassphrase: String
): Future[CardanoApiRequest[Unit]] = {

val uri = Uri(s"$wallets/${walletId}/passphrase")
val updater = UpdatePassphrase(oldPassphrase, newPassphrase)
Expand Down Expand Up @@ -355,7 +351,7 @@ private class CardanoApiImpl(baseUriWithPort: String)(implicit ec: ExecutionCont
CardanoApiRequest(
HttpRequest(
uri = uri,
method = GET,
method = GET
),
_.toUTxOStatisticsResponse
)
Expand All @@ -379,9 +375,12 @@ private class CardanoApiImpl(baseUriWithPort: String)(implicit ec: ExecutionCont
/**
* @inheritdoc
*/
override def migrateShelleyWallet(walletId: String, passphrase: String, addresses: Seq[String]): Future[CardanoApiRequest[Seq[SubmitMigrationResponse]]] = {
override def migrateShelleyWallet(walletId: String,
passphrase: String,
addresses: Seq[String]
): Future[CardanoApiRequest[Seq[SubmitMigrationResponse]]] = {
val updater = SubmitMigration(passphrase = passphrase, addresses = addresses)
Marshal(updater).to[RequestEntity] map { marshalled => {
Marshal(updater).to[RequestEntity] map { marshalled =>
CardanoApiRequest(
HttpRequest(
uri = generateMigrationsUrl(walletId),
Expand All @@ -390,7 +389,7 @@ private class CardanoApiImpl(baseUriWithPort: String)(implicit ec: ExecutionCont
),
_.toSubmitMigrationResponse
)
}}
}
}

/**
Expand Down

0 comments on commit bb23480

Please sign in to comment.