Add better Block.toString that doesn't blow up logs (#2585)

* Add better Block.toString that doesn't blow up logs

* Use .toLong as ben suggested
This commit is contained in:
Chris Stewart 2021-01-29 10:23:18 -06:00 committed by GitHub
parent 0424bd8309
commit 04cc10effe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -51,11 +51,16 @@ sealed abstract class Block extends NetworkElement {
*/ */
object Block extends Factory[Block] { object Block extends Factory[Block] {
sealed private case class BlockImpl( private case class BlockImpl(
blockHeader: BlockHeader, blockHeader: BlockHeader,
txCount: CompactSizeUInt, txCount: CompactSizeUInt,
transactions: Seq[Transaction]) transactions: Seq[Transaction])
extends Block extends Block {
override def toString: String = {
s"Block(blockHeader=${blockHeader}, txCount=${txCount.toLong})"
}
}
def apply( def apply(
blockHeader: BlockHeader, blockHeader: BlockHeader,