Browse Source

server: Add the persisted models package

Includes the Block model which represents what is actually persisted.
master
Alexis Hernandez 6 years ago
parent
commit
7619ef3483
  1. 19
      server/app/com/xsn/explorer/models/persisted/Block.scala
  2. 12
      server/app/com/xsn/explorer/models/persisted/package.scala

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

@ -0,0 +1,19 @@
package com.xsn.explorer.models.persisted
import com.xsn.explorer.models._
case class Block(
hash: Blockhash,
previousBlockhash: Option[Blockhash],
nextBlockhash: Option[Blockhash],
tposContract: Option[TransactionId],
merkleRoot: Blockhash,
size: Size,
height: Height,
version: Int,
time: Long,
medianTime: Long,
nonce: Long,
bits: String,
chainwork: String,
difficulty: BigDecimal)

12
server/app/com/xsn/explorer/models/persisted/package.scala

@ -0,0 +1,12 @@
package com.xsn.explorer.models
/**
* The package represents the models that are persisted in the explorer's database.
*
* One reason why we require different models than what is used on the RPC calls
* is that there are fields which shouldn't be persisted, for example, the number
* of confirmations for a block.
*/
package object persisted {
}
Loading…
Cancel
Save