Beispiel #1
0
        public static void IzeBitlist(out UInt256 root, BitArray value, ulong maximumBitlistLength)
        {
            Merkleizer merkleizer = new Merkleizer(0);

            merkleizer.FeedBitlist(value, maximumBitlistLength);
            merkleizer.CalculateRoot(out root);
        }
Beispiel #2
0
        public static void Ize(out UInt256 root, Attestation?container)
        {
            if (container is null)
            {
                root = RootOfNull;
                return;
            }

            Merkleizer merkleizer = new Merkleizer(2);

            merkleizer.FeedBitlist(container.AggregationBits, Ssz.MaxValidatorsPerCommittee);
            merkleizer.Feed(container.Data);
            merkleizer.Feed(container.Signature);
            merkleizer.CalculateRoot(out root);
        }
Beispiel #3
0
        public static void Ize(out UInt256 root, PendingAttestation?container)
        {
            if (container is null)
            {
                root = RootOfNull;
                return;
            }

            Merkleizer merkleizer = new Merkleizer(2);

            merkleizer.FeedBitlist(container.AggregationBits, Ssz.MaxValidatorsPerCommittee);
            merkleizer.Feed(container.Data);
            merkleizer.Feed(container.InclusionDelay);
            merkleizer.Feed(container.ProposerIndex);
            merkleizer.CalculateRoot(out root);
        }