Struct Enrollment
Define enrollment data (enrollment data = validator)
struct Enrollment
;
Fields
Name | Type | Description |
---|---|---|
commitment
|
geod24 | |
enroll_sig
|
agora | |
MinValidatorCount
|
immutable(uint) | The minimum number of validators required to create a block |
utxo_key
|
geod24 |
Methods
Name | Description |
---|---|
computeHash
(dg)
|
Implements hashing support |
Example
test for the computeHash function
import agora .crypto .Key;
import std .conv;
Hash inithash = Enrollment .init .hashFull();
assert(Enrollment(hashFull(1)) .hashFull() != inithash);
assert(Enrollment(Hash .init, hashFull(2)) .hashFull() != inithash);
assert(Enrollment(Hash .init, Hash .init,
KeyPair .random() .sign(Enrollment .init)) .hashFull() == inithash);