Skip to content

Commit

Permalink
server: Move the Height value to the values package
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexITC committed Feb 17, 2019
1 parent 9c10ae1 commit 33fcda6
Show file tree
Hide file tree
Showing 18 changed files with 20 additions and 25 deletions.
3 changes: 1 addition & 2 deletions server/app/com/xsn/explorer/data/BlockDataHandler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import com.alexitc.playsonify.models.ordering.FieldOrdering
import com.alexitc.playsonify.models.pagination.{PaginatedQuery, PaginatedResult}
import com.xsn.explorer.models.fields.BlockField
import com.xsn.explorer.models.persisted.Block
import com.xsn.explorer.models.Height
import com.xsn.explorer.models.values.Blockhash
import com.xsn.explorer.models.values.{Blockhash, Height}

import scala.language.higherKinds

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import com.xsn.explorer.data.anorm.dao.BlockPostgresDAO
import com.xsn.explorer.errors._
import com.xsn.explorer.models.fields.BlockField
import com.xsn.explorer.models.persisted.Block
import com.xsn.explorer.models.Height
import com.xsn.explorer.models.values.Blockhash
import com.xsn.explorer.models.values.{Blockhash, Height}
import javax.inject.Inject
import org.scalactic.{Good, One, Or}
import play.api.db.Database
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import com.alexitc.playsonify.sql.FieldOrderingSQLInterpreter
import com.xsn.explorer.data.anorm.parsers.BlockParsers._
import com.xsn.explorer.models.fields.BlockField
import com.xsn.explorer.models.persisted.Block
import com.xsn.explorer.models.Height
import com.xsn.explorer.models.values.Blockhash
import com.xsn.explorer.models.values.{Blockhash, Height}
import javax.inject.Inject

class BlockPostgresDAO @Inject() (fieldOrderingSQLInterpreter: FieldOrderingSQLInterpreter) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ import com.xsn.explorer.data.{BlockBlockingDataHandler, BlockDataHandler}
import com.xsn.explorer.executors.DatabaseExecutionContext
import com.xsn.explorer.models.fields.BlockField
import com.xsn.explorer.models.persisted.Block
import com.xsn.explorer.models.Height
import com.xsn.explorer.models.values.Blockhash
import com.xsn.explorer.models.values.{Blockhash, Height}
import javax.inject.Inject

import scala.concurrent.Future
Expand Down
2 changes: 1 addition & 1 deletion server/app/com/xsn/explorer/models/persisted/Block.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.xsn.explorer.models.persisted

import com.xsn.explorer.models._
import com.xsn.explorer.models.values.Blockhash
import com.xsn.explorer.models.values.{Blockhash, Height}
import enumeratum._

