Exemplo n.º 1
0
 public AttesterSlashing(
     IndexedAttestation attestation1,
     IndexedAttestation attestation2)
 {
     Attestation1 = attestation1;
     Attestation2 = attestation2;
 }
Exemplo n.º 2
0
        public bool Equals(IndexedAttestation other)
        {
            if (!Equals(Data, other.Data) ||
                !Equals(Signature, other.Signature) ||
                (AttestingIndices?.Length ?? 0) != (other.AttestingIndices?.Length ?? 0))
            {
                return(false);
            }

            if (!(AttestingIndices is null))
            {
                if (other.AttestingIndices is null)
                {
                    return(false);
                }

                for (int i = 0; i < AttestingIndices?.Length; i++)
                {
                    if (AttestingIndices[i] != other.AttestingIndices[i])
                    {
                        return(false);
                    }
                }
            }

            return(true);
        }
Exemplo n.º 3
0
        public static int SszLength(AttesterSlashing?container)
        {
            if (container is null)
            {
                return(0);
            }

            return(2 * sizeof(uint) +
                   IndexedAttestation.SszLength(container.Attestation1) +
                   IndexedAttestation.SszLength(container.Attestation2));
        }
Exemplo n.º 4
0
        public bool Equals(IndexedAttestation other)
        {
            if (!Equals(Data, other.Data) ||
                !Equals(Signature, other.Signature) ||
                AttestingIndices.Count != other.AttestingIndices.Count)
            {
                return(false);
            }

            for (int i = 0; i < AttestingIndices.Count; i++)
            {
                if (AttestingIndices[i] != other.AttestingIndices[i])
                {
                    return(false);
                }
            }

            return(true);
        }
Exemplo n.º 5
0
 public static int SszLength(IndexedAttestation value)
 {
     return(SszDynamicOffset +
            value.AttestingIndices.Length * ValidatorIndex.SszLength);
 }