Struct ConsensusData

Consensus data which is nominated & voted on

struct ConsensusData ;

Fields

NameTypeDescription
enrolls Enrollment[]The enrollments that are being nominated / voted on
missing_validators uint[]List of indices to the validator UTXO set which have not revealed the preimage, aka missing preimage validators, or MPVs
tx_set geod24.bitblob.BitBlob!(64L)The transaction set that is being nominated / voted on

Example

ConsensusData type testSymmetry check

import agora.serialization.Serializer;
import agora.common.Types;
import agora.crypto.Schnorr: Signature;
import agora.consensus.data.genesis.Test;
import std.algorithm;
import std.array;

testSymmetry!ConsensusData();

Hash key = Hash("0x000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f" ~
                "1b60a8ce26f000000000019d6689c085ae165831e934ff763ae46a2" ~
                "a6c172b3f1b60a8ce26f");
Hash seed = Hash("0X4A5E1E4BAAB89F3A32518A88C31BC87F618F76673E2CC77AB212" ~
                 "7B7AFDEDA33B4A5E1E4BAAB89F3A32518A88C31BC87F618F76673E" ~
                 "2CC77AB2127B7AFDEDA33B");
Signature sig = Signature.fromString("0x000000000000000000016f605ea9638d7bff58d2c0c" ~
                          "c2467c18e38b36367be78000000000000000000016f60" ~
                          "5ea9638d7bff58d2c0cc2467c18e38b36367be78");
const Enrollment record = {
    utxo_key: key,
    commitment: seed,
    enroll_sig: sig,
};

const(ConsensusData) data =
{
    tx_set:  GenesisBlock.txs.map!(tx => tx.hashFull()).array.hashFull,
    enrolls: [ record, record, ],
    missing_validators : [ 1, 3, 5 ]
};

testSymmetry(data);