Browse Source

server: Move the Height value to the values package

master
Alexis Hernandez 6 years ago
parent
commit
33fcda6ef3
  1. 3
      server/app/com/xsn/explorer/data/BlockDataHandler.scala
  2. 3
      server/app/com/xsn/explorer/data/anorm/BlockPostgresDataHandler.scala
  3. 3
      server/app/com/xsn/explorer/data/anorm/dao/BlockPostgresDAO.scala
  4. 3
      server/app/com/xsn/explorer/data/async/BlockFutureDataHandler.scala
  5. 2
      server/app/com/xsn/explorer/models/persisted/Block.scala
  6. 2
      server/app/com/xsn/explorer/models/rpc/Block.scala
  7. 2
      server/app/com/xsn/explorer/models/rpc/ServerStatistics.scala
  8. 2
      server/app/com/xsn/explorer/models/values/Height.scala
  9. 2
      server/app/com/xsn/explorer/services/BlockService.scala
  10. 3
      server/app/com/xsn/explorer/services/LedgerSynchronizerService.scala
  11. 2
      server/app/com/xsn/explorer/services/XSNService.scala
  12. 2
      server/app/controllers/BlocksController.scala
  13. 1
      server/test/com/xsn/explorer/data/TransactionPostgresDataHandlerSpec.scala
  14. 4
      server/test/com/xsn/explorer/helpers/DataGenerator.scala
  15. 2
      server/test/com/xsn/explorer/helpers/DummyXSNService.scala
  16. 4
      server/test/com/xsn/explorer/helpers/FileBasedXSNService.scala
  17. 3
      server/test/com/xsn/explorer/services/LedgerSynchronizerServiceSpec.scala
  18. 2
      server/test/controllers/BlocksControllerSpec.scala

3
server/app/com/xsn/explorer/data/BlockDataHandler.scala

@ -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

3
server/app/com/xsn/explorer/data/anorm/BlockPostgresDataHandler.scala

@ -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

3
server/app/com/xsn/explorer/data/anorm/dao/BlockPostgresDAO.scala

@ -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) {

3
server/app/com/xsn/explorer/data/async/BlockFutureDataHandler.scala

@ -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

2
server/app/com/xsn/explorer/models/persisted/Block.scala

@ -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(

2
server/app/com/xsn/explorer/models/rpc/Block.scala

@ -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._

2
server/app/com/xsn/explorer/models/rpc/ServerStatistics.scala

@ -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, __}

2
server/app/com/xsn/explorer/models/Height.scala → server/app/com/xsn/explorer/models/values/Height.scala

@ -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}

2
server/app/com/xsn/explorer/services/BlockService.scala

@ -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

3
server/app/com/xsn/explorer/services/LedgerSynchronizerService.scala

@ -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

2
server/app/com/xsn/explorer/services/XSNService.scala

@ -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

2
server/app/controllers/BlocksController.scala

@ -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

1
server/test/com/xsn/explorer/data/TransactionPostgresDataHandlerSpec.scala

@ -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

4
server/test/com/xsn/explorer/helpers/DataGenerator.scala

@ -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 {

2
server/test/com/xsn/explorer/helpers/DummyXSNService.scala

@ -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

4
server/test/com/xsn/explorer/helpers/FileBasedXSNService.scala

@ -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

3
server/test/com/xsn/explorer/services/LedgerSynchronizerServiceSpec.scala

@ -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

2
server/test/controllers/BlocksControllerSpec.scala

@ -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

Loading…
Cancel
Save