Interface Challenge

All Superinterfaces:
io.hotmoka.marshalling.api.Marshallable

public interface Challenge extends io.hotmoka.marshalling.api.Marshallable
The challenge to build a deadline. This can be provided for instance to a miner to describe the properties of the deadline one is looking for.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The number of scoops in a nonce.
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    Yields the generation signature used to compute the deadline.
    io.hotmoka.crypto.api.HashingAlgorithm
    The hashing algorithm used for generating the deadline.
    io.hotmoka.crypto.api.HashingAlgorithm
    The hashing algorithm used for the generation signatures.
    int
    Yields the number of the scoop considered to compute the deadline.
    void
    intoWithoutConfigurationData(io.hotmoka.marshalling.api.MarshallingContext context)
    Marshals this object into a given stream.
    void
    Checks if this challenge matches the given one.
    Yields a string representation of this challenge.

    Methods inherited from interface io.hotmoka.marshalling.api.Marshallable

    into, size, toByteArray
  • Field Details

    • SCOOPS_PER_NONCE

      static final int SCOOPS_PER_NONCE
      The number of scoops in a nonce.
      See Also:
  • Method Details

    • getScoopNumber

      int getScoopNumber()
      Yields the number of the scoop considered to compute the deadline.
      Returns:
      the number of the scoop
    • getGenerationSignature

      byte[] getGenerationSignature()
      Yields the generation signature used to compute the deadline.
      Returns:
      the generation signature
    • getHashingForDeadlines

      io.hotmoka.crypto.api.HashingAlgorithm getHashingForDeadlines()
      The hashing algorithm used for generating the deadline.
      Returns:
      the hashing algorithm
    • getHashingForGenerations

      io.hotmoka.crypto.api.HashingAlgorithm getHashingForGenerations()
      The hashing algorithm used for the generation signatures.
      Returns:
      the hashing algorithm
    • requireMatches

      void requireMatches(Challenge other) throws ChallengeMatchException
      Checks if this challenge matches the given one. If it doesn't, an exception is thrown.
      Parameters:
      other - the other challenge matched against this challenge
      Throws:
      ChallengeMatchException - if the match fails
    • intoWithoutConfigurationData

      void intoWithoutConfigurationData(io.hotmoka.marshalling.api.MarshallingContext context) throws IOException
      Marshals this object into a given stream. This method in general performs better than standard Java serialization, wrt the size of the marshalled data. It does not report information that can be recomputed from the configuration of the node storing this challenge.
      Parameters:
      context - the context holding the stream
      Throws:
      IOException - if this object cannot be marshalled
    • toString

      String toString()
      Yields a string representation of this challenge.
      Overrides:
      toString in class Object
      Returns:
      the string representation