- 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
FieldsModifier and TypeFieldDescriptionstatic final intThe number of scoops in a nonce. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Yields the generation signature used to compute the deadline.io.hotmoka.crypto.api.HashingAlgorithmThe hashing algorithm used for generating the deadline.io.hotmoka.crypto.api.HashingAlgorithmThe hashing algorithm used for the generation signatures.intYields the number of the scoop considered to compute the deadline.voidintoWithoutConfigurationData(io.hotmoka.marshalling.api.MarshallingContext context) Marshals this object into a given stream.voidrequireMatches(Challenge other) Checks if this challenge matches the given one.toString()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_NONCEThe 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
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.
-