File tree Expand file tree Collapse file tree
com/xsn/explorer/models/persisted Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -99,6 +99,18 @@ object BlockHeader {
9999 " nonce" -> obj.nonce,
100100 " bits" -> obj.bits,
101101 " filter" -> filterMaybe,
102+ " difficulty" -> obj.difficulty
103+ )
104+ }
105+
106+ val blockWrites : Writes [BlockHeader ] = (obj : BlockHeader ) => {
107+ Json .obj(
108+ " hash" -> obj.hash,
109+ " previousBlockhash" -> obj.previousBlockhash,
110+ " nextBlockhash" -> obj.nextBlockhash,
111+ " merkleRoot" -> obj.merkleRoot,
112+ " height" -> obj.height,
113+ " time" -> obj.time,
102114 " difficulty" -> obj.difficulty,
103115 " transactions" -> obj.transactions
104116 )
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ class BlocksController @Inject()(
3333 }
3434
3535 def getBlocks (lastSeenHash : Option [String ], limit : Int , orderingCondition : String ) = public { _ =>
36- implicit val codec : Writes [BlockHeader ] = BlockHeader .partialWrites
36+ implicit val codec : Writes [BlockHeader ] = BlockHeader .blockWrites
3737 blockService
3838 .getBlocks(Limit (limit), lastSeenHash, orderingCondition)
3939 .toFutureOr
You can’t perform that action at this time.
0 commit comments