case class Block(
Expand Down
2 changes: 1 addition & 1 deletion server/app/com/xsn/explorer/models/rpc/Block.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.xsn.explorer.models.rpc

import com.xsn.explorer.models._
import com.xsn.explorer.models.values.{Blockhash, Confirmations}
import com.xsn.explorer.models.values.{Blockhash, Confirmations, Height}
import play.api.libs.functional.syntax._
import play.api.libs.json._

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.xsn.explorer.models.rpc

import com.xsn.explorer.models.Height
import com.xsn.explorer.models.values.Height
import play.api.libs.functional.syntax._
import play.api.libs.json.{Json, Reads, Writes, __}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.xsn.explorer.models
package com.xsn.explorer.models.values

import com.alexitc.playsonify.models.WrappedInt
import play.api.libs.json.{JsPath, Reads}
Expand Down
2 changes: 1 addition & 1 deletion server/app/com/xsn/explorer/services/BlockService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import com.alexitc.playsonify.core.FutureOr.Implicits.{FutureOps, OrOps}
import com.xsn.explorer.errors.BlockRewardsNotFoundError
import com.xsn.explorer.models._
import com.xsn.explorer.models.rpc.{Block, TransactionVIN}
import com.xsn.explorer.models.values.Blockhash
import com.xsn.explorer.models.values.{Blockhash, Height}
import com.xsn.explorer.services.logic.{BlockLogic, TransactionLogic}
import com.xsn.explorer.util.Extensions.FutureOrExt
import javax.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import com.xsn.explorer.data.async.{BlockFutureDataHandler, LedgerFutureDataHand
import com.xsn.explorer.errors.BlockNotFoundError
import com.xsn.explorer.models.persisted.{Block, Transaction}
import com.xsn.explorer.models.transformers._
import com.xsn.explorer.models.Height
import com.xsn.explorer.models.values.Blockhash
import com.xsn.explorer.models.values.{Blockhash, Height}
import com.xsn.explorer.util.Extensions.FutureOrExt
import javax.inject.Inject
import org.scalactic.Good
Expand Down
2 changes: 1 addition & 1 deletion server/app/com/xsn/explorer/services/XSNService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import com.xsn.explorer.config.{ExplorerConfig, RPCConfig}
import com.xsn.explorer.errors._
import com.xsn.explorer.executors.ExternalServiceExecutionContext
import com.xsn.explorer.models._
import com.xsn.explorer.models.values.{Address, Blockhash}
import com.xsn.explorer.models.values.{Address, Blockhash, Height}
import javax.inject.Inject
import org.scalactic.{Bad, Good}
import org.slf4j.LoggerFactory
Expand Down
2 changes: 1 addition & 1 deletion server/app/controllers/BlocksController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package controllers

import com.alexitc.playsonify.models.ordering.OrderingQuery
import com.alexitc.playsonify.models.pagination.{Limit, Offset, PaginatedQuery}
import com.xsn.explorer.models.Height
import com.xsn.explorer.models.values.Height
import com.xsn.explorer.services.{BlockService, TransactionService}
import controllers.common.{Codecs, MyJsonController, MyJsonControllerComponents}
import javax.inject.Inject
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.xsn.explorer.models._
import com.xsn.explorer.models.fields.TransactionField
import com.xsn.explorer.models.persisted.Transaction
import com.xsn.explorer.models.rpc.Block
import com.xsn.explorer.models.values.Height
import org.scalactic.{Good, One, Or}
import org.scalatest.BeforeAndAfter

Expand Down
4 changes: 2 additions & 2 deletions server/test/com/xsn/explorer/helpers/DataGenerator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package com.xsn.explorer.helpers

import com.xsn.explorer.models.persisted.Transaction
import com.xsn.explorer.models.rpc.Block
import com.xsn.explorer.models.values.{Address, Blockhash, Confirmations}
import com.xsn.explorer.models.{Height, HexString, Size, TransactionId}
import com.xsn.explorer.models.values.{Address, Blockhash, Confirmations, Height}
import com.xsn.explorer.models.{HexString, Size, TransactionId}

trait DataGenerator {

Expand Down
2 changes: 1 addition & 1 deletion server/test/com/xsn/explorer/helpers/DummyXSNService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.xsn.explorer.helpers
import com.alexitc.playsonify.core.FutureApplicationResult
import com.xsn.explorer.models._
import com.xsn.explorer.models.rpc.Masternode
import com.xsn.explorer.models.values.{Address, Blockhash}
import com.xsn.explorer.models.values.{Address, Blockhash, Height}
import com.xsn.explorer.services.XSNService
import play.api.libs.json.JsValue

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package com.xsn.explorer.helpers
import com.alexitc.playsonify.core.FutureApplicationResult
import com.xsn.explorer.errors.{BlockNotFoundError, TransactionNotFoundError}
import com.xsn.explorer.models.rpc.{Block, Transaction}
import com.xsn.explorer.models.values.Blockhash
import com.xsn.explorer.models.{Height, TransactionId}
import com.xsn.explorer.models.values.{Blockhash, Height}
import com.xsn.explorer.models.TransactionId
import org.scalactic.{Good, One, Or}
import play.api.libs.json.JsValue

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import com.xsn.explorer.helpers.DataHandlerObjects._
import com.xsn.explorer.helpers.LedgerHelper._
import com.xsn.explorer.helpers._
import com.xsn.explorer.models.rpc.Block
import com.xsn.explorer.models.Height
import com.xsn.explorer.models.values.Blockhash
import com.xsn.explorer.models.values.{Blockhash, Height}
import com.xsn.explorer.parsers.TransactionOrderingParser
import org.scalactic.{Bad, Good, One, Or}
import org.scalatest.BeforeAndAfter
Expand Down
2 changes: 1 addition & 1 deletion server/test/controllers/BlocksControllerSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import com.xsn.explorer.helpers._
import com.xsn.explorer.models._
import com.xsn.explorer.models.fields.TransactionField
import com.xsn.explorer.models.rpc.Block
import com.xsn.explorer.models.values.{Blockhash, Confirmations}
import com.xsn.explorer.models.values.{Blockhash, Confirmations, Height}
import com.xsn.explorer.services.XSNService
import controllers.common.MyAPISpec
import org.scalactic.Good
Expand Down

0 comments on commit 33fcda6

Please sign in to comment.