Skip to content

Commit

Permalink
server: Move the Blockhash 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 a1737b9 commit de64af5
Show file tree
Hide file tree
Showing 32 changed files with 41 additions and 24 deletions.
2 changes: 1 addition & 1 deletion server/app/com/xsn/explorer/config/ExplorerConfig.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.xsn.explorer.config

import com.xsn.explorer.models.Blockhash
import com.xsn.explorer.models.values.Blockhash
import javax.inject.Inject
import play.api.Configuration

Expand Down
3 changes: 2 additions & 1 deletion server/app/com/xsn/explorer/data/BlockDataHandler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ 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.{Blockhash, Height}
import com.xsn.explorer.models.Height
import com.xsn.explorer.models.values.Blockhash

import scala.language.higherKinds

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import com.alexitc.playsonify.models.pagination.{Limit, PaginatedQuery, Paginate
import com.xsn.explorer.models._
import com.xsn.explorer.models.fields.TransactionField
import com.xsn.explorer.models.persisted.Transaction
import com.xsn.explorer.models.values.Address
import com.xsn.explorer.models.values.{Address, Blockhash}

import scala.language.higherKinds

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ 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.{Blockhash, Height}
import com.xsn.explorer.models.Height
import com.xsn.explorer.models.values.Blockhash
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 @@ -8,7 +8,7 @@ import com.xsn.explorer.data.anorm.dao.{TransactionOutputPostgresDAO, Transactio
import com.xsn.explorer.models._
import com.xsn.explorer.models.fields.TransactionField
import com.xsn.explorer.models.persisted.Transaction
import com.xsn.explorer.models.values.Address
import com.xsn.explorer.models.values.{Address, Blockhash}
import javax.inject.Inject
import org.scalactic.Good
import play.api.db.Database
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ 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.{Blockhash, Height}
import com.xsn.explorer.models.Height
import com.xsn.explorer.models.values.Blockhash
import javax.inject.Inject

class BlockPostgresDAO @Inject() (fieldOrderingSQLInterpreter: FieldOrderingSQLInterpreter) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import com.xsn.explorer.data.anorm.parsers.TransactionParsers._
import com.xsn.explorer.models._
import com.xsn.explorer.models.fields.TransactionField
import com.xsn.explorer.models.persisted.Transaction
import com.xsn.explorer.models.values.Address
import com.xsn.explorer.models.values.{Address, Blockhash}
import javax.inject.Inject
import org.slf4j.LoggerFactory

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import anorm.SqlParser._
import anorm._
import com.xsn.explorer.models._
import com.xsn.explorer.models.persisted.Block
import com.xsn.explorer.models.values._

object BlockParsers {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package com.xsn.explorer.data.anorm.parsers

import anorm.SqlParser.{int, long, str}
import com.xsn.explorer.models.values._
import com.xsn.explorer.models.{Blockhash, Size}
import com.xsn.explorer.models.Size

object CommonParsers {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ 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.{Blockhash, Height}
import com.xsn.explorer.models.Height
import com.xsn.explorer.models.values.Blockhash
import javax.inject.Inject

import scala.concurrent.Future
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import com.xsn.explorer.executors.DatabaseExecutionContext
import com.xsn.explorer.models._
import com.xsn.explorer.models.fields.TransactionField
import com.xsn.explorer.models.persisted.Transaction
import com.xsn.explorer.models.values.Address
import com.xsn.explorer.models.values.{Address, Blockhash}
import javax.inject.Inject

import scala.concurrent.Future
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.xsn.explorer.models

import com.xsn.explorer.models.values.Blockhash
import play.api.libs.json.{Json, Writes}

case class LightWalletTransaction(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.xsn.explorer.models

import com.xsn.explorer.models.values.Blockhash
import play.api.libs.json.{Json, Writes}

case class TransactionDetails(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.xsn.explorer.models

import com.xsn.explorer.models.values.Blockhash
import play.api.libs.json.{Json, Writes}

case class TransactionWithValues(
Expand Down
1 change: 1 addition & 0 deletions server/app/com/xsn/explorer/models/persisted/Block.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.xsn.explorer.models.persisted

import com.xsn.explorer.models._
import com.xsn.explorer.models.values.Blockhash
import enumeratum._

case class Block(
Expand Down
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.values.Address
import com.xsn.explorer.models.{Blockhash, HexString, Size, TransactionId, rpc}
import com.xsn.explorer.models.values.{Address, Blockhash}
import com.xsn.explorer.models.{HexString, Size, TransactionId, rpc}

case class Transaction(
id: TransactionId,
Expand Down
1 change: 1 addition & 0 deletions server/app/com/xsn/explorer/models/rpc/Block.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.xsn.explorer.models.rpc

import com.xsn.explorer.models._
import com.xsn.explorer.models.values.Blockhash
import play.api.libs.functional.syntax._
import play.api.libs.json._

Expand Down
1 change: 1 addition & 0 deletions server/app/com/xsn/explorer/models/rpc/Transaction.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.xsn.explorer.models.rpc

import com.xsn.explorer.models._
import com.xsn.explorer.models.values.Blockhash
import play.api.libs.functional.syntax._
import play.api.libs.json._

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.WrappedString
import play.api.libs.json._
Expand Down
1 change: 1 addition & 0 deletions server/app/com/xsn/explorer/services/BlockService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +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.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,7 +6,8 @@ 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.{Blockhash, Height}
import com.xsn.explorer.models.Height
import com.xsn.explorer.models.values.Blockhash
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
import com.xsn.explorer.models.values.{Address, Blockhash}
import javax.inject.Inject
import org.scalactic.{Bad, Good}
import org.slf4j.LoggerFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import com.alexitc.playsonify.core.ApplicationResult
import com.xsn.explorer.errors.{BlockNotFoundError, BlockhashFormatError}
import com.xsn.explorer.models._
import com.xsn.explorer.models.rpc.{Block, Transaction}
import com.xsn.explorer.models.values.Address
import com.xsn.explorer.models.values.{Address, Blockhash}
import org.scalactic.{Bad, Good, One, Or}

class BlockLogic {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import com.xsn.explorer.data.anorm.dao.BlockPostgresDAO
import com.xsn.explorer.data.common.PostgresDataHandlerSpec
import com.xsn.explorer.errors.BlockNotFoundError
import com.xsn.explorer.helpers.BlockLoader
import com.xsn.explorer.models.Blockhash
import com.xsn.explorer.models.fields.BlockField
import com.xsn.explorer.models.persisted.Block
import com.xsn.explorer.models.values.Blockhash
import org.scalactic.{Bad, One, Or}
import org.scalatest.BeforeAndAfter

Expand Down
1 change: 1 addition & 0 deletions server/test/com/xsn/explorer/helpers/BlockLoader.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package com.xsn.explorer.helpers
import java.io.File

import com.xsn.explorer.models._
import com.xsn.explorer.models.values.Blockhash
import play.api.libs.json.{JsValue, Json}

object BlockLoader {
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
import com.xsn.explorer.models.{Blockhash, Confirmations, Height, HexString, Size, TransactionId}
import com.xsn.explorer.models.values.{Address, Blockhash}
import com.xsn.explorer.models.{Confirmations, Height, HexString, Size, TransactionId}

trait DataGenerator {

Expand Down
2 changes: 1 addition & 1 deletion server/test/com/xsn/explorer/helpers/DataHelper.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package com.xsn.explorer.helpers

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

object DataHelper {

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
import com.xsn.explorer.models.values.{Address, Blockhash}
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,7 +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.{Blockhash, Height, TransactionId}
import com.xsn.explorer.models.values.Blockhash
import com.xsn.explorer.models.{Height, 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 @@ -8,7 +8,7 @@ import com.xsn.explorer.data.TransactionBlockingDataHandler
import com.xsn.explorer.models._
import com.xsn.explorer.models.fields.TransactionField
import com.xsn.explorer.models.persisted.Transaction
import com.xsn.explorer.models.values.Address
import com.xsn.explorer.models.values.{Address, Blockhash}

class TransactionDummyDataHandler extends TransactionBlockingDataHandler {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ 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.{Blockhash, Height}
import com.xsn.explorer.models.Height
import com.xsn.explorer.models.values.Blockhash
import com.xsn.explorer.parsers.TransactionOrderingParser
import org.scalactic.{Bad, Good, One, Or}
import org.scalatest.BeforeAndAfter
Expand Down
1 change: 1 addition & 0 deletions server/test/controllers/BlocksControllerSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +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
import com.xsn.explorer.services.XSNService
import controllers.common.MyAPISpec
import org.scalactic.Good
Expand Down

0 comments on commit de64af5

Please sign in to comment.