All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scorex.block.BlockProcessingModule.scala Maven / Gradle / Ivy

There is a newer version: 1.5.1
Show newest version
package scorex.block

import scorex.serialization.Deser

import scala.util.Try

/**
  * A generic interface with functionality to convert data into a part of a block and vice versa
  */

trait BlockProcessingModule[BlockPartDataType] extends Deser[BlockField[BlockPartDataType]] {
  def parseBytes(bytes: Array[Byte]): Try[BlockField[BlockPartDataType]]

  def parseBlockFields(blockFields: BlockField[BlockPartDataType]): BlockPartDataType = blockFields.value

  def genesisData: BlockField[BlockPartDataType]

  def formBlockData(data: BlockPartDataType): BlockField[BlockPartDataType]
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy