The claimPrimarySlot method constructs a partial Transcript following the Polkadot specification, including the label 'BABE', slot number, current epoch, and chain randomness. The rest of the data is added through the vrfSign and makeBytes functions from the Schnorrkel library. The makeBytes function returns a byte array that is transformed from little-endian to a BigInteger. This value is then compared against an input threshold, if it is smaller, a PreDigest is intended to be returned, though it is not yet implemented.
polkaj-schnorrkel jar is changed with a new one, that implements makeBytes method
Two util methods are added to the LittleEndianUtils class and bytesToFixedLength is adjusted not to throw IndexOutOfBoundsException. Unit tests are added for all of these methods.
Description
vrfSign
andmakeBytes
functions from theSchnorrkel
library. ThemakeBytes
function returns a byte array that is transformed from little-endian to aBigInteger
. This value is then compared against an input threshold, if it is smaller, a PreDigest is intended to be returned, though it is not yet implemented.makeBytes
methodbytesToFixedLength
is adjusted not to throwIndexOutOfBoundsException
. Unit tests are added for all of these methods.Fixes #547